Merge branch 'hotfix-0.1alpha2.4'

This commit is contained in:
Xianyi 2011-09-18 16:57:28 +08:00
commit fe7a932ab8
11 changed files with 135 additions and 40 deletions

View File

@ -1,4 +1,21 @@
OpenBLAS ChangeLog OpenBLAS ChangeLog
====================================================================
Version 0.1 alpha2.4
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 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
to i386 calling convention, The callee should remove the first
hidden parameter.Thank Mr. John for this patch.
==================================================================== ====================================================================
Version 0.1 alpha2.3 Version 0.1 alpha2.3
5-Sep-2011 5-Sep-2011

View File

@ -56,6 +56,20 @@ 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 "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\"."
@echo @echo
shared : shared :
@ -118,6 +132,13 @@ endif
#Save the config files for installation #Save the config files for installation
cp Makefile.conf Makefile.conf_last cp Makefile.conf Makefile.conf_last
cp config.h config_last.h cp config.h config_last.h
ifdef QUAD_PRECISION
echo "#define QUAD_PRECISION">> config_last.h
endif
ifeq ($(EXPRECISION), 1)
echo "#define EXPRECISION">> config_last.h
endif
##
ifdef DYNAMIC_ARCH ifdef DYNAMIC_ARCH
$(MAKE) -C kernel commonlibs || exit 1 $(MAKE) -C kernel commonlibs || exit 1
for d in $(DYNAMIC_CORE) ; \ for d in $(DYNAMIC_CORE) ; \

View File

@ -3,6 +3,9 @@ export GOTOBLAS_MAKEFILE = 1
-include $(TOPDIR)/Makefile.conf_last -include $(TOPDIR)/Makefile.conf_last
include ./Makefile.system include ./Makefile.system
OPENBLAS_INCLUDE_DIR:=$(PREFIX)/include
OPENBLAS_LIBRARY_DIR:=$(PREFIX)/lib
.PHONY : install .PHONY : install
.NOTPARALLEL : install .NOTPARALLEL : install
@ -11,54 +14,57 @@ lib.grd :
install : lib.grd install : lib.grd
@-mkdir -p $(PREFIX) @-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 #for inc
@echo \#ifndef OPENBLAS_CONFIG_H > $(PREFIX)/openblas_config.h @echo \#ifndef OPENBLAS_CONFIG_H > $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@echo \#define OPENBLAS_CONFIG_H >> $(PREFIX)/openblas_config.h @echo \#define OPENBLAS_CONFIG_H >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@cat config_last.h >> $(PREFIX)/openblas_config.h @cat config_last.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(PREFIX)/openblas_config.h @echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@cat openblas_config_template.h >> $(PREFIX)/openblas_config.h @cat openblas_config_template.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@echo \#endif >> $(PREFIX)/openblas_config.h @echo \#endif >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
@echo Generating f77blas.h in $(PREFIX) @echo Generating f77blas.h in $(OPENBLAS_INCLUDE_DIR)
@echo \#ifndef OPENBLAS_F77BLAS_H > $(PREFIX)/f77blas.h @echo \#ifndef OPENBLAS_F77BLAS_H > $(OPENBLAS_INCLUDE_DIR)/f77blas.h
@echo \#define OPENBLAS_F77BLAS_H >> $(PREFIX)/f77blas.h @echo \#define OPENBLAS_F77BLAS_H >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
@echo \#include \"openblas_config.h\" >> $(PREFIX)/f77blas.h @echo \#include \"openblas_config.h\" >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
@cat common_interface.h >> $(PREFIX)/f77blas.h @cat common_interface.h >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
@echo \#endif >> $(PREFIX)/f77blas.h @echo \#endif >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
@echo Generating cblas.h in $(PREFIX) @echo Generating cblas.h in $(OPENBLAS_INCLUDE_DIR)
@sed 's/common/openblas_config/g' cblas.h > $(PREFIX)/cblas.h @sed 's/common/openblas_config/g' cblas.h > $(OPENBLAS_INCLUDE_DIR)/cblas.h
#for install static library #for install static library
@echo Copy the static library to $(PREFIX) @echo Copy the static library to $(OPENBLAS_LIBRARY_DIR)
@cp $(LIBNAME) $(PREFIX) @cp $(LIBNAME) $(OPENBLAS_LIBRARY_DIR)
@-ln -fs $(PREFIX)/$(LIBNAME) $(PREFIX)/libopenblas.$(LIBSUFFIX) @-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.$(LIBSUFFIX)
#for install shared library #for install shared library
@echo Copy the shared library to $(PREFIX) @echo Copy the shared library to $(OPENBLAS_LIBRARY_DIR)
ifeq ($(OSNAME), Linux) ifeq ($(OSNAME), Linux)
-cp $(LIBSONAME) $(PREFIX) -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so
endif endif
ifeq ($(OSNAME), FreeBSD) ifeq ($(OSNAME), FreeBSD)
-cp $(LIBSONAME) $(PREFIX) -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so
endif endif
ifeq ($(OSNAME), NetBSD) ifeq ($(OSNAME), NetBSD)
-cp $(LIBSONAME) $(PREFIX) -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.so
endif endif
ifeq ($(OSNAME), Darwin) ifeq ($(OSNAME), Darwin)
-cp $(LIBDYNNAME) $(PREFIX) -cp $(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib -install_name_tool -id $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)
-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dylib
endif endif
ifeq ($(OSNAME), WINNT) ifeq ($(OSNAME), WINNT)
-cp $(LIBDLLNAME) $(PREFIX) -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dll
endif endif
ifeq ($(OSNAME), CYGWIN_NT) ifeq ($(OSNAME), CYGWIN_NT)
-cp $(LIBDLLNAME) $(PREFIX) -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
-ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/libopenblas.dll
endif endif
@echo Install OK! @echo Install OK!

View File

@ -3,7 +3,7 @@
# #
# This library's version # This library's version
VERSION = 0.1alpha2.3 VERSION = 0.1alpha2.4
# You can specify the target architecture, otherwise it's # You can specify the target architecture, otherwise it's
# automatically detected. # automatically detected.

View File

@ -27,7 +27,13 @@ HOSTCC = $(CC)
endif endif
ifdef TARGET 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 endif
ifdef INTERFACE64 ifdef INTERFACE64

View File

@ -38,6 +38,11 @@
#ifndef ASSEMBLER #ifndef ASSEMBLER
#ifdef __cplusplus
extern "C" {
/* Assume C declarations for C++ */
#endif /* __cplusplus */
int BLASFUNC(xerbla)(char *, blasint *info, blasint); int BLASFUNC(xerbla)(char *, blasint *info, blasint);
FLOATRET BLASFUNC(sdot) (blasint *, float *, blasint *, float *, blasint *); FLOATRET BLASFUNC(sdot) (blasint *, float *, blasint *, float *, blasint *);
@ -733,4 +738,10 @@ xdouble BLASFUNC(qlamch)(char *);
FLOATRET BLASFUNC(slamc3)(float *, float *); FLOATRET BLASFUNC(slamc3)(float *, float *);
double BLASFUNC(dlamc3)(double *, double *); double BLASFUNC(dlamc3)(double *, double *);
xdouble BLASFUNC(qlamc3)(xdouble *, xdouble *); xdouble BLASFUNC(qlamc3)(xdouble *, xdouble *);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif #endif

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 $(CURDIR)/../$(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) $^

View File

@ -307,7 +307,11 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
#if defined(F_INTERFACE) && defined(RETURN_BY_STACK)
ret $0x4
#else
ret ret
#endif
ALIGN_3 ALIGN_3
.L88: .L88:
@ -326,6 +330,10 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
ret
#if defined(F_INTERFACE) && defined(RETURN_BY_STACK)
ret $0x4
#else
ret
#endif
EPILOGUE EPILOGUE

View File

@ -283,7 +283,11 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
#if defined(DOUBLE) || defined(XDOUBLE)
ret $0x4
#else
ret ret
#endif
ALIGN_3 ALIGN_3
.L88: .L88:
@ -305,6 +309,10 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
ret
#if defined(DOUBLE) || defined(XDOUBLE)
ret $0x4
#else
ret
#endif
EPILOGUE EPILOGUE

View File

@ -1542,7 +1542,5 @@
popl %esi popl %esi
popl %edi popl %edi
/*remove the hidden return value address from the stack.*/ /*remove the hidden return value address from the stack.*/
popl %ecx ret $0x4
xchgl %ecx, 0(%esp)
ret
EPILOGUE EPILOGUE

View File

@ -6,6 +6,16 @@
#define BLASFUNC(FUNC) FUNC #define BLASFUNC(FUNC) FUNC
#endif #endif
#ifdef QUAD_PRECISION
typedef struct {
unsigned long x[2];
} xdouble;
#elif defined EXPRECISION
#define xdouble long double
#else
#define xdouble double
#endif
#if defined(OS_WINDOWS) && defined(__64BIT__) #if defined(OS_WINDOWS) && defined(__64BIT__)
typedef long long BLASLONG; typedef long long BLASLONG;
typedef unsigned long long BLASULONG; typedef unsigned long long BLASULONG;
@ -19,3 +29,13 @@ typedef BLASLONG blasint;
#else #else
typedef int blasint; typedef int blasint;
#endif #endif
#if defined(XDOUBLE) || defined(DOUBLE)
#define FLOATRET FLOAT
#else
#ifdef NEED_F2CCONV
#define FLOATRET double
#else
#define FLOATRET float
#endif
#endif