Skip to content

Commit ee4bcab

Browse files
authored
Allow system versions of libwhich and libblastrampoline (#43000)
1 parent ca28619 commit ee4bcab

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

Make.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ USE_SYSTEM_LIBM:=0
4141
USE_SYSTEM_OPENLIBM:=0
4242
UNTRUSTED_SYSTEM_LIBM:=0
4343
USE_SYSTEM_DSFMT:=0
44+
USE_SYSTEM_LIBBLASTRAMPOLINE:=0
4445
USE_SYSTEM_BLAS:=0
4546
USE_SYSTEM_LAPACK:=0
4647
USE_SYSTEM_GMP:=0
@@ -1027,6 +1028,12 @@ else
10271028
PATCHELF := $(build_depsbindir)/patchelf
10281029
endif
10291030

1031+
ifeq ($(USE_SYSTEM_LIBWHICH), 1)
1032+
LIBWHICH := libwhich
1033+
else
1034+
LIBWHICH := $(build_depsbindir)/libwhich
1035+
endif
1036+
10301037
# On aarch64 and powerpc64le, we assume the page size is 64K. Our binutils linkers
10311038
# and such already assume this, but `patchelf` seems to be behind the times. We
10321039
# explicitly tell it to use this large page size so that when we rewrite rpaths and

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ JL_TARGETS += julia-debug
165165
endif
166166

167167
# private libraries, that are installed in $(prefix)/lib/julia
168-
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen libblastrampoline
168+
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen
169169
ifeq ($(BUNDLE_DEBUG_LIBS),1)
170170
JL_PRIVATE_LIBS-0 += libjulia-internal-debug libjulia-codegen-debug
171171
endif
172172
ifeq ($(USE_GPL_LIBS), 1)
173173
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcolamd libklu libldl librbio libspqr libsuitesparseconfig libumfpack
174174
endif
175+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBBLASTRAMPOLINE) += libblastrampoline
175176
JL_PRIVATE_LIBS-$(USE_SYSTEM_PCRE) += libpcre2-8
176177
JL_PRIVATE_LIBS-$(USE_SYSTEM_DSFMT) += libdSFMT
177178
JL_PRIVATE_LIBS-$(USE_SYSTEM_GMP) += libgmp libgmpxx

base/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ endif
164164

165165
define symlink_system_library
166166
libname_$2 := $$(notdir $(call versioned_libname,$2,$3))
167-
libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null)
167+
libpath_$2 := $$(shell $$(call spawn,$$(LIBWHICH)) -p $$(libname_$2) 2>/dev/null)
168168
symlink_$2: $$(build_private_libdir)/$$(libname_$2)
169169
$$(build_private_libdir)/$$(libname_$2):
170170
@if [ -e "$$(libpath_$2)" ]; then \
@@ -205,6 +205,7 @@ $(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE))
205205
$(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE))
206206
$(eval $(call symlink_system_library,PCRE,libpcre2-8))
207207
$(eval $(call symlink_system_library,DSFMT,libdSFMT))
208+
$(eval $(call symlink_system_library,LIBBLASTRAMPOLINE,libblastrampoline))
208209
$(eval $(call symlink_system_library,BLAS,$(LIBBLASNAME)))
209210
ifneq ($(LIBLAPACKNAME),$(LIBBLASNAME))
210211
$(eval $(call symlink_system_library,LAPACK,$(LIBLAPACKNAME)))

deps/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ unexport CONFIG_SITE
3939

4040
DEP_LIBS :=
4141

42-
# Always use libblastrampoline
42+
ifeq ($(USE_SYSTEM_LIBBLASTRAMPOLINE), 0)
4343
DEP_LIBS += blastrampoline
44+
endif
4445

4546
ifeq ($(USE_SYSTEM_CSL), 0)
4647
DEP_LIBS += csl
@@ -158,9 +159,11 @@ DEP_LIBS += lapack
158159
endif
159160
endif
160161

162+
ifeq ($(USE_SYSTEM_LIBWHICH), 0)
161163
ifneq ($(OS), WINNT)
162164
DEP_LIBS += libwhich
163165
endif
166+
endif
164167

165168
# list all targets
166169
DEP_LIBS_STAGED_ALL := llvm llvm-tools clang llvmunwind unwind libuv pcre \

0 commit comments

Comments
 (0)