-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
965 changed files
with
133,820 additions
and
3,565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,60 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
set(CHAMELEON ${CMAKE_SOURCE_DIR}/chameleon) | ||
PROJECT(moao_chameleon C CXX) | ||
|
||
set(MAIN moao) | ||
# directly make an error if in-source build | ||
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") | ||
message(FATAL_ERROR "In-source builds are not allowed.\n" | ||
"Please create a build directory first and execute cmake configuration from " | ||
"this directory. Example: mkdir build && cd build && cmake ..") | ||
endif() | ||
|
||
if(LAPACKE_LIBRARIES MATCHES "mkl") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_MKL") | ||
endif() | ||
include (${CMAKE_SOURCE_DIR}/cmake_modules/CMake_loadChameleon) | ||
|
||
#TODO: include from common | ||
set(SRC_COMMON ${COMMON}/arguments.c | ||
${COMMON}/fits.c | ||
${COMMON}/tomo_struct.c | ||
${COMMON}/noise.c | ||
${COMMON}/utils.c | ||
if(STARPU_FOUND) | ||
include(runtime/starpu/CMakeLists.txt) | ||
set(RUNTIME_INC runtime/starpu/codelet) | ||
endif() | ||
|
||
include(compute/CMakeLists.txt) | ||
set(SRC ${COMPUTE_SRC} | ||
${CODELET_SRC} | ||
) | ||
include_directories(${COMMON}) | ||
|
||
set(SRC ${CHAMELEON}/moao_chameleon.c | ||
${COMMON}/reconstructor.c | ||
${COMMON}/codelet_dscaldiag.c | ||
${COMMON}/codelet_matcov.c | ||
${COMMON}/dscaldiag.c | ||
${COMMON}/matcov_kernels.c | ||
${COMMON}/matcov.c | ||
${COMMON}/cee_cvv.c | ||
) | ||
|
||
if(${GPU}) | ||
set(SRC ${SRC} | ||
${COMMON}/matcov_kernels_gpu.cu | ||
) | ||
endif() | ||
|
||
include_directories(${CHAMELEON}) | ||
|
||
set(SRC_INTERSAMPLE ${COMMON}/intersample.c | ||
) | ||
|
||
set(SRC ${SRC} ${SRC_COMMON}) | ||
if(USE_INTERSAMPLE) | ||
set(SRC ${SRC} ${SRC_INTERSAMPLE}) | ||
endif() | ||
|
||
link_directories(${CHAMELEON_LIBRARY_DIRS}) | ||
set(LINK_DIRS "${CHAMELEON_LIBRARY_DIRS}" ) #PARENT_SCOPE) | ||
message(STATUS "LINK DIR: ${CHAMELEON_LIBRARY_DIRS}") | ||
set(LINK_DIRS ${LINK_DIRS} PARENT_SCOPE) | ||
message(STATUS "LINK DIR2: ${LINK_DIRS}") | ||
if(USE_GPU) | ||
find_package(CUDA REQUIRED) | ||
add_definitions(-DUSE_GPU) | ||
CUDA_ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRC}) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C ) | ||
target_link_libraries(${PROJECT_NAME} ${CHAMELEON_LIBRARIES_DEP} common) | ||
else() | ||
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRC}) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC ${CHAMELEON_LIBRARIES_DEP} common) | ||
endif() | ||
target_include_directories(${PROJECT_NAME} PUBLIC compute ./ ${RUNTIME_INC} ${CHAMELEON_INCLUDE_DIRS_DEP} ) | ||
|
||
## Installing | ||
# add installation for target lapack | ||
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}_export | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
INCLUDES DESTINATION include | ||
) | ||
# copy public include files | ||
install(FILES | ||
include/${PROJECT_NAME}/config.h | ||
include/${PROJECT_NAME}/make_${PROJECT_NAME}.h | ||
DESTINATION include/${PROJECT_NAME}) | ||
|
||
|
||
## create export file which can be imported by other cmake projects | ||
#install(EXPORT ${PROJECT_NAME}_export | ||
# NAMESPACE MOAO:: | ||
# DESTINATION lib/cmake/${PROJECT_NAME} | ||
#) |
Oops, something went wrong.