diff --git a/Makefile b/Makefile index 6789272a3..90a3cda09 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,11 @@ ifndef SMP else @echo " (Multi threaded; Max num-threads is $(NUM_THREADS))" 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 shared : diff --git a/Makefile.install b/Makefile.install index 80dafc9c6..1fbb2c430 100644 --- a/Makefile.install +++ b/Makefile.install @@ -50,6 +50,7 @@ ifeq ($(OSNAME), NetBSD) endif ifeq ($(OSNAME), Darwin) -cp $(LIBDYNNAME) $(PREFIX) + -install_name_tool -add_rpath $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) -ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib endif ifeq ($(OSNAME), WINNT) diff --git a/exports/Makefile b/exports/Makefile index f4c9314f9..0a2f3184f 100644 --- a/exports/Makefile +++ b/exports/Makefile @@ -85,7 +85,7 @@ libgoto_hpl.def : gensymbol perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) > $(@F) $(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 $(CC) $(CFLAGS) -c -o $(@F) $^