diff --git a/Make.inc b/Make.inc index 7c2f5f0662aba..e674703f0dc95 100644 --- a/Make.inc +++ b/Make.inc @@ -41,6 +41,7 @@ USE_SYSTEM_LIBM:=0 USE_SYSTEM_OPENLIBM:=0 UNTRUSTED_SYSTEM_LIBM:=0 USE_SYSTEM_DSFMT:=0 +USE_SYSTEM_LIBBLASTRAMPOLINE:=0 USE_SYSTEM_BLAS:=0 USE_SYSTEM_LAPACK:=0 USE_SYSTEM_GMP:=0 @@ -1027,6 +1028,12 @@ else PATCHELF := $(build_depsbindir)/patchelf endif +ifeq ($(USE_SYSTEM_LIBWHICH), 1) +LIBWHICH := libwhich +else +LIBWHICH := $(build_depsbindir)/libwhich +endif + # On aarch64 and powerpc64le, we assume the page size is 64K. Our binutils linkers # and such already assume this, but `patchelf` seems to be behind the times. We # explicitly tell it to use this large page size so that when we rewrite rpaths and diff --git a/Makefile b/Makefile index d0a906e392488..cab4a2e9e4392 100644 --- a/Makefile +++ b/Makefile @@ -165,13 +165,14 @@ JL_TARGETS += julia-debug endif # private libraries, that are installed in $(prefix)/lib/julia -JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen libblastrampoline +JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen ifeq ($(BUNDLE_DEBUG_LIBS),1) JL_PRIVATE_LIBS-0 += libjulia-internal-debug libjulia-codegen-debug endif ifeq ($(USE_GPL_LIBS), 1) JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcolamd libklu libldl librbio libspqr libsuitesparseconfig libumfpack endif +JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBBLASTRAMPOLINE) += libblastrampoline JL_PRIVATE_LIBS-$(USE_SYSTEM_PCRE) += libpcre2-8 JL_PRIVATE_LIBS-$(USE_SYSTEM_DSFMT) += libdSFMT JL_PRIVATE_LIBS-$(USE_SYSTEM_GMP) += libgmp libgmpxx diff --git a/base/Makefile b/base/Makefile index 56e1cbebf21bf..c7a2c7a241e83 100644 --- a/base/Makefile +++ b/base/Makefile @@ -164,7 +164,7 @@ endif define symlink_system_library libname_$2 := $$(notdir $(call versioned_libname,$2,$3)) -libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null) +libpath_$2 := $$(shell $$(call spawn,$$(LIBWHICH)) -p $$(libname_$2) 2>/dev/null) symlink_$2: $$(build_private_libdir)/$$(libname_$2) $$(build_private_libdir)/$$(libname_$2): @if [ -e "$$(libpath_$2)" ]; then \ @@ -205,6 +205,7 @@ $(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE)) $(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE)) $(eval $(call symlink_system_library,PCRE,libpcre2-8)) $(eval $(call symlink_system_library,DSFMT,libdSFMT)) +$(eval $(call symlink_system_library,LIBBLASTRAMPOLINE,libblastrampoline)) $(eval $(call symlink_system_library,BLAS,$(LIBBLASNAME))) ifneq ($(LIBLAPACKNAME),$(LIBBLASNAME)) $(eval $(call symlink_system_library,LAPACK,$(LIBLAPACKNAME))) diff --git a/deps/Makefile b/deps/Makefile index 27b93f444580f..06897fc316493 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -39,8 +39,9 @@ unexport CONFIG_SITE DEP_LIBS := -# Always use libblastrampoline +ifeq ($(USE_SYSTEM_LIBBLASTRAMPOLINE), 0) DEP_LIBS += blastrampoline +endif ifeq ($(USE_SYSTEM_CSL), 0) DEP_LIBS += csl @@ -158,9 +159,11 @@ DEP_LIBS += lapack endif endif +ifeq ($(USE_SYSTEM_LIBWHICH), 0) ifneq ($(OS), WINNT) DEP_LIBS += libwhich endif +endif # list all targets DEP_LIBS_STAGED_ALL := llvm llvm-tools clang llvmunwind unwind libuv pcre \