Commit 1f1e282e authored by Guillaume Sylvand's avatar Guillaume Sylvand

CMake: add some target_link_libraries() to allow user app to link only with "-lchameleon"

parent c7061a85
......@@ -912,6 +912,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
-lchameleon_starpu
${STARPU_LIBRARIES_DEP}
)
link_directories(${STARPU_LIBRARY_DIRS_DEP})
elseif(CHAMELEON_SCHED_PARSEC)
list(APPEND CHAMELEON_DEP
-lchameleon_parsec
......
......@@ -248,6 +248,15 @@ endif(HAVE_ISO_C_BINDING)
# ------------
add_library(chameleon ${CHAMELEON_SRCS} ${CHAMELEON_SRCSF})
target_link_libraries(chameleon coreblas)
if(CHAMELEON_SCHED_STARPU)
target_link_libraries(chameleon chameleon_starpu)
elseif(CHAMELEON_SCHED_PARSEC)
target_link_libraries(chameleon chameleon_parsec)
elseif(CHAMELEON_SCHED_QUARK)
target_link_libraries(chameleon chameleon_quark)
endif()
add_dependencies(chameleon
chameleon_include
coreblas_include
......
......@@ -103,6 +103,12 @@ add_dependencies(coreblas coreblas_include)
set_property(TARGET coreblas PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET coreblas PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
if(NOT CHAMELEON_SIMULATION)
target_link_libraries(coreblas ${LAPACKE_LIBRARIES} ${CBLAS_LIBRARIES})
else(NOT CHAMELEON_SIMULATION)
target_link_libraries(coreblas simulapacke simucblas)
endif(NOT CHAMELEON_SIMULATION)
# # Dependencies step
# # -----------------
# foreach(_external_package "blas" "cblas" "lapack" "lapacke")
......
......@@ -68,6 +68,11 @@ add_library(cudablas ${CUDABLAS_SRCS})
add_dependencies(cudablas cudablas_include)
set_property(TARGET cudablas PROPERTY LINKER_LANGUAGE Fortran)
target_link_libraries(cudablas coreblas ${CUDA_LIBRARIES})
if(CHAMELEON_USE_MAGMA)
target_link_libraries(cudablas ${MAGMA_LIBRARIES})
endif(CHAMELEON_USE_MAGMA)
# installation
# ------------
install(TARGETS cudablas
......
......@@ -170,6 +170,11 @@ add_library(chameleon_parsec ${RUNTIME_SRCS})
set_property(TARGET chameleon_parsec PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET chameleon_parsec PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
target_link_libraries(chameleon_parsec coreblas ${PARSEC_LIBRARIES})
if(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
target_link_libraries(chameleon_parsec cudablas)
endif(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
add_dependencies(chameleon_parsec
chameleon_include
coreblas_include
......
......@@ -167,6 +167,11 @@ add_library(chameleon_quark ${RUNTIME_SRCS})
set_property(TARGET chameleon_quark PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET chameleon_quark PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
target_link_libraries(chameleon_quark coreblas ${QUARK_LIBRARIES})
if(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
target_link_libraries(chameleon_quark cudablas)
endif(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
add_dependencies(chameleon_quark
chameleon_include
coreblas_include
......
......@@ -188,6 +188,11 @@ add_library(chameleon_starpu ${RUNTIME_SRCS})
set_property(TARGET chameleon_starpu PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET chameleon_starpu PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
target_link_libraries(chameleon_starpu coreblas ${STARPU_LIBRARIES})
if(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
target_link_libraries(chameleon_starpu cudablas)
endif(CHAMELEON_USE_CUDA OR CHAMELEON_USE_MAGMA)
add_dependencies(chameleon_starpu
chameleon_include
coreblas_include
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment