Commit 9d2aadba authored by gsell's avatar gsell
Browse files

main CMakeList.txt:

- reformat with indent equal 4, split lines to make code better readable
- reviewed
parent 98788892
......@@ -79,21 +79,21 @@ OPTION (ENABLE_DKS "Enable DKS" OFF)
### Load DKS package ###
IF (ENABLE_DKS)
FIND_PACKAGE(DKS 1.1.1 REQUIRED HINTS $ENV{DKS_PREFIX} $ENV{DKS_DIR} $ENV{DKS})
set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
MESSAGE (STATUS "Found DKS version: ${DKS_VERSION}")
MESSAGE (STATUS "Found DKS library: ${DKS_LIBRARY}")
MESSAGE (STATUS "Found DKS include dir: ${DKS_INCLUDE_DIR}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDKS_MPI")
FIND_PACKAGE(DKS 1.1.1 REQUIRED HINTS $ENV{DKS_PREFIX} $ENV{DKS_DIR} $ENV{DKS})
set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
MESSAGE (STATUS "Found DKS version: ${DKS_VERSION}")
MESSAGE (STATUS "Found DKS library: ${DKS_LIBRARY}")
MESSAGE (STATUS "Found DKS include dir: ${DKS_INCLUDE_DIR}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDKS_MPI")
### OpenCL compiler flags ###
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lOpenCL -pthread -DDKS_OPENCL")
### OpenCL compiler flags ###
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lOpenCL -pthread -DDKS_OPENCL")
### CUDA compiler flags ###
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDKS_CUDA")
### CUDA compiler flags ###
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDKS_CUDA")
### if any accelerator enabled set flag to use DKS ###
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIPPL_DKS -DIPPL_DKS_CUDA -DOPAL_DKS")
### if any accelerator enabled set flag to use DKS ###
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIPPL_DKS -DIPPL_DKS_CUDA -DOPAL_DKS")
ENDIF (ENABLE_DKS)
### END DKS part ###
......@@ -118,14 +118,14 @@ IF (BUILD_OPAL_UNIT_TESTS)
ENDIF (BUILD_OPAL_UNIT_TESTS)
IF (USE_H5HUT2)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_H5HUT2")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_H5HUT2")
ENDIF (USE_H5HUT2)
IF (ENABLE_AMR)
MESSAGE (STATUS "Enable AMR_SOLVER " ${ENABLE_AMR})
#ENABLE_LANGUAGE (Fortran)
  • @gsell Without this line, I get an error at linking time (see below). I changed it back in my fork.

    [100%] Linking CXX executable opal
    libOPAL.a(AmrBoxLib.cpp.o): In function `AmrBoxLib::tagForChargeDensity_m(int, amrex::TagBoxArray&, double, int)':
    AmrBoxLib.cpp:(.text+0x6797): undefined reference to `state_error'
    libOPAL.a(AmrBoxLib.cpp.o): In function `AmrBoxLib::tagForPotentialStrength_m(int, amrex::TagBoxArray&, double, int)':
    AmrBoxLib.cpp:(.text+0x6c55): undefined reference to `tag_potential_strength'
    /users/freym/gcc/6.2.0/amrex/lib/libamrex.a(parallel.f90.o): In function `bl_fortran_mpi_comm_init':
    parallel.f90:(.text+0xa21): undefined reference to `mpi_type_create_f90_integer_'
    /users/freym/gcc/6.2.0/amrex/lib/libamrex.a(parallel.f90.o): In function `__parallel_MOD_parallel_initialize':
    parallel.f90:(.text+0x125ba): undefined reference to `mpi_type_create_f90_integer_'
    /usr/bin/ld: link errors found, deleting executable `opal'
    /usr/bin/X11/sha1sum: opal: No such file or directory
    collect2: error: ld returned 1 exit status
Please register or sign in to reply
find_package (AMReX CONFIG REQUIRED HINTS $ENV{AMREX_HOME}/cmake $ENV{AMREX_DIR}/cmake $ENV{AMREX_PREFIX}/cmake)
find_package (AMReX CONFIG REQUIRED
HINTS $ENV{AMREX_HOME}/cmake $ENV{AMREX_DIR}/cmake $ENV{AMREX_PREFIX}/cmake)
MESSAGE (STATUS "Found AMReX include dir: ${AMREX_INCLUDE_DIR}")
MESSAGE (STATUS "Found AMReX library dir: ${AMREX_LIBRARY_DIR}")
......@@ -148,30 +148,34 @@ STRING(REGEX MATCH "[^0-9]*" HOSTNAME_BASE "${HOSTNAME}")
# Trilinos_TPL_LIBRARIES, instead of cray-tpsl/16.07.1 it uses
# cray-tpsl/16.06.1 libraries -> Linker error.
# We can avoid this issue by not going into the if-statement
if (NOT ${HOSTNAME_BASE} MATCHES "edison" AND NOT ${HOSTNAME_BASE} MATCHES "cori" AND ENABLE_SAAMG_SOLVER )
IF (ENABLE_SAAMG_SOLVER)
MESSAGE (STATUS "Enable SAAMG_SOLVER " ${ENABLE_SAAMG_SOLVER})
find_package (Trilinos REQUIRED HINTS $ENV{TRILINOS_PREFIX} $ENV{TRILINOS_DIR} $ENV{TRILINOS})
message (STATUS "Found Trilinos: ${Trilinos_DIR}")
message (STATUS " Trilinos version: ${Trilinos_VERSION}")
message (STATUS " Trilinos package list: ${Trilinos_PACKAGE_LIST}")
message (STATUS " Trilinos libraries: ${Trilinos_LIBRARIES}")
message (STATUS " Trilinos TPL libraries: ${Trilinos_TPL_LIBRARIES}")
if (NOT ${MPI_CXX_COMPILER} STREQUAL ${Trilinos_CXX_COMPILER} )
message (STATUS "Compiler mismatch:")
message (STATUS " Trilinos was compiled with:")
message (STATUS " ${Trilinos_C_COMPILER}")
message (STATUS " ${Trilinos_CXX_COMPILER}")
message (STATUS " ${Trilinos_Fortran_COMPILER}")
message (STATUS " You are using:")
message (STATUS " ${CMAKE_C_COMPILER}")
message (STATUS " ${CMAKE_CXX_COMPILER}")
message (STATUS " ${CMAKE_Fortran_COMPILER}")
message (FATAL "")
endif ()
endif ()
IF (NOT (
${HOSTNAME_BASE} MATCHES "edison" OR
${HOSTNAME_BASE} MATCHES "cori"))
find_package (Trilinos REQUIRED HINTS $ENV{TRILINOS_PREFIX} $ENV{TRILINOS_DIR} $ENV{TRILINOS})
message (STATUS "Found Trilinos: ${Trilinos_DIR}")
message (STATUS " Trilinos version: ${Trilinos_VERSION}")
message (STATUS " Trilinos package list: ${Trilinos_PACKAGE_LIST}")
message (STATUS " Trilinos libraries: ${Trilinos_LIBRARIES}")
message (STATUS " Trilinos TPL libraries: ${Trilinos_TPL_LIBRARIES}")
if (NOT ${MPI_CXX_COMPILER} STREQUAL ${Trilinos_CXX_COMPILER} )
message (STATUS "Compiler mismatch:")
message (STATUS " Trilinos was compiled with:")
message (STATUS " ${Trilinos_C_COMPILER}")
message (STATUS " ${Trilinos_CXX_COMPILER}")
message (STATUS " ${Trilinos_Fortran_COMPILER}")
message (STATUS " You are using:")
message (STATUS " ${CMAKE_C_COMPILER}")
message (STATUS " ${CMAKE_CXX_COMPILER}")
message (STATUS " ${CMAKE_Fortran_COMPILER}")
message (FATAL "")
ENDIF ()
ENDIF ()
ENDIF ()
IF (DBG_SCALARFIELD)
MESSAGE (STATUS "\nWrite scalar rho_m field is enabled ")
......@@ -211,7 +215,7 @@ IF(GIT_FOUND)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND git rev-parse HEAD
OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
)
)
SET (OPAL_WC_REVISION \"${GIT_OUT}\")
ELSE()
MESSAGE (STATUS "could not find git")
......@@ -227,26 +231,33 @@ ADD_SUBDIRECTORY (src)
ADD_SUBDIRECTORY (tools)
IF (BUILD_OPAL_UNIT_TESTS)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tests)
ENDIF (BUILD_OPAL_UNIT_TESTS)
# make variables visible in other CMakeLists files
set(OPAL_CXX_FLAGS ${OPAL_CXX_FLAGS}
CACHE INTERNAL "" FORCE
)
CACHE INTERNAL "" FORCE
)
set(OPAL_LIBS ${OPAL_LIBS}
CACHE INTERNAL "" FORCE
)
CACHE INTERNAL "" FORCE
)
# configure file
configure_file (
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
)
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake
)
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake
)
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode:cmake
# cmake-tab-width: 4
# indent-tabs-mode:nil
# End:
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