summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Guinn <elyk03@gmail.com>2017-02-01 20:46:28 -0600
committerKyle Guinn <elyk03@gmail.com>2017-02-01 20:46:28 -0600
commit13b5b2c88cfd0218069e2572a95f41ac1fb7992e (patch)
tree6f0e5651195fdd2657fc5720ce249c04e4aef855
parent0d8ca785a7cf279d41f276fcaf36894171f133db (diff)
downloadlapack-13b5b2c88cfd0218069e2572a95f41ac1fb7992e.tar.gz
lapack-13b5b2c88cfd0218069e2572a95f41ac1fb7992e.tar.bz2
lapack-13b5b2c88cfd0218069e2572a95f41ac1fb7992e.zip
Allow building LAPACKE with XBLAS and TMGLIB simultaneously
Order the libraries the same as the Makefiles are ordering them: tmglib, lapack, xblas, blas. Fix combinations of USE_XBLAS with BUILD_SINGLE, etc. so that it only builds the LAPACK extended functions of the desired type and precision. Remove "OBJ" from variable names that are not lists of objects.
-rw-r--r--LAPACKE/CMakeLists.txt39
-rw-r--r--LAPACKE/src/CMakeLists.txt62
-rw-r--r--LAPACKE/utils/CMakeLists.txt2
-rw-r--r--SRC/CMakeLists.txt23
4 files changed, 69 insertions, 57 deletions
diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt
index 2a60a1ea..1212d84b 100644
--- a/LAPACKE/CMakeLists.txt
+++ b/LAPACKE/CMakeLists.txt
@@ -36,23 +36,34 @@ macro(append_subdir_files variable dirname)
endmacro()
append_subdir_files(LAPACKE_INCLUDE "include")
-append_subdir_files(SRC_OBJ "src")
-append_subdir_files(SRCX_OBJ "src")
-append_subdir_files(MATGEN_OBJ "src")
-append_subdir_files(UTILS_OBJ "utils")
+append_subdir_files(SOURCES "src")
+append_subdir_files(DEPRECATED "src")
+append_subdir_files(EXTENDED "src")
+append_subdir_files(MATGEN "src")
+append_subdir_files(UTILS "utils")
+if(BUILD_DEPRECATED)
+ list(APPEND SOURCES ${DEPRECATED})
+ message(STATUS "Building LAPACKE deprecated routines")
+endif()
+if(USE_XBLAS)
+ list(APPEND SOURCES ${EXTENDED})
+endif()
+if(LAPACKE_WITH_TMG)
+ list(APPEND SOURCES ${MATGEN})
+endif()
+list(APPEND SOURCES ${UTILS})
+
+add_library(lapacke ${SOURCES})
+
+if(LAPACKE_WITH_TMG)
+ target_link_libraries(lapacke tmglib)
+endif()
+target_link_libraries(lapacke ${LAPACK_LIBRARIES})
if(USE_XBLAS)
- add_library(lapacke ${SRC_OBJ} ${SRCX_OBJ} ${UTILS_OBJ})
- target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${XBLAS_LIBRARY})
-else()
- if(LAPACKE_WITH_TMG)
- add_library(lapacke ${SRC_OBJ} ${MATGEN_OBJ} ${UTILS_OBJ})
- target_link_libraries(lapacke tmglib ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
- else()
- add_library(lapacke ${SRC_OBJ} ${UTILS_OBJ})
- target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
- endif()
+ target_link_libraries(lapacke ${XBLAS_LIBRARY})
endif()
+target_link_libraries(lapacke ${BLAS_LIBRARIES})
lapack_install_library(lapacke)
install(FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h DESTINATION include)
diff --git a/LAPACKE/src/CMakeLists.txt b/LAPACKE/src/CMakeLists.txt
index 1144e977..6677470f 100644
--- a/LAPACKE/src/CMakeLists.txt
+++ b/LAPACKE/src/CMakeLists.txt
@@ -1,6 +1,4 @@
-#aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC_OBJ)
-
-set(SRC_OBJ
+set(SOURCES
lapacke_cbbcsd.c
lapacke_cbbcsd_work.c
lapacke_cbdsqr.c
@@ -2254,36 +2252,34 @@ lapacke_csyr_work.c
lapacke_ilaver.c
)
-if(BUILD_DEPRECATED)
- list(APPEND SRC_OBJ
- lapacke_cggsvp.c
- lapacke_cggsvp_work.c
- lapacke_dggsvp.c
- lapacke_dggsvp_work.c
- lapacke_sggsvp.c
- lapacke_sggsvp_work.c
- lapacke_zggsvp.c
- lapacke_zggsvp_work.c
- lapacke_cggsvd.c
- lapacke_cggsvd_work.c
- lapacke_dggsvd.c
- lapacke_dggsvd_work.c
- lapacke_sggsvd.c
- lapacke_sggsvd_work.c
- lapacke_zggsvd.c
- lapacke_zggsvd_work.c
- lapacke_cgeqpf.c
- lapacke_cgeqpf_work.c
- lapacke_dgeqpf.c
- lapacke_dgeqpf_work.c
- lapacke_sgeqpf.c
- lapacke_sgeqpf_work.c
- lapacke_zgeqpf.c
- lapacke_zgeqpf_work.c)
- message(STATUS "Building LAPACKE deprecated routines")
-endif()
+set(DEPRECATED
+lapacke_cggsvp.c
+lapacke_cggsvp_work.c
+lapacke_dggsvp.c
+lapacke_dggsvp_work.c
+lapacke_sggsvp.c
+lapacke_sggsvp_work.c
+lapacke_zggsvp.c
+lapacke_zggsvp_work.c
+lapacke_cggsvd.c
+lapacke_cggsvd_work.c
+lapacke_dggsvd.c
+lapacke_dggsvd_work.c
+lapacke_sggsvd.c
+lapacke_sggsvd_work.c
+lapacke_zggsvd.c
+lapacke_zggsvd_work.c
+lapacke_cgeqpf.c
+lapacke_cgeqpf_work.c
+lapacke_dgeqpf.c
+lapacke_dgeqpf_work.c
+lapacke_sgeqpf.c
+lapacke_sgeqpf_work.c
+lapacke_zgeqpf.c
+lapacke_zgeqpf_work.c
+)
-set(SRCX_OBJ
+set(EXTENDED
lapacke_cgbrfsx.c lapacke_cporfsx.c lapacke_dgerfsx.c lapacke_sgbrfsx.c lapacke_ssyrfsx.c lapacke_zherfsx.c
lapacke_cgbrfsx_work.c lapacke_cporfsx_work.c lapacke_dgerfsx_work.c lapacke_sgbrfsx_work.c lapacke_ssyrfsx_work.c lapacke_zherfsx_work.c
lapacke_cgerfsx.c lapacke_csyrfsx.c lapacke_dporfsx.c lapacke_sgerfsx.c lapacke_zgbrfsx.c lapacke_zporfsx.c
@@ -2299,7 +2295,7 @@ lapacke_chesvxx_work.c lapacke_dgbsvxx_work.c lapacke_dsysvxx_work.c lapacke_
)
# FILE PARTS OF TMGLIB
-set(MATGEN_OBJ
+set(MATGEN
lapacke_clatms.c
lapacke_clatms_work.c
lapacke_dlatms.c
diff --git a/LAPACKE/utils/CMakeLists.txt b/LAPACKE/utils/CMakeLists.txt
index c8b8511e..dd36ee33 100644
--- a/LAPACKE/utils/CMakeLists.txt
+++ b/LAPACKE/utils/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(UTILS_OBJ
+set(UTILS
lapacke_c_nancheck.c lapacke_ctr_trans.c lapacke_make_complex_float.c lapacke_zgb_nancheck.c
lapacke_cgb_nancheck.c lapacke_d_nancheck.c lapacke_s_nancheck.c lapacke_zgb_trans.c
lapacke_cgb_trans.c lapacke_dgb_nancheck.c lapacke_sgb_nancheck.c lapacke_zge_nancheck.c
diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
index e80a5b32..0fbbfdb0 100644
--- a/SRC/CMakeLists.txt
+++ b/SRC/CMakeLists.txt
@@ -467,11 +467,6 @@ set(ZXLASRC zgesvxx.f zgerfsx.f zla_gerfsx_extended.f zla_geamv.f
zla_heamv.f zla_hercond_c.f zla_hercond_x.f zla_herpvgrw.f
zla_lin_berr.f zlarscl2.f zlascl2.f zla_wwaddw.f)
-
-if(USE_XBLAS)
- set(ALLXOBJ ${SXLASRC} ${DXLASRC} ${CXLASRC} ${ZXLASRC})
-endif()
-
if(BUILD_DEPRECATED)
list(APPEND SLASRC DEPRECATED/sgegs.f DEPRECATED/sgegv.f
DEPRECATED/sgeqpf.f DEPRECATED/sgelsx.f DEPRECATED/sggsvd.f
@@ -485,7 +480,14 @@ if(BUILD_DEPRECATED)
list(APPEND ZLASRC DEPRECATED/zgegs.f DEPRECATED/zgegv.f
DEPRECATED/zgeqpf.f DEPRECATED/zgelsx.f DEPRECATED/zggsvd.f
DEPRECATED/zggsvp.f DEPRECATED/zlahrd.f DEPRECATED/zlatzm.f DEPRECATED/ztzrqf.f)
- message(STATUS "Building deprecated routines")
+ message(STATUS "Building LAPACK deprecated routines")
+endif()
+
+if(USE_XBLAS)
+ list(APPEND SLASRC ${SXLASRC})
+ list(APPEND DLASRC ${DXLASRC})
+ list(APPEND CLASRC ${CXLASRC})
+ list(APPEND ZLASRC ${ZXLASRC})
endif()
set(ALLOBJ)
@@ -513,13 +515,16 @@ if(NOT ALLOBJ)
endif()
-add_library(lapack ${ALLOBJ} ${ALLXOBJ})
-target_link_libraries(lapack ${BLAS_LIBRARIES} ${XBLAS_LIBRARY})
-
+add_library(lapack ${ALLOBJ})
set_target_properties(
lapack PROPERTIES
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
+if(USE_XBLAS)
+ target_link_libraries(lapack ${XBLAS_LIBRARY})
+endif()
+target_link_libraries(lapack ${BLAS_LIBRARIES})
+
lapack_install_library(lapack)