Skip to content

Commit

Permalink
Merge pull request #352 from lanl/jmm/move-build-of-closures
Browse files Browse the repository at this point in the history
move the singularity_eos cpp files back into the fortran build only
  • Loading branch information
dholladay00 authored Mar 14, 2024
2 parents 3684eae + e297baa commit e0c4920
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
51 changes: 26 additions & 25 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variables:
GIT_SUBMODULE_STRATEGY: normal
SINGULARITY_GOLDFILES_VERSION: "goldfiles-1.8.0"
SINGULARITY_EOS_GCC_VERSION: "10.3.0"
SINGULARITY_EOS_OPENMPI_VERSION: "4.1.3"
SINGULARITY_EOS_OPENMPI_VERSION: "4.1.1"
SINGULARITY_EOS_CUDA_VERSION: "11.6.0"
SINGULARITY_EOS_BUILD_TYPE: "RelWithDebInfo"
SINGULARITY_EOS_SPACK_SPEC: "singularity-eos@main+mpi+spiner+hdf5+python+tests%gcc@${SINGULARITY_EOS_GCC_VERSION} ^openmpi@${SINGULARITY_EOS_OPENMPI_VERSION}"
Expand All @@ -37,29 +37,6 @@ default:
id_tokens:
SITE_ID_TOKEN:
aud: https://asc-git.lanl.gov
before_script:
- echo "Running on $(hostname)"
- section() { echo $'\e[0K'"section_$1:$(date +%s):$2"$'\r\e[0K'"${3+${COLOR_CYAN}$3${COLOR_PLAIN}}"; }
- export PYTHONNOUSERSITE=1
- export SPACK_DISABLE_LOCAL_CONFIG=true
- export SPACK_USER_CACHE_PATH=${SPACK_USER_CACHE_PATH:-/tmp/spack-local}
- export DEVEL_SPACK_CHECKOUT=${DEVEL_SPACK_CHECKOUT:-/tmp/spack}
- export SINGULARITY_EOS_SPACK_DIR=${SINGULARITY_EOS_TEMP_SPACK_DIR:=$XCAP_OSS_SPACK_DIR}
- section start "spack_init[collapsed=true]" "Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}"
- echo "Upstream ${SINGULARITY_EOS_SPACK_DIR}"
- |
rsync -rpl \
--exclude=".git" \
--exclude="etc/spack/repos.yaml" \
--exclude="etc/spack/packages.yaml" \
--include="etc/spack/**" \
--include="lib/spack/**" \
--exclude-from=${SINGULARITY_EOS_SPACK_DIR}/.gitignore \
${SINGULARITY_EOS_SPACK_DIR}/ ${DEVEL_SPACK_CHECKOUT}/
- source ${DEVEL_SPACK_CHECKOUT}/share/spack/setup-env.sh
- spack --version
- spack compiler list
- section end spack_init

##########################
# Build Matrix Variables #
Expand Down Expand Up @@ -104,7 +81,7 @@ default:
CLUSTER: rocinante
SINGULARITY_EOS_GCC_VERSION: "12.2.0"
SINGULARITY_EOS_SPACK_SPEC: "singularity-eos@main+mpi+spiner+hdf5+python+tests%gcc@${SINGULARITY_EOS_GCC_VERSION} ^cray-mpich"
SCHEDULER_PARAMETERS: "-N 1 -t 30 -A asc-ci --partition=ci --qos=ci --reservation=ci"
SCHEDULER_PARAMETERS: "--nodes=1 --time 2:00:00 -L none@slurmdb --account=asc-ci --qos=ci --reservation=ci --partition=ci"

.skylake: &skylake
SCHEDULER_PARAMETERS: "--nodes=1 -p skylake-gold,skylake-platinum"
Expand All @@ -131,6 +108,29 @@ default:

.test:
stage: build_n_test
before_script:
- echo "Running on $(hostname)"
- section() { echo $'\e[0K'"section_$1:$(date +%s):$2"$'\r\e[0K'"${3+${COLOR_CYAN}$3${COLOR_PLAIN}}"; }
- export PYTHONNOUSERSITE=1
- export SPACK_DISABLE_LOCAL_CONFIG=true
- export SPACK_USER_CACHE_PATH=${SPACK_USER_CACHE_PATH:-/tmp/spack-local}
- export DEVEL_SPACK_CHECKOUT=${DEVEL_SPACK_CHECKOUT:-/tmp/spack}
- export SINGULARITY_EOS_SPACK_DIR=${SINGULARITY_EOS_TEMP_SPACK_DIR:=$XCAP_OSS_SPACK_DIR}
- section start "spack_init[collapsed=true]" "Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}"
- echo "Upstream ${SINGULARITY_EOS_SPACK_DIR}"
- |
rsync -rpl \
--exclude=".git" \
--exclude="etc/spack/repos.yaml" \
--exclude="etc/spack/packages.yaml" \
--include="etc/spack/**" \
--include="lib/spack/**" \
--exclude-from=${SINGULARITY_EOS_SPACK_DIR}/.gitignore \
${SINGULARITY_EOS_SPACK_DIR}/ ${DEVEL_SPACK_CHECKOUT}/
- source ${DEVEL_SPACK_CHECKOUT}/share/spack/setup-env.sh
- spack --version
- spack compiler list
- section end spack_init
script:
- |
if [[ "${CLUSTER}" = "rocinante" ]]; then
Expand All @@ -139,6 +139,7 @@ default:
else
module load gcc/${SINGULARITY_EOS_GCC_VERSION}
module load cuda/${SINGULARITY_EOS_CUDA_VERSION}
module load openmpi/${SINGULARITY_EOS_OPENMPI_VERSION}-gcc_${SINGULARITY_EOS_GCC_VERSION}
fi
- |
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]];
Expand Down
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,6 @@ add_library(singularity-eos::singularity-eos_Interface ALIAS singularity-eos_Int
target_link_libraries(singularity-eos_Interface INTERFACE singularity-eos_Common)
target_link_libraries(singularity-eos INTERFACE singularity-eos_Interface)

if(SINGULARITY_BUILD_CLOSURE)
add_library(singularity-eos_Library)
set_target_properties(singularity-eos_Library PROPERTIES OUTPUT_NAME singularity-eos)
add_library(singularity-eos::singularity-eos_Library ALIAS singularity-eos_Library)
target_link_libraries(singularity-eos_Library INTERFACE singularity-eos_Common)
target_link_libraries(singularity-eos INTERFACE singularity-eos_Library)
endif()

# ------------------------------------------------------------------------------#
# Compiler & language setup
# ------------------------------------------------------------------------------#
Expand Down Expand Up @@ -405,11 +397,19 @@ message(VERBOSE "EOS Headers:\n\t${eos_headers}")

if(SINGULARITY_BUILD_CLOSURE)
get_property(eos_srcs GLOBAL PROPERTY EOS_SRCS)
target_sources(singularity-eos_Library PRIVATE ${eos_srcs})
message(VERBOSE "EOS Library Sources:\n\t${eos_srcs}")

if(eos_srcs)
add_library(singularity-eos_Library)
set_target_properties(singularity-eos_Library PROPERTIES OUTPUT_NAME singularity-eos)
add_library(singularity-eos::singularity-eos_Library ALIAS singularity-eos_Library)
target_link_libraries(singularity-eos_Library INTERFACE singularity-eos_Common)
target_link_libraries(singularity-eos INTERFACE singularity-eos_Library)
target_sources(singularity-eos_Library PRIVATE ${eos_srcs})
message(VERBOSE "EOS Library Sources:\n\t${eos_srcs}")
endif()
endif()

if(SINGULARITY_USE_FORTRAN)
if(TARGET singularity-eos_Library AND SINGULARITY_USE_FORTRAN)
# Turn on preprocessor for fortran files
set_target_properties(singularity-eos_Library PROPERTIES Fortran_PREPROCESS ON)
# make sure .mods are placed in build path, and installed along with includes
Expand Down Expand Up @@ -482,7 +482,7 @@ target_compile_options(
> # cuda
)

if(SINGULARITY_BUILD_CLOSURE)
if(TARGET singularity-eos_Library)
target_compile_options(singularity-eos_Library PRIVATE ${xlfix})
target_link_options(singularity-eos_Library PRIVATE ${xlfix})

Expand Down
4 changes: 2 additions & 2 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ install(
COMPONENT singularity-eos_Interface
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/singularity-eos)

if(SINGULARITY_BUILD_CLOSURE)
if(TARGET singularity-eos_Library)
install(
TARGETS singularity-eos_Library
EXPORT singularity-eos_Library
Expand Down Expand Up @@ -128,7 +128,7 @@ export(
FILE ${CMAKE_CURRENT_BINARY_DIR}/singularity-eos_Interface.cmake
NAMESPACE singularity-eos::)

if(SINGULARITY_BUILD_CLOSURE)
if(TARGET singularity-eos_Library)
export(
EXPORT singularity-eos_Library
FILE ${CMAKE_CURRENT_BINARY_DIR}/singularity-eos_Library.cmake
Expand Down
8 changes: 6 additions & 2 deletions singularity-eos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ register_headers(

if (SINGULARITY_BUILD_CLOSURE)
register_headers(closure/mixed_cell_models.hpp)
register_headers(eos/singularity_eos.hpp)
register_srcs(eos/singularity_eos.cpp)
if (SINGULARITY_USE_FORTRAN OR SINGULARITY_BUILD_TESTS)
# while these are C++ files, they
# are only needed for the fortran backend or unit testing
register_srcs(eos/singularity_eos.cpp)
register_headers(eos/singularity_eos.hpp)
endif()
if (SINGULARITY_USE_FORTRAN)
register_srcs(eos/get_sg_eos.cpp)
if (SINGULARITY_USE_KOKKOS)
Expand Down

0 comments on commit e0c4920

Please sign in to comment.