Skip to content

Commit

Permalink
Merge pull request #5303 from JuliaLang/vs/arpack-mkl
Browse files Browse the repository at this point in the history
Patch ARPACK for fortran calling convention to be consistent with MKL.
  • Loading branch information
ViralBShah committed Jan 9, 2014
2 parents a0958a2 + bb14b40 commit 7c2301f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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

0 comments on commit 7c2301f

Please sign in to comment.