Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: do not generate network_properties twice #1315

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: Compile and run
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMREX=true
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
make -j2
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/macos_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: Compile and run
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMREX=true
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
make -j2
ctest --output-on-failure
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
${output_dir}/extern_parameters.cpp PARENT_SCOPE)


#below to update headers
execute_process(COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTHONPATH}:${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null" python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/update_headers.py" --net "${networkdir}" --microphysics_path "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/" --odir "${output_dir}" WORKING_DIRECTORY ${output_dir}/)
#below for NAUX
execute_process(COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTHONPATH}:${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null" python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/get_naux.py" --net "${networkdir}" --microphysics_path "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/" WORKING_DIRECTORY ${output_dir}/)

Expand All @@ -103,17 +101,17 @@ endfunction()

#set a cache variable that controls whether
#we want to fetch and link amrex or not
set(BUILD_AMREX false CACHE BOOL "Do you want to build and link amrex? (true/false)")
message("Building and linking amrex -- ${BUILD_AMREX}")
set(BUILD_AMReX false CACHE BOOL "Do you want to build and link amrex? (true/false)")
message("Building and linking amrex -- ${BUILD_AMReX}")

if(BUILD_AMREX)
if(BUILD_AMReX)
#fetching amrex
set (AMREX_TAG "development")
set (AMReX_TAG "development")
include(FetchContent)
FetchContent_Declare(
amrex
GIT_REPOSITORY https://github.com/AMReX-Codes/amrex
GIT_TAG "${AMREX_TAG}"
GIT_TAG "${AMReX_TAG}"
)

# CMake 3.14+
Expand Down