Skip to content

Commit fdac921

Browse files
committed
Allow to supply custom blas/lapack libraries
1 parent 076a6b3 commit fdac921

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

com.oracle.truffle.r.native/fficall/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ ifeq ($(OS_NAME), Darwin)
6464
VERSION_FLAGS := -current_version $(R_VERSION) -compatibility_version $(R_VERSION)
6565
endif
6666

67-
# TODO: can we remove those?
68-
BLAS_TARGET := $(FASTR_LIB_DIR)/libRblas$(DYLIB_EXT)
69-
LAPACK_TARGET := $(FASTR_LIB_DIR)/libRlapack$(DYLIB_EXT)
70-
7167
all: $(R_LIB)
7268

7369
# use sentinels to avoid (usually unnecessary) rebuilds.

com.oracle.truffle.r.native/gnur/Makefile.libs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ $(error no platform.mk available)
3131
endif
3232
endif
3333

34+
# blas and lapack implementations can be overridden using the following environment variables
35+
BLAS_LAPACK_DIR ?= $(GNUR_HOME_BINARY)/lib
36+
BLAS_SOURCE ?= $(BLAS_LAPACK_DIR)/libRblas$(DYLIB_EXT)
37+
LAPACK_SOURCE ?= $(BLAS_LAPACK_DIR)/libRlapack$(DYLIB_EXT)
38+
3439
BLAS_TARGET := $(FASTR_LIB_DIR)/libRblas$(DYLIB_EXT)
3540
LAPACK_TARGET := $(FASTR_LIB_DIR)/libRlapack$(DYLIB_EXT)
41+
3642
# at a minimum we need to know where libpcre/libz/libgfortran/libquadmath are located,
3743
# to keep the Java side simpler, we (may) copy them to $(FASTR_LIB_DIR) unless
3844
# they were found in the standard system locations
@@ -47,10 +53,10 @@ $(FASTR_LIB_DIR):
4753
mkdir -p $(FASTR_LIB_DIR)
4854

4955
$(BLAS_TARGET): $(GNUR_HOME_BINARY)/lib/libRblas$(DYLIB_EXT)
50-
cp $(GNUR_HOME_BINARY)/lib/libRblas$(DYLIB_EXT) $(BLAS_TARGET)
56+
cp $(BLAS_SOURCE) $(BLAS_TARGET)
5157

5258
$(LAPACK_TARGET): $(GNUR_HOME_BINARY)/lib/libRlapack$(DYLIB_EXT)
53-
cp $(GNUR_HOME_BINARY)/lib/libRlapack$(DYLIB_EXT) $(LAPACK_TARGET)
59+
cp $(LAPACK_SOURCE) $(LAPACK_TARGET)
5460
ifeq ($(OS_NAME),Darwin)
5561
# libRblas depends on libgfortran, libquadmath
5662
# libRlapack depends on libgfortran, libquadmath, libRblas, libR

0 commit comments

Comments
 (0)