GRTLCollaboration / GRTeclyn

Port of GRChombo to AMReX - under development!
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Build: make all race condition #35

Closed mirenradia closed 9 months ago

mirenradia commented 9 months ago

In the case where the tests target build configuration (e.g. COMP, USE_MPI, USE_OMP, etc.) is the same as the examples target build configuration (the default for the BinaryBH example is USE_MPI = TRUE but USE_MPI = FALSE for the tests), building the all target in the base directory in parallel i.e. doing

cd /path/to/GRTeclyn
make all -j 16 USE_MPI=TRUE

can lead to compilation errors. For example, I sometimes (but not always) get the following error:

In file included from /home/mr618/amrex/Src/Base/AMReX.H:4,
                 from /home/mr618/amrex/Src/Base/AMReX_error_fi.cpp:2:
/home/mr618/GRTeclyn/tmp_build_dir/s/3d.gnu.MPI.EXE/AMReX_Config.H:54:2: error: #endif without #if
   54 | #endif
      |  ^~~~~

I think this is a race condition on both targets trying to build AMReX_Config.H and AMReX_Version.H for the same configuration at the same time.