From d0152ec8caa77c5f122572302c8c9589b3eb2909 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sat, 17 Sep 2011 02:27:56 +0800 Subject: [PATCH 1/8] Fixed #61 a building bug about setting TARGET and DYNAMIC_ARCH at the same time. --- Makefile.system | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index f0487ac50..84f41a78f 100644 --- a/Makefile.system +++ b/Makefile.system @@ -27,7 +27,13 @@ HOSTCC = $(CC) endif ifdef TARGET -GETARCH_FLAGS += -DFORCE_$(TARGET) +GETARCH_FLAGS := -DFORCE_$(TARGET) +endif + +#TARGET_CORE will override TARGET which is used in DYNAMIC_ARCH=1. +# +ifdef TARGET_CORE +GETARCH_FLAGS := -DFORCE_$(TARGET_CORE) endif ifdef INTERFACE64 From 68cae521dff0eb87a9de52685b8dee0f7b7e7418 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sat, 17 Sep 2011 02:58:01 +0800 Subject: [PATCH 2/8] 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). --- Makefile | 5 +++++ Makefile.install | 1 + exports/Makefile | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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) $^ From 864c68ffc5a4882c2a88e0c9f8f32ead96271fde Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sat, 17 Sep 2011 03:05:26 +0800 Subject: [PATCH 3/8] Bump the version number. --- Makefile.rule | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.rule b/Makefile.rule index 3b32ded84..a7ba203fc 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -3,7 +3,7 @@ # # This library's version -VERSION = 0.1alpha2.3 +VERSION = 0.1alpha2.4 # You can specify the target architecture, otherwise it's # automatically detected. From 756477bfe3791f13ed270d1d75ad1dfccbf83bc1 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sat, 17 Sep 2011 07:21:11 +0800 Subject: [PATCH 4/8] Output the installation tip after building complete. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 90a3cda09..0c82d4a95 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,8 @@ ifeq ($(OSNAME), Darwin) @echo "Thus, you need run \"make PREFIX=/your_installation_path/ install\"." endif @echo + @echo "To install the library, you can run \"make PREFIX=/path/to/your/installation install\"." + @echo shared : ifeq ($(OSNAME), Linux) From 821cbb29958b15bff260d72553b5880bbddf704f Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sat, 17 Sep 2011 07:55:59 +0800 Subject: [PATCH 5/8] Updated the document for 0.1 alpha 2.4. --- Changelog.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 7d8a06edb..cd67f333d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,19 @@ OpenBLAS ChangeLog +==================================================================== +Version 0.1 alpha2.4 +16-Sep-2011 +common: + * Fixed a bug about installation. The header file "fblas77.h" + works fine now. + * Fixed #61 a building bug about setting TARGET and DYNAMIC_ARCH. + * Try to handle absolute path of shared library in OSX. (#57) + Thank Mr.Kane. + +x86/x86_64: + * Fixed #58 zdot/xdot SEGFAULT bug with GCC-4.6 on x86. According + to i386 calling convention, The callee should remove the first + hidden parameter.Thank Mr. John for this patch. + ==================================================================== Version 0.1 alpha2.3 5-Sep-2011 From bcc795621607b59c31fb7b59fc30d3eba15729b9 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sun, 18 Sep 2011 01:35:12 +0800 Subject: [PATCH 6/8] Refs #57. Continue to fix absolute path issue about shared library on Mac OSX. Used $(CURDIR) instead of pwd in generating shared library on Mac OSX. Add more tips about this issue. Thank Dr Kane O'Donnell. --- Makefile | 11 +++++++++-- Makefile.install | 4 ++-- exports/Makefile | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 573c44c33..56d491077 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,15 @@ else 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\"." + @echo "WARNING: If you plan to use the dynamic library $(LIBDYNNAME), you must run:" + @echo + @echo "\"make PREFIX=/your_installation_path/ install\"." + @echo + @echo "(or set PREFIX in Makefile.rule and run make install." + @echo "If you want to move the .dylib to a new location later, make sure you change" + @echo "the internal name of the dylib with:" + @echo + @echo "install_name_tool -id /new/absolute/path/to/$(LIBDYNNAME) $(LIBDYNNAME)" endif @echo @echo "To install the library, you can run \"make PREFIX=/path/to/your/installation install\"." diff --git a/Makefile.install b/Makefile.install index 1fbb2c430..5b5895c1c 100644 --- a/Makefile.install +++ b/Makefile.install @@ -48,9 +48,9 @@ ifeq ($(OSNAME), NetBSD) -cp $(LIBSONAME) $(PREFIX) -ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so endif -ifeq ($(OSNAME), Darwin) +ifeq ($(OSNAME), Darwin) -cp $(LIBDYNNAME) $(PREFIX) - -install_name_tool -add_rpath $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) + -install_name_tool -id $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) -ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib endif ifeq ($(OSNAME), WINNT) diff --git a/exports/Makefile b/exports/Makefile index 0a2f3184f..08f496501 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 - $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name `pwd`/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) + $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name $(CURDIR)/../$(LIBDYNNAME) -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB) symbol.$(SUFFIX) : symbol.S $(CC) $(CFLAGS) -c -o $(@F) $^ From d40e5621e95f5633efbbe94b07c3309713ba6432 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sun, 18 Sep 2011 05:07:00 +0800 Subject: [PATCH 7/8] Change the installation folder into /include and /lib. --- Makefile.install | 69 ++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/Makefile.install b/Makefile.install index 5b5895c1c..2778a491f 100644 --- a/Makefile.install +++ b/Makefile.install @@ -3,6 +3,9 @@ export GOTOBLAS_MAKEFILE = 1 -include $(TOPDIR)/Makefile.conf_last include ./Makefile.system +OPENBLAS_INCLUDE_DIR:=$(PREFIX)/include +OPENBLAS_LIBRARY_DIR:=$(PREFIX)/lib + .PHONY : install .NOTPARALLEL : install @@ -11,55 +14,57 @@ lib.grd : install : lib.grd @-mkdir -p $(PREFIX) - @echo Generating openblas_config.h in $(PREFIX) + @-mkdir -p $(OPENBLAS_INCLUDE_DIR) + @-mkdir -p $(OPENBLAS_LIBRARY_DIR) + @echo Generating openblas_config.h in $(OPENBLAS_INCLUDE_DIR) #for inc - @echo \#ifndef OPENBLAS_CONFIG_H > $(PREFIX)/openblas_config.h - @echo \#define OPENBLAS_CONFIG_H >> $(PREFIX)/openblas_config.h - @cat config_last.h >> $(PREFIX)/openblas_config.h - @echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(PREFIX)/openblas_config.h - @cat openblas_config_template.h >> $(PREFIX)/openblas_config.h - @echo \#endif >> $(PREFIX)/openblas_config.h + @echo \#ifndef OPENBLAS_CONFIG_H > $(OPENBLAS_INCLUDE_DIR)/openblas_config.h + @echo \#define OPENBLAS_CONFIG_H >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h + @cat config_last.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h + @echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h + @cat openblas_config_template.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h + @echo \#endif >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h - @echo Generating f77blas.h in $(PREFIX) - @echo \#ifndef OPENBLAS_F77BLAS_H > $(PREFIX)/f77blas.h - @echo \#define OPENBLAS_F77BLAS_H >> $(PREFIX)/f77blas.h - @echo \#include \"openblas_config.h\" >> $(PREFIX)/f77blas.h - @cat common_interface.h >> $(PREFIX)/f77blas.h - @echo \#endif >> $(PREFIX)/f77blas.h + @echo Generating f77blas.h in $(OPENBLAS_INCLUDE_DIR) + @echo \#ifndef OPENBLAS_F77BLAS_H > $(OPENBLAS_INCLUDE_DIR)/f77blas.h + @echo \#define OPENBLAS_F77BLAS_H >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h + @echo \#include \"openblas_config.h\" >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h + @cat common_interface.h >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h + @echo \#endif >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h - @echo Generating cblas.h in $(PREFIX) - @sed 's/common/openblas_config/g' cblas.h > $(PREFIX)/cblas.h + @echo Generating cblas.h in $(OPENBLAS_INCLUDE_DIR) + @sed 's/common/openblas_config/g' cblas.h > $(OPENBLAS_INCLUDE_DIR)/cblas.h #for install static library - @echo Copy the static library to $(PREFIX) - @cp $(LIBNAME) $(PREFIX) - @-ln -fs $(PREFIX)/$(LIBNAME) $(PREFIX)/libopenblas.$(LIBSUFFIX) + @echo Copy the static library to $(OPENBLAS_LIBRARY_DIR) + @cp $(LIBNAME) $(OPENBLAS_LIBRARY_DIR) + @-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.$(LIBSUFFIX) #for install shared library - @echo Copy the shared library to $(PREFIX) + @echo Copy the shared library to $(OPENBLAS_LIBRARY_DIR) ifeq ($(OSNAME), Linux) - -cp $(LIBSONAME) $(PREFIX) - -ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so + -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so endif ifeq ($(OSNAME), FreeBSD) - -cp $(LIBSONAME) $(PREFIX) - -ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so + -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so endif ifeq ($(OSNAME), NetBSD) - -cp $(LIBSONAME) $(PREFIX) - -ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so + -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so endif ifeq ($(OSNAME), Darwin) - -cp $(LIBDYNNAME) $(PREFIX) - -install_name_tool -id $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/$(LIBDYNNAME) - -ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib + -cp $(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR) + -install_name_tool -id $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dylib endif ifeq ($(OSNAME), WINNT) - -cp $(LIBDLLNAME) $(PREFIX) - -ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll + -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dll endif ifeq ($(OSNAME), CYGWIN_NT) - -cp $(LIBDLLNAME) $(PREFIX) - -ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll + -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR) + -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dll endif @echo Install OK! From 1d31c79dc938183203be5e16cc6851a0bfa1a5e6 Mon Sep 17 00:00:00 2001 From: Xianyi Date: Sun, 18 Sep 2011 05:46:08 +0800 Subject: [PATCH 8/8] Prepared the document for 0.1 alpha 2.4 version. --- Changelog.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index cd67f333d..48c5a727d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,13 +1,15 @@ OpenBLAS ChangeLog ==================================================================== Version 0.1 alpha2.4 -16-Sep-2011 +18-Sep-2011 common: * Fixed a bug about installation. The header file "fblas77.h" works fine now. * Fixed #61 a building bug about setting TARGET and DYNAMIC_ARCH. * Try to handle absolute path of shared library in OSX. (#57) - Thank Mr.Kane. + Thank Dr Kane O'Donnell. + * Changed the installation folder layout to $(PREFIX)/include and + $(PREFIX)/lib x86/x86_64: * Fixed #58 zdot/xdot SEGFAULT bug with GCC-4.6 on x86. According