Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch ARPACK for fortran calling convention to be consistent with MKL. #5303

Merged
merged 1 commit into from
Jan 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ USE_SYSTEM_RMATH=0
USE_SYSTEM_LIBUV=0

USE_MKL = 0
MKLLIB = $(MKLROOT)/lib/intel64

# Link to the LLVM shared library
USE_LLVM_SHLIB = 0
Expand Down Expand Up @@ -202,6 +201,7 @@ endif
endif

JFFLAGS = -O2 $(fPIC)
JF2CFLAGS = -ff2c -fno-second-underscore
CPP = $(CC) -E
AR := $(CROSS_COMPILE)ar
AS := $(CROSS_COMPILE)as
Expand Down Expand Up @@ -445,6 +445,9 @@ endif
ifeq ($(USE_MKL), 1)
ifeq ($(USE_BLAS64), 1)
export MKL_INTERFACE_LAYER := ILP64
MKLLIB = $(MKLROOT)/lib/intel64
else
MKLLIB = $(MKLROOT)/lib/ia32
endif
USE_SYSTEM_BLAS=1
USE_SYSTEM_LAPACK=1
Expand Down
7 changes: 6 additions & 1 deletion base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ function blas_set_num_threads(n::Integer)
end

function check_blas()
if blas_vendor() == :openblas
blas = blas_vendor()
if blas == :openblas
openblas_config = openblas_get_config()
openblas64 = ismatch(r".*USE64BITINT.*", openblas_config)
if Base.USE_BLAS64 != openblas64
Expand All @@ -323,6 +324,10 @@ function check_blas()
println("Quitting.")
quit()
end
elseif blas == :mkl
if Base.USE_BLAS64
ENV["MKL_INTERFACE_LAYER"] = "ILP64"
end
end

#
Expand Down
4 changes: 2 additions & 2 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ install-openlibm: $(OPENLIBM_OBJ_TARGET)

## openspecfun ##

OPENSPECFUN_FLAGS = ARCH="$(ARCH)" CC="$(CC)" FC="$(FC)" AR="$(AR)" OS="$(OS)" USECLANG=$(USECLANG) USEGCC=$(USEGCC) USE_OPENLIBM=1 OPENLIBM_HOME=$(JULIAHOME)/deps/openlibm
OPENSPECFUN_FLAGS = ARCH="$(ARCH)" CC="$(CC)" FC="$(FC)" AR="$(AR)" OS="$(OS)" USECLANG=$(USECLANG) USEGCC=$(USEGCC) FFLAGS="$(JFFLAGS)" USE_OPENLIBM=1 OPENLIBM_HOME=$(JULIAHOME)/deps/openlibm

OPENSPECFUN_OBJ_TARGET = $(BUILD)/$(JL_LIBDIR)/libopenspecfun.$(SHLIB_EXT)
OPENSPECFUN_OBJ_SOURCE = openspecfun/libopenspecfun.$(SHLIB_EXT)
Expand Down Expand Up @@ -1035,7 +1035,7 @@ endif
ARPACK_OBJ_TARGET = $(BUILD)/$(JL_LIBDIR)/libarpack.$(SHLIB_EXT)

ARPACK_MFLAGS = F77="$(FC)" MPIF77="$(FC)"
ARPACK_OPTS = $(FFLAGS) $(JFFLAGS)
ARPACK_FFLAGS += $(FFLAGS) $(JFFLAGS)
ARPACK_FLAGS = --with-blas="$(LIBBLAS)" --with-lapack="$(LIBLAPACK)" --disable-mpi --enable-shared FFLAGS="$(ARPACK_FFLAGS)"
ifneq ($(OS),WINNT)
ARPACK_FLAGS += LDFLAGS="-Wl,-rpath,'$(BUILD)/lib'"
Expand Down