a fortran compiler, please try make ONLY_CBLAS=1. This mode only compiler CBLAS without BLAS fortran interface and LAPACK.tags/v0.2.9.rc1
| @@ -31,7 +31,7 @@ SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench | |||||
| all :: libs netlib tests shared | all :: libs netlib tests shared | ||||
| @echo | @echo | ||||
| @echo " OpenBLAS build complete." | |||||
| @echo " OpenBLAS build complete. ($(LIB_COMPONENTS))" | |||||
| @echo | @echo | ||||
| @echo " OS ... $(OSNAME) " | @echo " OS ... $(OSNAME) " | ||||
| @echo " Architecture ... $(ARCH) " | @echo " Architecture ... $(ARCH) " | ||||
| @@ -44,7 +44,9 @@ ifdef INTERFACE64 | |||||
| @echo " Use 64 bits int (equivalent to \"-i8\" in Fortran) " | @echo " Use 64 bits int (equivalent to \"-i8\" in Fortran) " | ||||
| endif | endif | ||||
| @echo " C compiler ... $(C_COMPILER) (command line : $(CC))" | @echo " C compiler ... $(C_COMPILER) (command line : $(CC))" | ||||
| ifndef NOFORTRAN | |||||
| @echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))" | @echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))" | ||||
| endif | |||||
| ifneq ($(OSNAME), AIX) | ifneq ($(OSNAME), AIX) | ||||
| @echo -n " Library Name ... $(LIBNAME)" | @echo -n " Library Name ... $(LIBNAME)" | ||||
| else | else | ||||
| @@ -23,7 +23,17 @@ all: getarch_2nd cblas_noconst.h | |||||
| config.h : c_check f_check getarch | config.h : c_check f_check getarch | ||||
| perl ./c_check $(TARGET_MAKE) $(TARGET_CONF) $(CC) | perl ./c_check $(TARGET_MAKE) $(TARGET_CONF) $(CC) | ||||
| ifneq ($(ONLY_CBLAS), 1) | |||||
| perl ./f_check $(TARGET_MAKE) $(TARGET_CONF) $(FC) | perl ./f_check $(TARGET_MAKE) $(TARGET_CONF) $(FC) | ||||
| else | |||||
| #When we only build CBLAS, we set NOFORTRAN=2 | |||||
| echo "NOFORTRAN=2" >> $(TARGET_MAKE) | |||||
| echo "NO_FBLAS=1" >> $(TARGET_MAKE) | |||||
| echo "F_COMPILER=GFORTRAN" >> $(TARGET_MAKE) | |||||
| echo "BU=_" >> $(TARGET_MAKE) | |||||
| echo "#define BUNDERSCORE _" >> $(TARGET_CONF) | |||||
| echo "#define NEEDBUNDERSCORE 1" >> $(TARGET_CONF) | |||||
| endif | |||||
| ./getarch 0 >> $(TARGET_MAKE) | ./getarch 0 >> $(TARGET_MAKE) | ||||
| ./getarch 1 >> $(TARGET_CONF) | ./getarch 1 >> $(TARGET_CONF) | ||||
| @@ -54,6 +54,10 @@ VERSION = 0.2.8 | |||||
| # If you don't need CBLAS interface, please comment it in. | # If you don't need CBLAS interface, please comment it in. | ||||
| # NO_CBLAS = 1 | # NO_CBLAS = 1 | ||||
| # If you only want CBLAS interface without installing Fortran compiler, | |||||
| # please comment it in. | |||||
| # ONLY_CBLAS = 1 | |||||
| # If you don't need LAPACK, please comment it in. | # If you don't need LAPACK, please comment it in. | ||||
| # If you set NO_LAPACK=1, the library automatically sets NO_LAPACKE=1. | # If you set NO_LAPACK=1, the library automatically sets NO_LAPACKE=1. | ||||
| # NO_LAPACK = 1 | # NO_LAPACK = 1 | ||||
| @@ -82,12 +82,19 @@ ifeq ($(HOSTCC), loongcc) | |||||
| GETARCH_FLAGS += -static | GETARCH_FLAGS += -static | ||||
| endif | endif | ||||
| #if don't use Fortran, it will only compile CBLAS. | |||||
| ifeq ($(ONLY_CBLAS), 1) | |||||
| NO_LAPACK = 1 | |||||
| else | |||||
| ONLY_CBLAS = 0 | |||||
| endif | |||||
| # This operation is expensive, so execution should be once. | # This operation is expensive, so execution should be once. | ||||
| ifndef GOTOBLAS_MAKEFILE | ifndef GOTOBLAS_MAKEFILE | ||||
| export GOTOBLAS_MAKEFILE = 1 | export GOTOBLAS_MAKEFILE = 1 | ||||
| # Generating Makefile.conf and config.h | # Generating Makefile.conf and config.h | ||||
| DUMMY := $(shell $(MAKE) -C $(TOPDIR) -f Makefile.prebuild CC="$(CC)" FC="$(FC)" HOSTCC="$(HOSTCC)" CFLAGS="$(GETARCH_FLAGS)" BINARY=$(BINARY) USE_OPENMP=$(USE_OPENMP) TARGET_CORE=$(TARGET_CORE) all) | |||||
| DUMMY := $(shell $(MAKE) -C $(TOPDIR) -f Makefile.prebuild CC="$(CC)" FC="$(FC)" HOSTCC="$(HOSTCC)" CFLAGS="$(GETARCH_FLAGS)" BINARY=$(BINARY) USE_OPENMP=$(USE_OPENMP) TARGET_CORE=$(TARGET_CORE) ONLY_CBLAS=$(ONLY_CBLAS) all) | |||||
| ifndef TARGET_CORE | ifndef TARGET_CORE | ||||
| include $(TOPDIR)/Makefile.conf | include $(TOPDIR)/Makefile.conf | ||||
| @@ -885,6 +892,23 @@ LIBZIPNAME = $(LIBNAME:.$(LIBSUFFIX)=.zip) | |||||
| LIBS = $(TOPDIR)/$(LIBNAME) | LIBS = $(TOPDIR)/$(LIBNAME) | ||||
| LIBS_P = $(TOPDIR)/$(LIBNAME_P) | LIBS_P = $(TOPDIR)/$(LIBNAME_P) | ||||
| LIB_COMPONENTS = BLAS | |||||
| ifneq ($(NO_CBLAS), 1) | |||||
| LIB_COMPONENTS += CBLAS | |||||
| endif | |||||
| ifneq ($(NO_LAPACK), 1) | |||||
| LIB_COMPONENTS += LAPACK | |||||
| ifneq ($(NO_LAPACKE), 1) | |||||
| LIB_COMPONENTS += LAPACKE | |||||
| endif | |||||
| endif | |||||
| ifeq ($(ONLY_CBLAS), 1) | |||||
| LIB_COMPONENTS = CBLAS | |||||
| endif | |||||
| export OSNAME | export OSNAME | ||||
| export ARCH | export ARCH | ||||
| export CORE | export CORE | ||||
| @@ -911,6 +935,7 @@ export USE_OPENMP | |||||
| export CROSS | export CROSS | ||||
| export CROSS_SUFFIX | export CROSS_SUFFIX | ||||
| export NOFORTRAN | export NOFORTRAN | ||||
| export NO_FBLAS | |||||
| export EXTRALIB | export EXTRALIB | ||||
| export CEXTRALIB | export CEXTRALIB | ||||
| export FEXTRALIB | export FEXTRALIB | ||||
| @@ -22,6 +22,10 @@ ifndef NEED2UNDERSCORES | |||||
| NEED2UNDERSCORES=0 | NEED2UNDERSCORES=0 | ||||
| endif | endif | ||||
| ifndef ONLY_CBLAS | |||||
| ONLY_CBLAS = 0 | |||||
| endif | |||||
| ifeq ($(OSNAME), WINNT) | ifeq ($(OSNAME), WINNT) | ||||
| ifeq ($(F_COMPILER), GFORTRAN) | ifeq ($(F_COMPILER), GFORTRAN) | ||||
| EXTRALIB += -lgfortran | EXTRALIB += -lgfortran | ||||
| @@ -98,13 +102,13 @@ libgoto2_shared.dll : ../$(LIBNAME) libgoto2_shared.def | |||||
| -Wl,--out-implib,libgoto2_shared.lib $(FEXTRALIB) | -Wl,--out-implib,libgoto2_shared.lib $(FEXTRALIB) | ||||
| libopenblas.def : gensymbol | libopenblas.def : gensymbol | ||||
| perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| libgoto2_shared.def : gensymbol | libgoto2_shared.def : gensymbol | ||||
| perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol win2k $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| libgoto_hpl.def : gensymbol | libgoto_hpl.def : gensymbol | ||||
| perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol win2khpl $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| $(LIBDYNNAME) : ../$(LIBNAME) osx.def | $(LIBDYNNAME) : ../$(LIBNAME) osx.def | ||||
| $(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name $(CURDIR)/../$(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) | ||||
| @@ -191,23 +195,23 @@ static : ../$(LIBNAME) | |||||
| rm -f goto.$(SUFFIX) | rm -f goto.$(SUFFIX) | ||||
| linux.def : gensymbol ../Makefile.system ../getarch.c | linux.def : gensymbol ../Makefile.system ../getarch.c | ||||
| perl ./gensymbol linux $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol linux $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| osx.def : gensymbol ../Makefile.system ../getarch.c | osx.def : gensymbol ../Makefile.system ../getarch.c | ||||
| perl ./gensymbol osx $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol osx $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| aix.def : gensymbol ../Makefile.system ../getarch.c | aix.def : gensymbol ../Makefile.system ../getarch.c | ||||
| perl ./gensymbol aix $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > $(@F) | |||||
| perl ./gensymbol aix $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F) | |||||
| symbol.S : gensymbol | symbol.S : gensymbol | ||||
| perl ./gensymbol win2kasm noarch dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > symbol.S | |||||
| perl ./gensymbol win2kasm noarch dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > symbol.S | |||||
| test : linktest.c | test : linktest.c | ||||
| $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) -lm && echo OK. | $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) -lm && echo OK. | ||||
| rm -f linktest | rm -f linktest | ||||
| linktest.c : gensymbol ../Makefile.system ../getarch.c | linktest.c : gensymbol ../Makefile.system ../getarch.c | ||||
| perl ./gensymbol linktest $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) > linktest.c | |||||
| perl ./gensymbol linktest $(ARCH) $(BU) $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > linktest.c | |||||
| clean :: | clean :: | ||||
| @rm -f *.def *.dylib __.SYMDEF* | @rm -f *.def *.dylib __.SYMDEF* | ||||
| @@ -2675,7 +2675,10 @@ | |||||
| #These function may need 2 underscores. | #These function may need 2 underscores. | ||||
| @lapack_embeded_underscore_objs=(xerbla_array, chla_transtype,); | @lapack_embeded_underscore_objs=(xerbla_array, chla_transtype,); | ||||
| if ($ARGV[5] == 1) { | |||||
| if ($ARGV[8] == 1) { | |||||
| #ONLY_CBLAS=1 | |||||
| @underscore_objs = (@misc_underscore_objs); | |||||
| } elsif ($ARGV[5] == 1) { | |||||
| #NO_LAPACK=1 | #NO_LAPACK=1 | ||||
| @underscore_objs = (@blasobjs, @misc_underscore_objs); | @underscore_objs = (@blasobjs, @misc_underscore_objs); | ||||
| } elsif (-d "../lapack-3.1.1" || -d "../lapack-3.4.0" || -d "../lapack-3.4.1" || | } elsif (-d "../lapack-3.1.1" || -d "../lapack-3.4.0" || -d "../lapack-3.4.1" || | ||||
| @@ -2695,6 +2698,12 @@ if ($ARGV[5] == 1) { | |||||
| @underscore_objs = (@blasobjs, @lapackobjs, @misc_underscore_objs); | @underscore_objs = (@blasobjs, @lapackobjs, @misc_underscore_objs); | ||||
| } | } | ||||
| if ($ARGV[8] == 1) { | |||||
| #ONLY_CBLAS=1 | |||||
| @gemm3mobjs=(); | |||||
| @exblasobjs=(); | |||||
| } | |||||
| if ($ARGV[3] == 1){ @underscore_objs = (@underscore_objs, @exblasobjs); }; | if ($ARGV[3] == 1){ @underscore_objs = (@underscore_objs, @exblasobjs); }; | ||||
| if ($ARGV[1] eq "x86_64"){ @underscore_objs = (@underscore_objs, @gemm3mobjs); }; | if ($ARGV[1] eq "x86_64"){ @underscore_objs = (@underscore_objs, @gemm3mobjs); }; | ||||
| @@ -786,7 +786,7 @@ endif | |||||
| qgemv.$(SUFFIX) qgemv.$(PSUFFIX): gemv.c | qgemv.$(SUFFIX) qgemv.$(PSUFFIX): gemv.c | ||||
| $(CC) -c $(CFLAGS) -o $(@F) $< | $(CC) -c $(CFLAGS) -o $(@F) $< | ||||
| ifndef USE_NETLIB_GEMV | ifndef USE_NETLIB_GEMV | ||||
| cgemv.$(SUFFIX) cgemv.$(PSUFFIX): zgemv.c | cgemv.$(SUFFIX) cgemv.$(PSUFFIX): zgemv.c | ||||
| $(CC) -c $(CFLAGS) -o $(@F) $< | $(CC) -c $(CFLAGS) -o $(@F) $< | ||||