From b3142ca76ec10a3ee0eb20dec0675902400cde06 Mon Sep 17 00:00:00 2001 From: Florent Pruvost <florent.pruvost@inria.fr> Date: Fri, 13 Apr 2018 18:50:52 +0200 Subject: [PATCH] clean this mess --- CMakeLists.txt | 20 +++++++++++ cmake_modules/PrintOpts.cmake | 2 +- compute/CMakeLists.txt | 7 +--- coreblas/compute/CMakeLists.txt | 8 ++--- cudablas/compute/CMakeLists.txt | 2 +- example/basic_zposv/CMakeLists.txt | 48 ++------------------------ example/lapack_to_morse/CMakeLists.txt | 7 +--- example/out_of_core/CMakeLists.txt | 19 ++-------- runtime/parsec/CMakeLists.txt | 6 ++-- testing/CMakeLists.txt | 41 +--------------------- timing/CMakeLists.txt | 47 ++----------------------- 11 files changed, 36 insertions(+), 171 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f31042c7c..cb37c9d98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -938,6 +938,26 @@ list(APPEND CHAMELEON_DEP ${EXTRA_LIBRARIES}) list(REMOVE_DUPLICATES CHAMELEON_DEP) #list(REVERSE CHAMELEON_DEP) +# we add chameleon's own library +set(CHAMELEON_LIBRARIES "chameleon") +if (NOT CHAMELEON_SIMULATION) + list(APPEND CHAMELEON_LIBRARIES coreblas) + if (CHAMELEON_USE_CUDA) + list(APPEND CHAMELEON_LIBRARIES cudablas) + endif() +endif() +if (CHAMELEON_SCHED_QUARK) + list(APPEND CHAMELEON_LIBRARIES chameleon_quark) +endif() +if (CHAMELEON_SCHED_PARSEC) + list(APPEND CHAMELEON_LIBRARIES chameleon_parsec) +endif() +if (CHAMELEON_SCHED_STARPU) + list(APPEND CHAMELEON_LIBRARIES chameleon_starpu) +endif() +list(APPEND CHAMELEON_LIBRARIES hqr) +set(CHAMELEON_LIBRARIES_DEP ${CHAMELEON_LIBRARIES} ${CHAMELEON_DEP}) + # Check for the subdirectories # ---------------------------- diff --git a/cmake_modules/PrintOpts.cmake b/cmake_modules/PrintOpts.cmake index 7b5e61747..db11e46e8 100644 --- a/cmake_modules/PrintOpts.cmake +++ b/cmake_modules/PrintOpts.cmake @@ -96,7 +96,7 @@ set(dep_message "${dep_message}" " timing ...............: ${CHAMELEON_ENABLE_TIMING}\n" "\n" " CHAMELEON dependencies :\n") -foreach (_dep ${CHAMELEON_DEP}) +foreach (_dep ${CHAMELEON_LIBRARIES_DEP}) set(dep_message "${dep_message}" " ${_dep}\n") endforeach () diff --git a/compute/CMakeLists.txt b/compute/CMakeLists.txt index 58d639f5f..2b195951b 100644 --- a/compute/CMakeLists.txt +++ b/compute/CMakeLists.txt @@ -294,21 +294,16 @@ set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};chameleon_sources" C add_library(chameleon ${CHAMELEON_SRCS} ${CHAMELEON_SRCSF}) if(CHAMELEON_SCHED_STARPU) target_link_libraries(chameleon chameleon_starpu) - list(INSERT CHAMELEON_DEP 0 -lchameleon_starpu) elseif(CHAMELEON_SCHED_PARSEC) target_link_libraries(chameleon chameleon_parsec) - list(INSERT CHAMELEON_DEP 0 -lchameleon_parsec) elseif(CHAMELEON_SCHED_QUARK) target_link_libraries(chameleon chameleon_quark) - list(INSERT CHAMELEON_DEP 0 -lchameleon_quark) endif() if (NOT CHAMELEON_SIMULATION) - add_dependencies(chameleon - coreblas_include) + add_dependencies(chameleon coreblas_include) target_link_libraries(chameleon coreblas) endif() target_link_libraries(chameleon hqr) -list(INSERT CHAMELEON_DEP 0 -lchameleon) add_dependencies(chameleon chameleon_include diff --git a/coreblas/compute/CMakeLists.txt b/coreblas/compute/CMakeLists.txt index 0b406e71f..996a64ffa 100644 --- a/coreblas/compute/CMakeLists.txt +++ b/coreblas/compute/CMakeLists.txt @@ -114,16 +114,14 @@ set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};coreblas_sources" CA # Compile step # ------------ add_library(coreblas ${COREBLAS_SRCS}) -list(INSERT CHAMELEON_DEP 0 -lcoreblas) add_dependencies(coreblas coreblas_include coreblas_sources) set_property(TARGET coreblas PROPERTY LINKER_LANGUAGE Fortran) set_property(TARGET coreblas PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") target_link_libraries(coreblas - ${LAPACKE_LIBRARIES} - ${LAPACK_SEQ_LIBRARIES} - ${CBLAS_LIBRARIES} - ${BLAS_SEQ_LIBRARIES} + ${TMG_LIBRARIES_DEP} + ${LAPACKE_LIBRARIES_DEP} + ${CBLAS_LIBRARIES_DEP} ) # Installation diff --git a/cudablas/compute/CMakeLists.txt b/cudablas/compute/CMakeLists.txt index 017c118c0..209bf5b37 100644 --- a/cudablas/compute/CMakeLists.txt +++ b/cudablas/compute/CMakeLists.txt @@ -102,7 +102,7 @@ set_property(TARGET cudablas PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/ target_link_libraries(cudablas coreblas - ${CUDA_LIBRARIES}) + ${EXTRA_LIBRARIES_CUDA}) # installation # ------------ diff --git a/example/basic_zposv/CMakeLists.txt b/example/basic_zposv/CMakeLists.txt index 945dbdc13..b443a03df 100644 --- a/example/basic_zposv/CMakeLists.txt +++ b/example/basic_zposv/CMakeLists.txt @@ -41,53 +41,9 @@ precisions_rules_py(EXAMPLES "${ZSRC}" # Define what libraries we have to link with # ------------------------------------------ unset(libs_for_examples) -list(APPEND libs_for_examples - chameleon -) +list(APPEND libs_for_examples ${CHAMELEON_LIBRARIES_DEP}) +# message(STATUS "libs_for_examples: ${libs_for_examples}") -if(CHAMELEON_SCHED_STARPU) - list(APPEND libs_for_examples - chameleon_starpu - ${STARPU_LIBRARIES_DEP} - ) - link_directories(${STARPU_LIBRARY_DIRS}) -elseif(CHAMELEON_SCHED_PARSEC) - list(APPEND libs_for_examples - chameleon_parsec - ${PARSEC_LIBRARIES_DEP} - ) - link_directories(${PARSEC_LIBRARY_DIRS_DEP}) -elseif(CHAMELEON_SCHED_QUARK) - list(APPEND libs_for_examples - chameleon_quark - ${QUARK_LIBRARIES} - ) - link_directories(${QUARK_LIBRARY_DIRS}) -endif() - -if(CHAMELEON_USE_CUDA) - list(APPEND libs_for_examples - cudablas) -endif() -if(CHAMELEON_USE_CUDA) - link_directories(${CUDA_LIBRARY_DIRS}) -endif() - -list(APPEND libs_for_examples - coreblas - ${LAPACKE_LIBRARIES} - ${CBLAS_LIBRARIES} - ${LAPACK_SEQ_LIBRARIES} - ${BLAS_SEQ_LIBRARIES} - ${EXTRA_LIBRARIES} - ) - -link_directories(${LAPACKE_LIBRARY_DIRS}) -link_directories(${LAPACK_LIBRARY_DIRS}) -link_directories(${CBLAS_LIBRARY_DIRS}) -link_directories(${BLAS_LIBRARY_DIRS}) - -# message(STATUS "libs timings: ${libs_for_examples}") foreach(_example ${EXAMPLES}) get_filename_component(_name_exe ${_example} NAME_WE) add_executable(${_name_exe} ${_example}) diff --git a/example/lapack_to_morse/CMakeLists.txt b/example/lapack_to_morse/CMakeLists.txt index bbd241512..5b8255ce8 100644 --- a/example/lapack_to_morse/CMakeLists.txt +++ b/example/lapack_to_morse/CMakeLists.txt @@ -78,13 +78,8 @@ list(APPEND libs_for_ltm ${BLAS_SEQ_LIBRARIES} ${EXTRA_LIBRARIES} ) +# message(STATUS "libs_for_ltm: ${libs_for_ltm}") -link_directories(${LAPACKE_LIBRARY_DIRS}) -link_directories(${LAPACK_LIBRARY_DIRS}) -link_directories(${CBLAS_LIBRARY_DIRS}) -link_directories(${BLAS_LIBRARY_DIRS}) - -# message(STATUS "libs examples: ${libs_for_ltm}") foreach(_ltm ${LTM_SOURCES}) get_filename_component(_name_exe ${_ltm} NAME_WE) add_executable(${_name_exe} ${_ltm}) diff --git a/example/out_of_core/CMakeLists.txt b/example/out_of_core/CMakeLists.txt index 87e0b5477..c486cc7f5 100644 --- a/example/out_of_core/CMakeLists.txt +++ b/example/out_of_core/CMakeLists.txt @@ -37,24 +37,9 @@ set(OOC_SOURCES # Define what libraries we have to link with # ------------------------------------------ unset(libs_for_ooc) -list(APPEND libs_for_ooc - chameleon - ${STARPU_LIBRARIES_DEP} -) -link_directories(${STARPU_LIBRARY_DIRS}) +list(APPEND libs_for_ooc ${CHAMELEON_LIBRARIES_DEP}) +# message(STATUS "libs_for_ooc: ${libs_for_ooc}") -list(APPEND libs_for_ooc - ${LAPACKE_LIBRARIES} - ${LAPACK_SEQ_LIBRARIES} - ${BLAS_SEQ_LIBRARIES} - ${EXTRA_LIBRARIES} - ) - -link_directories(${LAPACKE_LIBRARY_DIRS}) -link_directories(${LAPACK_LIBRARY_DIRS}) -link_directories(${BLAS_LIBRARY_DIRS}) - -# message(STATUS "libs examples: ${libs_for_ooc}") foreach(_ooc ${OOC_SOURCES}) get_filename_component(_name_exe ${_ooc} NAME_WE) add_executable(${_name_exe} ${_ooc}) diff --git a/runtime/parsec/CMakeLists.txt b/runtime/parsec/CMakeLists.txt index b7e2822ed..24ce25e8f 100644 --- a/runtime/parsec/CMakeLists.txt +++ b/runtime/parsec/CMakeLists.txt @@ -117,11 +117,9 @@ set_property(TARGET chameleon_parsec PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_ target_link_libraries(chameleon_parsec ${PARSEC_LIBRARIES_DEP}) if (NOT CHAMELEON_SIMULATION) - target_link_libraries(chameleon_parsec - coreblas) + target_link_libraries(chameleon_parsec coreblas) if(CHAMELEON_USE_CUDA) - target_link_libraries(chameleon_parsec - cudablas) + target_link_libraries(chameleon_parsec cudablas) endif(CHAMELEON_USE_CUDA) endif(NOT CHAMELEON_SIMULATION) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 381e80541..f683c2566 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -104,46 +104,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # Define what libraries we have to link with # ------------------------------------------ unset(libs_for_tests) -list(APPEND libs_for_tests - chameleon - ) - -if(CHAMELEON_USE_CUDA) - list(APPEND libs_for_tests - cudablas) -endif() -if(CHAMELEON_USE_CUDA) - link_directories(${CUDA_LIBRARY_DIRS}) -endif() - -list(APPEND libs_for_tests - coreblas - ${LAPACKE_LIBRARIES} - ${TMG_LIBRARIES} - ${LAPACK_LIBRARIES} - ${CBLAS_LIBRARIES} - ${BLAS_LIBRARIES} - ) - -link_directories(${LAPACKE_LIBRARY_DIRS}) -link_directories(${TMG_LIBRARY_DIRS}) -link_directories(${LAPACK_LIBRARY_DIRS}) -link_directories(${CBLAS_LIBRARY_DIRS}) -link_directories(${BLAS_LIBRARY_DIRS}) - -list(APPEND libs_for_tests - hqr - ${EXTRA_LIBRARIES} - ) - -# message("LAPACKE_LIBRARY_DIRS: ${LAPACKE_LIBRARY_DIRS}") -# message("LAPACK_LIBRARY_DIRS: ${LAPACK_LIBRARY_DIRS}") -# message("CBLAS_LIBRARY_DIRS: ${CBLAS_LIBRARY_DIRS}") -# message("BLAS_LIBRARY_DIRS: ${BLAS_LIBRARY_DIRS}") - -# list(APPEND libs_for_tests ${CMAKE_Fortran_FLAGS} ) -# list(APPEND libs_for_tests ${CMAKE_Fortran_LDFLAGS}) - +list(APPEND libs_for_tests ${CHAMELEON_LIBRARIES_DEP}) # message(STATUS "libs testings: ${libs_for_tests}") # Create one testing per precision with all files diff --git a/timing/CMakeLists.txt b/timing/CMakeLists.txt index 19f3a16f7..8ae3a7558 100644 --- a/timing/CMakeLists.txt +++ b/timing/CMakeLists.txt @@ -170,52 +170,9 @@ if(NOT CHAMELEON_SIMULATION) list(APPEND libs_for_timings chameleon_timing) endif() -list(APPEND libs_for_timings - chameleon - ) - -# Add dependency toward StarPU for StarPU specific calls -if(CHAMELEON_SCHED_STARPU) - list(APPEND libs_for_timings - ${STARPU_LIBRARIES_DEP} - ) - link_directories(${STARPU_LIBRARY_DIRS}) -endif() - -if(NOT CHAMELEON_SIMULATION) - - list(APPEND libs_for_timings - ${LAPACKE_LIBRARIES} - ${TMG_LIBRARIES} - ${CBLAS_LIBRARIES} - ${LAPACK_SEQ_LIBRARIES} - ${BLAS_SEQ_LIBRARIES} - ) - - link_directories(${LAPACKE_LIBRARY_DIRS}) - link_directories(${TMG_LIBRARY_DIRS}) - link_directories(${LAPACK_LIBRARY_DIRS}) - link_directories(${CBLAS_LIBRARY_DIRS}) - link_directories(${BLAS_LIBRARY_DIRS}) - -endif() - -list(APPEND libs_for_timings - hqr - ${EXTRA_LIBRARIES} - ) - -# message("BLAS_SEQ_LIBRARIES: ${BLAS_SEQ_LIBRARIES}") -# message("CBLAS_LIBRARIES: ${CBLAS_LIBRARIES}") -# message("LAPACK_SEQ_LIBRARIES: ${LAPACK_SEQ_LIBRARIES}") -# message("LAPACKE_LIBRARIES: ${LAPACKE_LIBRARIES}") - -# message("LAPACKE_LIBRARY_DIRS: ${LAPACKE_LIBRARY_DIRS}") -# message("LAPACK_LIBRARY_DIRS: ${LAPACK_LIBRARY_DIRS}") -# message("CBLAS_LIBRARY_DIRS: ${CBLAS_LIBRARY_DIRS}") -# message("BLAS_LIBRARY_DIRS: ${BLAS_LIBRARY_DIRS}") - +list(APPEND libs_for_timings ${CHAMELEON_LIBRARIES_DEP}) # message(STATUS "libs timings: ${libs_for_timings}") + foreach(_timing ${TIMINGS}) get_filename_component(_name_exe ${_timing} NAME_WE) add_executable(${_name_exe} ${_timing}) -- GitLab