Refs #57. The bug about absolute path of shared library on Mac OSX.

OSX cann't use relative path in shared library. Thank Mr.Kane for this patch. The detail is in this link (https://github.com/xianyi/OpenBLAS/issues/57).
This commit is contained in:
Xianyi 2011-09-17 02:58:01 +08:00
parent d0152ec8ca
commit 68cae521df
3 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,11 @@ ifndef SMP
else else
@echo " (Multi threaded; Max num-threads is $(NUM_THREADS))" @echo " (Multi threaded; Max num-threads is $(NUM_THREADS))"
endif endif
ifeq ($(OSNAME), Darwin)
@echo "Because absolute path issue, $(LIBDYNNAME) may not work under this directory."
@echo "Thus, you need run \"make PREFIX=/your_installation_path/ install\"."
endif
@echo @echo
shared : shared :

View File

@ -50,6 +50,7 @@ ifeq ($(OSNAME), NetBSD)
endif endif
ifeq ($(OSNAME), Darwin) ifeq ($(OSNAME), Darwin)
-cp $(LIBDYNNAME) $(PREFIX) -cp $(LIBDYNNAME) $(PREFIX)
-install_name_tool -add_rpath $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME)
-ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib -ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib
endif endif
ifeq ($(OSNAME), WINNT) ifeq ($(OSNAME), WINNT)

View File

@ -85,7 +85,7 @@ libgoto_hpl.def : gensymbol
perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) > $(@F) perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) > $(@F)
$(LIBDYNNAME) : ../$(LIBNAME) osx.def $(LIBDYNNAME) : ../$(LIBNAME) osx.def
$(PREFIX)gcc $(CFLAGS) -all_load -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name `pwd`/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
symbol.$(SUFFIX) : symbol.S symbol.$(SUFFIX) : symbol.S
$(CC) $(CFLAGS) -c -o $(@F) $^ $(CC) $(CFLAGS) -c -o $(@F) $^