Move some DYNAMIC_ARCH targets to new DYNAMIC_OLDER option
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sat, 9 Jun 2018 14:29:17 +0000 (16:29 +0200)
committerGitHub <noreply@github.com>
Sat, 9 Jun 2018 14:29:17 +0000 (16:29 +0200)
CMakeLists.txt
Makefile
Makefile.install
Makefile.rule
Makefile.system

index f49f205..66c3d8a 100644 (file)
@@ -20,6 +20,7 @@ option(BUILD_WITHOUT_LAPACK "Without LAPACK and LAPACKE (Only BLAS or CBLAS)" ON
 endif()
 option(BUILD_WITHOUT_CBLAS "Without CBLAS" OFF)
 option(DYNAMIC_ARCH "Build with DYNAMIC_ARCH" OFF)
+option(DYNAMIC_OLDER "Support older cpus with DYNAMIC_ARCH" OFF)
 option(BUILD_RELAPACK "Build with ReLAPACK (recursive LAPACK" OFF)
 #######
 if(BUILD_WITHOUT_LAPACK)
index 380ba1c..56b4426 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -153,6 +153,9 @@ ifeq ($(DYNAMIC_ARCH), 1)
        do  $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
        done
        @echo DYNAMIC_ARCH=1 >> Makefile.conf_last
+ifeq ($(DYNAMIC_OLDER), 1)
+       @echo DYNAMIC_OLDER=1 >> Makefile.conf_last
+endif  
 endif
 ifdef USE_THREAD
        @echo USE_THREAD=$(USE_THREAD) >>  Makefile.conf_last
index 21c3c9e..c51c8a0 100644 (file)
@@ -98,7 +98,7 @@ endif
        @echo Generating openblas.pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
        @echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
        @echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
-       @echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
+       @echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
        @echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
        @echo 'extralib='$(EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
        @cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
index 1b4b8eb..5c03d01 100644 (file)
@@ -17,6 +17,11 @@ VERSION = 0.3.1.dev
 # If you want to support multiple architecture in one binary
 # DYNAMIC_ARCH = 1
 
+# If you want the full list of x86_64 architectures supported in DYNAMIC_ARCH
+# mode (including individual optimizied codes for PENRYN, DUNNINGTON, OPTERON,
+# OPTERON_SSE3, ATOM and NANO rather than fallbacks to older architectures)
+# DYNAMIC_OLDER = 1
+
 # C compiler including binary type(32bit / 64bit). Default is gcc.
 # Don't use Intel Compiler or PGI, it won't generate right codes as I expect.
 # CC = gcc
index eaf3e98..62ba0e4 100644 (file)
@@ -472,7 +472,18 @@ DYNAMIC_CORE = KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS \
 endif
 
 ifeq ($(ARCH), x86_64)
-DYNAMIC_CORE = PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO
+DYNAMIC_CORE = PRESCOTT CORE2 
+ifeq ($(DYNAMIC_OLDER), 1)
+DYNAMIC_CORE += PENRYN DUNNINGTON 
+endif
+DYNAMIC_CORE += NEHALEM 
+ifeq ($(DYNAMIC_OLDER), 1)
+DYNAMIC_CORE += OPTERON OPTERON_SSE3 
+endif
+DYNAMIC_CORE += BARCELONA 
+ifeq ($(DYNAMIC_OLDER), 1)
+DYNAMIC_CORE += BOBCAT ATOM NANO
+endif
 ifneq ($(NO_AVX), 1)
 DYNAMIC_CORE += SANDYBRIDGE BULLDOZER PILEDRIVER STEAMROLLER EXCAVATOR
 endif
@@ -917,6 +928,10 @@ ifeq ($(DYNAMIC_ARCH), 1)
 CCOMMON_OPT    += -DDYNAMIC_ARCH
 endif
 
+ifeq ($(DYNAMIC_OLDER), 1)
+CCOMMON_OPT    += -DDYNAMIC_OLDER
+endif
+
 ifeq ($(NO_LAPACK), 1)
 CCOMMON_OPT    += -DNO_LAPACK
 #Disable LAPACK C interface