Skip to content

Commit

Permalink
Allow system versions of libwhich and libblastrampoline (#43000)
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie authored Nov 8, 2021
1 parent ca28619 commit ee4bcab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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)))
Expand Down
5 changes: 4 additions & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit ee4bcab

Please sign in to comment.