Skip to content

Commit

Permalink
CMake: do not generate network_properties twice (#1315)
Browse files Browse the repository at this point in the history
* remove duplication

* change AMREX --> AMReX

---------

Co-authored-by: Ben Wibking <[email protected]>
  • Loading branch information
psharda and BenWibking authored Aug 22, 2023
1 parent 00c8a99 commit ced7cc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
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

0 comments on commit ced7cc4

Please sign in to comment.