Skip to content

Commit

Permalink
CMake: modify structure of the build
Browse files Browse the repository at this point in the history
  • Loading branch information
mic84 committed Jul 27, 2017
1 parent f9e5cbb commit 3b1bbdf
Show file tree
Hide file tree
Showing 15 changed files with 465 additions and 320 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ include(InstallManager)
add_subdirectory(Src)

# Source file for postprocess exes
add_subdirectory(Tools/Postprocessing/F_Src)
#add_subdirectory(Tools/Postprocessing/F_Src)

# Make the exports only _after_ doing the build
create_exports()
# # Make the exports only _after_ doing the build
# create_exports()

install_include_files (${CCSE_PERL_DIR}/AMReX_buildInfo.H)
ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/CCSEOptions.cmake)
ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/FindCCSE.cmake)
ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/CCSEConfigVersion-install.cmake.in)
# install_include_files (${CCSE_PERL_DIR}/AMReX_buildInfo.H)
# ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/CCSEOptions.cmake)
# ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/FindCCSE.cmake)
# ADD_INSTALL_CMAKE_FILES(${CCSE_MODULE_PATH}/CCSEConfigVersion-install.cmake.in)


option(ENABLE_Config_Report "Print out detailed information at the end of a configuration")
set(CCSE_CONFIG_LOG "${CCSE_BINARY_DIR}/ccse-config.log"
CACHE string "CCSE configuration log file")
# option(ENABLE_Config_Report "Print out detailed information at the end of a configuration")
# set(CCSE_CONFIG_LOG "${CCSE_BINARY_DIR}/ccse-config.log"
# CACHE string "CCSE configuration log file")
# include(CCSEConfigReport)
# if (ENABLE_Config_Report)
# execute_process(COMMAND "${cat_exec}" "${CCSE_CONFIG_LOG}" OUTPUT_VARIABLE config_output)
Expand Down
69 changes: 33 additions & 36 deletions Src/Amr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
# -*- mode: cmake -*-
set (CXXSRC "")
set (F90SRC "")
set (F77SRC "")
set (ALLHEADERS "")
set (ALLSRC "")

include(TestManager)
set (CXXSRC
AMReX_Amr.cpp AMReX_AmrLevel.cpp AMReX_AuxBoundaryData.cpp AMReX_Derive.cpp
AMReX_Extrapolater.cpp AMReX_StateData.cpp AMReX_StateDescriptor.cpp )

#
# Define a project name
# After this command the following varaibles are defined
# CAMRLIB_SOURCE_DIR
# CAMRLIB_BINARY_DIR
# Other projects (subdirectories) can reference this directory
# through these variables.
project(CAMRLIB)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(CXX_source_files AMReX_Amr.cpp AMReX_AmrLevel.cpp AMReX_AuxBoundaryData.cpp AMReX_Derive.cpp AMReX_Extrapolater.cpp AMReX_StateData.cpp AMReX_StateDescriptor.cpp)
set(FPP_source_files AMReX_ARRAYLIM_${BL_SPACEDIM}D.F)

set(CXX_header_files AMReX_Amr.H AMReX_AmrLevel.H AMReX_AuxBoundaryData.H AMReX_Derive.H AMReX_Extrapolater.H AMReX_LevelBld.H AMReX_PROB_AMR_F.H AMReX_StateData.H AMReX_StateDescriptor.H)
set(FPP_header_files )

if(USE_ARRAYVIEW EQUAL TRUE)
set(CXX_source_files ${CXX_source_files} AMReX_DatasetClient.cpp)
set(CXX_header_files ${CXX_header_files} AMReX_DatasetClient.H)
endif()
set (F90SRC AMReX_extrapolater_${BL_SPACEDIM}d.f90)

set(F77_header_files)
set(F90_header_files)
set (F77SRC AMReX_ARRAYLIM_${BL_SPACEDIM}D.F)

set(F77_source_files)
set(F90_source_files AMReX_extrapolater_${BL_SPACEDIM}d.f90)
set (ALLHEADERS
AMReX_Amr.H AMReX_AmrLevel.H AMReX_AuxBoundaryData.H AMReX_Derive.H
AMReX_Extrapolater.H AMReX_LevelBld.H AMReX_PROB_AMR_F.H AMReX_StateData.H
AMReX_StateDescriptor.H)

preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})

set(local_source_files ${FPP_out_files} ${F77_source_files} ${F90_source_files} ${CXX_source_files})
set(local_header_files ${CXX_header_files} ${F77_header_files} ${FPP_header_files} ${F90_header_files})
add_library(box_camr OBJECT ${local_source_files})
#
# This is an option to display arrays in GDB. It is for debugging
# AMReX and currently not supported by cmake.#
# if(USE_ARRAYVIEW EQUAL TRUE)
# set(CXX_source_files ${CXX_source_files} AMReX_DatasetClient.cpp)
# set(CXX_header_files ${CXX_header_files} AMReX_DatasetClient.H)
# endif()

add_dependencies(box_camr box_c)

# Collect sources
set ( ALLSRC ${CXXSRC} ${F90SRC} ${F77SRC} )

install_include_files(${local_header_files})
#
# Add absolute path (needed by target_sources)
#
prepend ( ALLSRC ${CMAKE_CURRENT_LIST_DIR} )
prepend ( ALLHEADERS ${CMAKE_CURRENT_LIST_DIR} )

if (BUILD_TESTS)
target_sources ( amrex PRIVATE ${ALLSRC} ${ALLHEADERS} )

endif()
#
# Accumulate headers
#
accumulate_headers (ALLHEADERS)
55 changes: 25 additions & 30 deletions Src/AmrCore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
include (TestManager)
set (CXXSRC "")
set (F90SRC "")
set (F77SRC "")
set (ALLHEADERS "")
set (ALLSRC "")

project (CAMRCORELIB)

include_directories (${CMAKE_CURRENT_SOURCE_DIR})

set ( CXX_source_files
set ( CXXSRC
AMReX_AmrCore.cpp AMReX_Cluster.cpp AMReX_ErrorList.cpp
AMReX_FillPatchUtil.cpp AMReX_FluxRegister.cpp
AMReX_Interpolater.cpp AMReX_TagBox.cpp AMReX_AmrMesh.cpp )

set ( FPP_source_files
AMReX_FLUXREG_${BL_SPACEDIM}D.F AMReX_INTERP_${BL_SPACEDIM}D.F )
set ( F77SRC AMReX_FLUXREG_${BL_SPACEDIM}D.F AMReX_INTERP_${BL_SPACEDIM}D.F )

set ( F90PP_source_files AMReX_FillPatchUtil_${BL_SPACEDIM}d.F90 )
set ( F90SRC AMReX_FillPatchUtil_${BL_SPACEDIM}d.F90 )

set ( CXX_header_files
set ( ALLHEADERS
AMReX_AmrCore.H AMReX_Cluster.H AMReX_ErrorList.H
AMReX_FillPatchUtil.H AMReX_FluxRegister.H AMReX_Interpolater.H
AMReX_TagBox.H AMReX_AmrMesh.H AMReX_INTERP_F.H
AMReX_FillPatchUtil_F.H)

set ( FPP_header_files AMReX_FLUXREG_F.H AMReX_FillPatchUtil_F.H )
set ( F77_header_files )
set ( F90_header_files )
AMReX_FillPatchUtil_F.H AMReX_FLUXREG_F.H
AMReX_FillPatchUtil_F.H )

set ( F77_source_files )

# These files are in Particle
# These files are neeeded only if Particles are enabled
if (ENABLE_PARTICLES EQUAL 1)
list ( APPEND CXX_header_files AMReX_AmrParGDB.H AMReX_AmrParticles.H )
list ( APPEND ALLHEADERS AMReX_AmrParGDB.H AMReX_AmrParticles.H )
endif ()

set_F77_properties ( FPP_out_files ${FPP_source_files} )

set ( local_source_files
${FPP_out_files} ${F77_source_files} ${F90_source_files}
${CXX_source_files} )

set ( local_header_files
${CXX_header_files} ${F77_header_files} ${FPP_header_files}
${F90_header_files} )

add_library (box_camrcore OBJECT ${local_source_files})
# Collect sources
set ( ALLSRC ${CXXSRC} ${F90SRC} ${F77SRC} )

install_include_files ( ${local_header_files} )
#
# Add absolute path (needed by target_sources)
#
prepend ( ALLSRC ${CMAKE_CURRENT_LIST_DIR} )
prepend ( ALLHEADERS ${CMAKE_CURRENT_LIST_DIR} )

if (BUILD_TESTS)
target_sources ( amrex PRIVATE ${ALLSRC} ${ALLHEADERS} )

endif()
#
# Accumulate headers
#
accumulate_headers (ALLHEADERS)
61 changes: 29 additions & 32 deletions Src/Base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
set (CXXSRC "")
set (F90SRC "")
set (F77SRC "")
set (ALLHEADERS "")
set (ALLSRC "")

#include(TestManager)

#
# Define a project name
# After this command the following variables are defined
# CBOXLIB_SOURCE_DIR
# CBOXLIB_BINARY_DIR
# Other projects (subdirectories) can reference this directory
# through these variables.
project ( CBOXLIB )


set ( CXX_source_files
set ( CXXSRC
AMReX_Arena.cpp AMReX_BArena.cpp AMReX_BaseFab.cpp AMReX_BCRec.cpp
AMReX_BLBackTrace.cpp AMReX_BoxArray.cpp AMReX_Box.cpp AMReX_BoxIterator.cpp
AMReX_BoxDomain.cpp AMReX.cpp AMReX_BoxList.cpp AMReX_CArena.cpp
Expand All @@ -26,18 +19,18 @@ set ( CXX_source_files
AMReX_parmparse_fi.cpp AMReX_error_fi.cpp AMReX_BLProfiler.cpp
AMReX_TinyProfiler.cpp )

set ( F77_source_files
set ( F77SRC
AMReX_BLProfiler_F.f AMReX_BLBoxLib_F.f AMReX_bl_flush.f
AMReX_BLParmParse_F.f AMReX_BLutil_F.f)
AMReX_BLParmParse_F.f AMReX_BLutil_F.f
AMReX_COORDSYS_${BL_SPACEDIM}D.F AMReX_FILCC_${BL_SPACEDIM}D.F )

set ( FPP_source_files AMReX_COORDSYS_${BL_SPACEDIM}D.F
AMReX_FILCC_${BL_SPACEDIM}D.F )

set ( F90_source_files AMReX_mempool_f.f90 AMReX_MultiFabUtil_${BL_SPACEDIM}d.f90
set ( F90SRC
AMReX_mempool_f.f90 AMReX_MultiFabUtil_${BL_SPACEDIM}d.f90
AMReX_BaseFab_nd.f90 AMReX_filcc_mod.F90 AMReX_omp_mod.F90 AMReX_fort_mod.F90
AMReX_parmparse_mod.F90 AMReX_string_mod.F90 AMReX_error_mod.F90 )
AMReX_parmparse_mod.F90 AMReX_string_mod.F90 AMReX_error_mod.F90 AMReX_bc_types_mod.F90 )

set ( CXX_header_files
set ( ALLHEADERS
AMReX_Arena.H AMReX_Array.H AMReX_ArrayLim.H AMReX_BArena.H AMReX_BaseFab.H
AMReX_BCRec.H AMReX_BC_TYPES.H AMReX_BLassert.H AMReX_BLBackTrace.H AMReX_BLFort.H
AMReX_BLProfiler.H AMReX_BoxArray.H AMReX_BoxDomain.H AMReX_Box.H AMReX_BoxIterator.H
Expand All @@ -51,20 +44,24 @@ set ( CXX_header_files
AMReX_Periodicity.H AMReX_PlotFileUtil.H AMReX_Print.H AMReX_RealBox.H AMReX_RealVect.H
AMReX_REAL.H AMReX_SPACE.H AMReX_Tuple.H AMReX_TypeTraits.H AMReX_Utility.H
AMReX_parstream.H AMReX_VisMF.H AMReX_PhysBCFunct.H AMReX_SPMD.H AMReX_SPMDI.H
AMReX_TinyProfiler.H AMReX_BCUtil.H )
AMReX_TinyProfiler.H AMReX_BCUtil.H
# Fortran Headers
AMReX_bc_types.fi AMReX_COORDSYS_F.H AMReX_SPACE_F.H AMReX_BaseFab_f.H AMReX_filcc_f.H )

set ( F77_header_files AMReX_bc_types.fi)
set ( FPP_header_files AMReX_COORDSYS_F.H AMReX_SPACE_F.H AMReX_BaseFab_f.H AMReX_filcc_f.H)
set ( F90_header_files )

set_F77_properties ( FPP_out_files ${FPP_source_files} )

set ( local_source_files ${CXX_source_files} ${F77_source_files}
${FPP_out_files} ${F90_source_files} )
set ( local_header_files ${CXX_header_files} ${F77_header_files}
${FPP_header_files} ${F90_header_files} )
# Accumulate sources
set ( ALLSRC ${CXXSRC} ${F90SRC} ${F77SRC} )

add_library(box_c OBJECT ${local_source_files})
#
# Add absolute path (needed by target_sources)
#
prepend ( ALLSRC ${CMAKE_CURRENT_LIST_DIR} )
prepend ( ALLHEADERS ${CMAKE_CURRENT_LIST_DIR} )

target_sources ( amrex PRIVATE ${ALLSRC} ${ALLHEADERS} )

install_include_files(${local_header_files})

#
# Accumulate headers
#
accumulate_headers (ALLHEADERS)
58 changes: 27 additions & 31 deletions Src/Boundary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
# -*- mode: cmake -*-
set (CXXSRC "")
set (F90SRC "")
set (F77SRC "")
set (ALLHEADERS "")
set (ALLSRC "")

include(TestManager)
set ( CXXSRC
AMReX_BndryData.cpp AMReX_BndryRegister.cpp AMReX_FabSet.cpp
AMReX_InterpBndryData.cpp AMReX_MacBndry.cpp AMReX_Mask.cpp
AMReX_MultiMask.cpp )

#
# Define a project name
# After this command the following varaibles are defined
# CBNDRYLIB_SOURCE_DIR
# CBNDRYLIB_BINARY_DIR
# Other projects (subdirectories) can reference this directory
# through these variables.
project(CBNDRYLIB)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(CXX_source_files AMReX_BndryData.cpp AMReX_BndryRegister.cpp AMReX_FabSet.cpp AMReX_InterpBndryData.cpp AMReX_MacBndry.cpp AMReX_Mask.cpp AMReX_MultiMask.cpp)
set(FPP_source_files AMReX_INTERPBNDRYDATA_${BL_SPACEDIM}D.F AMReX_LO_UTIL.F )
set(F77_source_files)
set(F90_source_files)

set(CXX_header_files AMReX_BndryData.H AMReX_BndryRegister.H AMReX_BoundCond.H AMReX_FabSet.H AMReX_InterpBndryData.H AMReX_LO_BCTYPES.H AMReX_MacBndry.H AMReX_Mask.H AMReX_MultiMask.H)
set(FPP_header_files AMReX_INTERPBNDRYDATA_F.H)
set(F77_header_files)
set(F90_header_files)
set ( F77SRC
AMReX_INTERPBNDRYDATA_${BL_SPACEDIM}D.F AMReX_LO_UTIL.F )

preprocess_boxlib_fortran(FPP_out_files ${FPP_source_files})
set(local_source_files ${CXX_source_files} ${F77_source_files} ${FPP_out_files} ${F90_source_files})
set(local_header_files ${CXX_header_files} ${F77_header_files} ${FPP_header_files} ${F90_header_files})
add_library(box_cbndry OBJECT ${local_source_files})
set ( ALLHEADERS
AMReX_BndryData.H AMReX_BndryRegister.H AMReX_BoundCond.H
AMReX_FabSet.H AMReX_INTERPBNDRYDATA_F.H AMReX_InterpBndryData.H
AMReX_LO_BCTYPES.H AMReX_MacBndry.H AMReX_Mask.H AMReX_MultiMask.H )

add_dependencies(box_cbndry box_c)

# Accumulate sources
set ( ALLSRC ${CXXSRC} ${F77SRC} )

install_include_files(${local_header_files})

if (BUILD_TESTS)
#
# Add absolute path (needed by target_sources)
#
prepend ( ALLSRC ${CMAKE_CURRENT_LIST_DIR} )
prepend ( ALLHEADERS ${CMAKE_CURRENT_LIST_DIR} )

endif()
target_sources ( amrex PRIVATE ${ALLSRC} ${ALLHEADERS} )

#
# Accumulate headers
#
accumulate_headers (ALLHEADERS)
Loading

0 comments on commit 3b1bbdf

Please sign in to comment.