Skip to content

Commit

Permalink
Fix: allow to override lapack/blas versions
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-s committed Feb 10, 2020
1 parent 2845fe7 commit 4f508ab
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions com.oracle.truffle.r.native/gnur/Makefile.libs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ $(error no platform.mk available)
endif
endif

# blas and lapack implementations can be overridden using the following environment variables
BLAS_LAPACK_DIR ?= $(GNUR_HOME_BINARY)/lib
BLAS_SOURCE ?= $(BLAS_LAPACK_DIR)/libRblas$(DYLIB_EXT)
LAPACK_SOURCE ?= $(BLAS_LAPACK_DIR)/libRlapack$(DYLIB_EXT)

$(info BLAS_LAPACK_DIR : $(BLAS_LAPACK_DIR))
$(info BLAS_SOURCE : $(BLAS_SOURCE))
$(info LAPACK_SOURCE : $(LAPACK_SOURCE))

BLAS_TARGET := $(FASTR_LIB_DIR)/libRblas$(DYLIB_EXT)
LAPACK_TARGET := $(FASTR_LIB_DIR)/libRlapack$(DYLIB_EXT)

# at a minimum we need to know where libpcre/libz/libgfortran/libquadmath are located,
# to keep the Java side simpler, we (may) copy them to $(FASTR_LIB_DIR) unless
# they were found in the standard system locations
Expand All @@ -47,10 +57,10 @@ $(FASTR_LIB_DIR):
mkdir -p $(FASTR_LIB_DIR)

$(BLAS_TARGET): $(GNUR_HOME_BINARY)/lib/libRblas$(DYLIB_EXT)
cp $(GNUR_HOME_BINARY)/lib/libRblas$(DYLIB_EXT) $(BLAS_TARGET)
cp $(BLAS_SOURCE) $(BLAS_TARGET)

$(LAPACK_TARGET): $(GNUR_HOME_BINARY)/lib/libRlapack$(DYLIB_EXT)
cp $(GNUR_HOME_BINARY)/lib/libRlapack$(DYLIB_EXT) $(LAPACK_TARGET)
cp $(LAPACK_SOURCE) $(LAPACK_TARGET)
ifeq ($(OS_NAME),Darwin)
# libRblas depends on libgfortran, libquadmath
# libRlapack depends on libgfortran, libquadmath, libRblas, libR
Expand Down

0 comments on commit 4f508ab

Please sign in to comment.