You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, this configure_file call outputs NGenConfig.h into the include/ directory alongside its template. However, this leads to issues in successive out-of-source builds, i.e. CIROH-UA/NGIAB-CloudInfra#50.
Expected behavior
Output and include the configured header to/from the user-specified build directory, so that each out-of-source build has its own NGenConfig.h. (using PROJECT_BINARY_DIR?)
Steps to replicate behavior (include URLs)
git clone https://github.com/NOAA-OWP/ngen.git
cd ngen
cmake -B build_dir_A -S . -DNGEN_WITH_MPI=OFF -DNGEN_WITH_PYTHON=OFF -DNGEN_WITH_TESTS=OFF
cmake -B build_dir_B -S . -DNGEN_WITH_MPI=ON -DNGEN_WITH_PYTHON=OFF -DNGEN_WITH_TESTS=OFF
cat include/NGenConfig.h
#> // NGenConfig.h#> ...#> #define NGEN_WITH_MPI 1#> ...# Will fail since `build_dir_A` was configured with NGEN_WITH_MPI=OFF, but# the second configure caused `NGenConfig.h` to have `NGEN_WITH_MPI=ON`.
cmake --build build_dir_A -t ngen
#> ...#> /ngen/src/NGen.cpp: In function ‘void ngen::exec_info::runtime_summary(std::ostream&)’:#> /ngen/src/NGen.cpp:67:31: error: ‘mpi_rank’ was not declared in this scope#> 67 | << " Rank: " << mpi_rank << "\n"#> | ^~~~~~~~#> /ngen/src/NGen.cpp:68:37: error: ‘mpi_num_procs’ was not declared in this scope#> 68 | << " Processors: " << mpi_num_procs << "\n";#> | ^~~~~~~~~~~~~#> /ngen/src/NGen.cpp: In function ‘int main(int, char**)’:#> /ngen/src/NGen.cpp:136:9: error: ‘MPI_Init’ was not declared in this scope#> 136 | MPI_Init(nullptr, nullptr);#> | ^~~~~~~~#> /ngen/src/NGen.cpp:137:23: error: ‘MPI_COMM_WORLD’ was not declared in this scope#> 137 | MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);#> | ^~~~~~~~~~~~~~#> /ngen/src/NGen.cpp:137:40: error: ‘mpi_rank’ was not declared in this scope#> 137 | MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);#> | ^~~~~~~~#> /ngen/src/NGen.cpp:137:9: error: ‘MPI_Comm_rank’ was not declared in this scope#> 137 | MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);#> | ^~~~~~~~~~~~~#> /ngen/src/NGen.cpp:138:40: error: ‘mpi_num_procs’ was not declared in this scope#> 138 | MPI_Comm_size(MPI_COMM_WORLD, &mpi_num_procs);#> | ^~~~~~~~~~~~~#> /ngen/src/NGen.cpp:138:9: error: ‘MPI_Comm_size’ was not declared in this scope#> 138 | MPI_Comm_size(MPI_COMM_WORLD, &mpi_num_procs);#> | ^~~~~~~~~~~~~#> /ngen/src/NGen.cpp:149:9: error: ‘MPI_Finalize’ was not declared in this scope#> 149 | MPI_Finalize();#> | ^~~~~~~~~~~~#> make[3]: *** [CMakeFiles/ngen.dir/build.make:76: CMakeFiles/ngen.dir/src/NGen.cpp.o] Error 1#> make[2]: *** [CMakeFiles/Makefile2:307: CMakeFiles/ngen.dir/all] Error 2#> make[1]: *** [CMakeFiles/Makefile2:314: CMakeFiles/ngen.dir/rule] Error 2#> make: *** [Makefile:125: ngen] Error 2
The text was updated successfully, but these errors were encountered:
Relevant function call:
ngen/CMakeLists.txt
Line 350 in f57fec0
Current behavior
Currently, this
configure_file
call outputsNGenConfig.h
into theinclude/
directory alongside its template. However, this leads to issues in successive out-of-source builds, i.e. CIROH-UA/NGIAB-CloudInfra#50.Expected behavior
Output and include the configured header to/from the user-specified build directory, so that each out-of-source build has its own
NGenConfig.h
. (usingPROJECT_BINARY_DIR
?)Steps to replicate behavior (include URLs)
The text was updated successfully, but these errors were encountered: