summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2017-02-03 00:25:30 -0600
committerKyle Guinn <elyk03@gmail.com>2017-02-03 00:25:30 -0600
commitc2f0429d7bf15a588f4a2a4e844a7c91212efbfc (patch)
tree27e7b29c750ed7d782ae3aa115ad6a3864f5e1db
parente64606d9f0823a46bd83b46decd03b996867a1bf (diff)
downloadlapack-c2f0429d7bf15a588f4a2a4e844a7c91212efbfc.tar.gz
lapack-c2f0429d7bf15a588f4a2a4e844a7c91212efbfc.tar.bz2
lapack-c2f0429d7bf15a588f4a2a4e844a7c91212efbfc.zip
Use appending to create lists of source files
Allows any combination of types/precisions to be built at once. Name the lists "SOURCES" instead of "ALLOBJ" since they contain lists of source files, not object files. Fix problems in BLAS: Was missing the ${CBLAS3} file set when building with BLAS_COMPLEX. Was adding ${BLASLIB} as if it were a source file.
-rw-r--r--BLAS/SRC/CMakeLists.txt22
-rw-r--r--CBLAS/src/CMakeLists.txt24
-rw-r--r--SRC/CMakeLists.txt18
-rw-r--r--TESTING/MATGEN/CMakeLists.txt19
4 files changed, 32 insertions, 51 deletions
diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt
index b9f722d6..42930279 100644
--- a/BLAS/SRC/CMakeLists.txt
+++ b/BLAS/SRC/CMakeLists.txt
@@ -113,30 +113,24 @@ set(DBLAS3 dgemm.f dsymm.f dsyrk.f dsyr2k.f dtrmm.f dtrsm.f)
set(ZBLAS3 zgemm.f zsymm.f zsyrk.f zsyr2k.f ztrmm.f ztrsm.f
zhemm.f zherk.f zher2k.f)
-# default build all of it
-set(ALLOBJ ${SBLAS1} ${SBLAS2} ${SBLAS3} ${DBLAS1} ${DBLAS2} ${DBLAS3}
- ${CBLAS1} ${CBLAS2} ${CBLAS3} ${ZBLAS1}
- ${ZBLAS2} ${ZBLAS3} ${ALLBLAS})
+
+set(SOURCES)
if(BLAS_SINGLE)
- set(ALLOBJ ${SBLAS1} ${ALLBLAS}
- ${SBLAS2} ${SBLAS3})
+ list(APPEND SOURCES ${SBLAS1} ${ALLBLAS} ${SBLAS2} ${SBLAS3})
endif()
if(BLAS_DOUBLE)
- set(ALLOBJ ${DBLAS1} ${ALLBLAS}
- ${DBLAS2} ${DBLAS3})
+ list(APPEND SOURCES ${DBLAS1} ${ALLBLAS} ${DBLAS2} ${DBLAS3})
endif()
if(BLAS_COMPLEX)
- set(ALLOBJ ${BLASLIB} ${CBLAS1} ${CB1AUX}
- ${ALLBLAS} ${CBLAS2})
+ list(APPEND SOURCES ${CBLAS1} ${CB1AUX} ${ALLBLAS} ${CBLAS2} ${CBLAS3})
endif()
if(BLAS_COMPLEX16)
- set(ALLOBJ ${BLASLIB} ${ZBLAS1} ${ZB1AUX}
- ${ALLBLAS} ${ZBLAS2} ${ZBLAS3})
+ list(APPEND SOURCES ${ZBLAS1} ${ZB1AUX} ${ALLBLAS} ${ZBLAS2} ${ZBLAS3})
endif()
+list(REMOVE_DUPLICATES SOURCES)
-
-add_library(blas ${ALLOBJ})
+add_library(blas ${SOURCES})
set_target_properties(
blas PROPERTIES
VERSION ${LAPACK_VERSION}
diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt
index 70262d4c..38191838 100644
--- a/CBLAS/src/CMakeLists.txt
+++ b/CBLAS/src/CMakeLists.txt
@@ -97,32 +97,22 @@ set(ZLEV3 cblas_zgemm.c cblas_zsymm.c cblas_zhemm.c cblas_zherk.c
cblas_zher2k.c cblas_ztrmm.c cblas_ztrsm.c cblas_zsyrk.c
cblas_zsyr2k.c)
-# default build all of it
-set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND}
- ${DLEV1} ${DLEV2} ${DLEV3}
- ${CLEV1} ${CLEV2} ${CLEV3}
- ${ZLEV1} ${ZLEV2} ${ZLEV3})
-# Single precision real
+set(SOURCES)
if(CBLAS_SINGLE)
- set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND})
+ list(APPEND SOURCES ${SLEV1} ${SCLEV1} ${SLEV2} ${SLEV3} ${ERRHAND})
endif()
-
-# Double precision real
if(CBLAS_DOUBLE)
- set(ALLOBJ ${DLEV1} ${DLEV2} ${DLEV3} ${ERRHAND})
+ list(APPEND SOURCES ${DLEV1} ${DLEV2} ${DLEV3} ${ERRHAND})
endif()
-
-# Single precision complex
if(CBLAS_COMPLEX)
- set(ALLOBJ ${CLEV1} ${SCLEV1} ${CLEV2} ${CLEV3} ${ERRHAND})
+ list(APPEND SOURCES ${CLEV1} ${SCLEV1} ${CLEV2} ${CLEV3} ${ERRHAND})
endif()
-
-# Double precision complex
if(CBLAS_COMPLEX16)
- set(ALLOBJ ${ZLEV1} ${ZLEV2} ${ZLEV3} ${ERRHAND})
+ list(APPEND SOURCES ${ZLEV1} ${ZLEV2} ${ZLEV3} ${ERRHAND})
endif()
+list(REMOVE_DUPLICATES SOURCES)
-add_library(cblas ${ALLOBJ})
+add_library(cblas ${SOURCES})
target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
lapack_install_library(cblas)
diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
index 0f6c9aeb..a2b84d7e 100644
--- a/SRC/CMakeLists.txt
+++ b/SRC/CMakeLists.txt
@@ -490,32 +490,32 @@ if(USE_XBLAS)
list(APPEND ZLASRC ${ZXLASRC})
endif()
-set(ALLOBJ)
+
+set(SOURCES)
if(BUILD_SINGLE)
- list(APPEND ALLOBJ ${SLASRC} ${DSLASRC} ${SCLAUX} ${ALLAUX})
+ list(APPEND SOURCES ${SLASRC} ${DSLASRC} ${SCLAUX} ${ALLAUX})
message(STATUS "Building single precision real")
endif()
if(BUILD_DOUBLE)
- list(APPEND ALLOBJ ${DLASRC} ${DSLASRC} ${DZLAUX} ${ALLAUX})
+ list(APPEND SOURCES ${DLASRC} ${DSLASRC} ${DZLAUX} ${ALLAUX})
message(STATUS "Building double precision real")
endif()
if(BUILD_COMPLEX)
- list(APPEND ALLOBJ ${CLASRC} ${ZCLASRC} ${SCLAUX} ${ALLAUX})
+ list(APPEND SOURCES ${CLASRC} ${ZCLASRC} ${SCLAUX} ${ALLAUX})
message(STATUS "Building single precision complex")
endif()
if(BUILD_COMPLEX16)
- list(APPEND ALLOBJ ${ZLASRC} ${ZCLASRC} ${DZLAUX} ${ALLAUX})
+ list(APPEND SOURCES ${ZLASRC} ${ZCLASRC} ${DZLAUX} ${ALLAUX})
message(STATUS "Building double precision complex")
endif()
-list(REMOVE_DUPLICATES ALLOBJ)
+list(REMOVE_DUPLICATES SOURCES)
-if(NOT ALLOBJ)
+if(NOT SOURCES)
message(FATAL_ERROR "-->LAPACK SRC BUILD: NOTHING TO BUILD, NO PRECISION SELECTED:
PLEASE ENABLE AT LEAST ONE OF THOSE: BUILD_SINGLE, BUILD_COMPLEX, BUILD_DOUBLE, BUILD_COMPLEX16.")
endif()
-
-add_library(lapack ${ALLOBJ})
+add_library(lapack ${SOURCES})
set_target_properties(
lapack PROPERTIES
VERSION ${LAPACK_VERSION}
diff --git a/TESTING/MATGEN/CMakeLists.txt b/TESTING/MATGEN/CMakeLists.txt
index 54cf9d9e..3a38ea18 100644
--- a/TESTING/MATGEN/CMakeLists.txt
+++ b/TESTING/MATGEN/CMakeLists.txt
@@ -51,25 +51,22 @@ set(ZMATGEN zlatms.f zlatme.f zlatmr.f zlatmt.f
zlagge.f zlaghe.f zlagsy.f zlakf2.f zlarge.f zlaror.f zlarot.f
zlatm1.f zlarnd.f zlatm2.f zlatm3.f zlatm5.f zlatm6.f zlahilb.f)
+
+set(SOURCES)
if(BUILD_SINGLE)
- set(ALLOBJ ${SMATGEN} ${SCATGEN})
+ list(APPEND SOURCES ${SMATGEN} ${SCATGEN})
endif()
if(BUILD_DOUBLE)
- set(ALLOBJ ${ALLOBJ} ${DMATGEN} ${DZATGEN})
+ list(APPEND SOURCES ${DMATGEN} ${DZATGEN})
endif()
if(BUILD_COMPLEX)
- set(ALLOBJ ${ALLOBJ} ${CMATGEN} ${SCATGEN})
+ list(APPEND SOURCES ${CMATGEN} ${SCATGEN})
endif()
if(BUILD_COMPLEX16)
- set(ALLOBJ ${ALLOBJ} ${ZMATGEN} ${DZATGEN})
+ list(APPEND SOURCES ${ZMATGEN} ${DZATGEN})
endif()
+list(REMOVE_DUPLICATES SOURCES)
-if(NOT ALLOBJ)
- set(ALLOBJ ${SMATGEN} ${CMATGEN} ${SCATGEN} ${DMATGEN} ${ZMATGEN}
- ${DZATGEN})
-else()
- list(REMOVE_DUPLICATES ALLOBJ)
-endif()
-add_library(tmglib ${ALLOBJ})
+add_library(tmglib ${SOURCES})
target_link_libraries(tmglib ${LAPACK_LIBRARIES})
lapack_install_library(tmglib)