Closed jtramm closed 3 years ago
Hm... I find it likely that this wouldn't happen before #1770. So, to reproduce this, you have two openmc repos, build and install one, then go to build in the other and see this?
Yes, currently I have two copies of the openmc repo in different locations on my system. I do not install either of them globally, rather, I install each in a specific location using the cmake argument -DCMAKE_INSTALL_PREFIX=...
Different install locations are used for each copy. When I try the commit before the changes were made (i.e., b62b843332ce0c49c3362704a0af47b5e33442de), things work, and when I compile I get:
Scanning dependencies of target faddeeva
[ 0%] Building CXX object CMakeFiles/faddeeva.dir/vendor/faddeeva/Faddeeva.cc.o
[ 1%] Linking CXX static library lib/libfaddeeva.a
[ 1%] Built target faddeeva
Scanning dependencies of target fmt
[ 2%] Building CXX object vendor/fmt/CMakeFiles/fmt.dir/src/format.cc.o
[ 3%] Building CXX object vendor/fmt/CMakeFiles/fmt.dir/src/os.cc.o
[ 4%] Linking CXX static library ../../lib/libfmt.a
[ 4%] Built target fmt
Scanning dependencies of target pugixml
[ 5%] Building CXX object vendor/pugixml/CMakeFiles/pugixml.dir/src/pugixml.cpp.o
[ 6%] Linking CXX static library ../../lib/libpugixml.a
[ 6%] Built target pugixml
Scanning dependencies of target libopenmc
[ 7%] Building CXX object CMakeFiles/libopenmc.dir/src/bank.cpp.o
...
At 5deadabf9eb424b2c67983cd38853957d7e419b1, things break, and I get:
Scanning dependencies of target faddeeva
[ 1%] Building CXX object CMakeFiles/faddeeva.dir/vendor/faddeeva/Faddeeva.cc.o
[ 2%] Linking CXX static library lib/libfaddeeva.a
[ 2%] Built target faddeeva
Scanning dependencies of target libopenmc
[ 3%] Building CXX object CMakeFiles/libopenmc.dir/src/bank.cpp.o
[ 4%] Building CXX object CMakeFiles/libopenmc.dir/src/boundary_condition.cpp.o
...
[ 96%] Building CXX object CMakeFiles/libopenmc.dir/src/xsdata.cpp.o
[ 97%] Linking CXX shared library lib/libopenmc.so
/soft/packaging/spack-builds/linux-rhel7-x86_64/gcc-9.3.0/binutils-2.34-rnwhrdgiqluqiypg5palnxdxviv3mynt/bin/ld: cannot find -lpugixml
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libopenmc.dir/build.make:1430: lib/libopenmc.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:188: CMakeFiles/libopenmc.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
I'm experiencing the same issue
Hm, I'm unable to reproduce this. Is it possible you guys are using a build directory from before that commit? I get the feeling CMake is perhaps leaving some cache variable unchanged that actually should have been changed. Maybe removing the old build directory, then creating a new one will do the trick.
Could either of you guys please include the full output from when you ran cmake?
In my case, I am clearing out the entire build directory before trying to install, so it doesn't appear to be caused by a cmake cacheing issue. Could be due to perhaps using different versions of cmake though? Here's the full process for me:
jtramm@jlselogin5:~/develop_openmc/openmc/build$ cmake --version
cmake version 3.19.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
jtramm@jlselogin5:~/develop_openmc/openmc/build$ rm -rf *
jtramm@jlselogin5:~/develop_openmc/openmc/build$ ls
jtramm@jlselogin5:~/develop_openmc/openmc/build$ CXX=g++ HDF5_ROOT=/home/jtramm/openmc_offload/hdf5 cmake -DCMAKE_INSTALL_PREFIX=/home/jtramm/develop_openmc/bld -Ddebug=on -Doptimize=on -Dopenmp=on ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found fmt: /home/jtramm/openmc_offload/bld/lib64/cmake/fmt (version 6.1.2)
-- Found pugixml: /home/jtramm/openmc_offload/bld/lib64/cmake/pugixml
-- Found HDF5: /home/jtramm/openmc_offload/hdf5/lib/libhdf5.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.12.0") found components: C HL
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- OpenMC C++ flags: -DH5Oget_info_by_idx_vers=1;-DH5O_info_t_vers=1;-fopenmp;-g;-O0;-O3
-- OpenMC Linker flags: -fopenmp
-- Found Git: /usr/bin/git (found version "2.26.2")
-- Submodule update
-- xtl v0.6.13
-- Building xtensor v0.21.3
-- Found xtl v0.6.13
-- Project 'gsl_lite', package 'gsl-lite' version: '0.36.1'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jtramm/develop_openmc/openmc/build
jtramm@jlselogin5:~/develop_openmc/openmc/build$ make -j 8
Scanning dependencies of target faddeeva
[ 1%] Building CXX object CMakeFiles/faddeeva.dir/vendor/faddeeva/Faddeeva.cc.o
[ 2%] Linking CXX static library lib/libfaddeeva.a
[ 2%] Built target faddeeva
Scanning dependencies of target libopenmc
[ 3%] Building CXX object CMakeFiles/libopenmc.dir/src/bank.cpp.o
[ 8%] Building CXX object CMakeFiles/libopenmc.dir/src/dagmc.cpp.o
[ 8%] Building CXX object CMakeFiles/libopenmc.dir/src/boundary_condition.cpp.o
[ 8%] Building CXX object CMakeFiles/libopenmc.dir/src/cell.cpp.o
[ 8%] Building CXX object CMakeFiles/libopenmc.dir/src/bremsstrahlung.cpp.o
[ 10%] Building CXX object CMakeFiles/libopenmc.dir/src/cmfd_solver.cpp.o
[ 10%] Building CXX object CMakeFiles/libopenmc.dir/src/cross_sections.cpp.o
[ 10%] Building CXX object CMakeFiles/libopenmc.dir/src/distribution.cpp.o
[ 11%] Building CXX object CMakeFiles/libopenmc.dir/src/distribution_angle.cpp.o
[ 12%] Building CXX object CMakeFiles/libopenmc.dir/src/distribution_energy.cpp.o
[ 13%] Building CXX object CMakeFiles/libopenmc.dir/src/distribution_multi.cpp.o
[ 14%] Building CXX object CMakeFiles/libopenmc.dir/src/distribution_spatial.cpp.o
[ 15%] Building CXX object CMakeFiles/libopenmc.dir/src/eigenvalue.cpp.o
[ 17%] Building CXX object CMakeFiles/libopenmc.dir/src/endf.cpp.o
[ 18%] Building CXX object CMakeFiles/libopenmc.dir/src/error.cpp.o
[ 19%] Building CXX object CMakeFiles/libopenmc.dir/src/event.cpp.o
[ 20%] Building CXX object CMakeFiles/libopenmc.dir/src/initialize.cpp.o
[ 21%] Building CXX object CMakeFiles/libopenmc.dir/src/finalize.cpp.o
[ 22%] Building CXX object CMakeFiles/libopenmc.dir/src/geometry.cpp.o
[ 23%] Building CXX object CMakeFiles/libopenmc.dir/src/geometry_aux.cpp.o
[ 24%] Building CXX object CMakeFiles/libopenmc.dir/src/hdf5_interface.cpp.o
[ 25%] Building CXX object CMakeFiles/libopenmc.dir/src/lattice.cpp.o
[ 26%] Building CXX object CMakeFiles/libopenmc.dir/src/material.cpp.o
[ 27%] Building CXX object CMakeFiles/libopenmc.dir/src/math_functions.cpp.o
[ 28%] Building CXX object CMakeFiles/libopenmc.dir/src/mesh.cpp.o
[ 29%] Building CXX object CMakeFiles/libopenmc.dir/src/message_passing.cpp.o
[ 30%] Building CXX object CMakeFiles/libopenmc.dir/src/mgxs.cpp.o
[ 31%] Building CXX object CMakeFiles/libopenmc.dir/src/mgxs_interface.cpp.o
[ 32%] Building CXX object CMakeFiles/libopenmc.dir/src/nuclide.cpp.o
[ 34%] Building CXX object CMakeFiles/libopenmc.dir/src/output.cpp.o
[ 35%] Building CXX object CMakeFiles/libopenmc.dir/src/particle.cpp.o
[ 36%] Building CXX object CMakeFiles/libopenmc.dir/src/particle_restart.cpp.o
[ 37%] Building CXX object CMakeFiles/libopenmc.dir/src/photon.cpp.o
[ 38%] Building CXX object CMakeFiles/libopenmc.dir/src/physics.cpp.o
[ 39%] Building CXX object CMakeFiles/libopenmc.dir/src/physics_common.cpp.o
[ 40%] Building CXX object CMakeFiles/libopenmc.dir/src/physics_mg.cpp.o
[ 41%] Building CXX object CMakeFiles/libopenmc.dir/src/plot.cpp.o
[ 42%] Building CXX object CMakeFiles/libopenmc.dir/src/position.cpp.o
[ 43%] Building CXX object CMakeFiles/libopenmc.dir/src/progress_bar.cpp.o
[ 44%] Building CXX object CMakeFiles/libopenmc.dir/src/random_lcg.cpp.o
[ 45%] Building CXX object CMakeFiles/libopenmc.dir/src/reaction.cpp.o
[ 46%] Building CXX object CMakeFiles/libopenmc.dir/src/reaction_product.cpp.o
[ 47%] Building CXX object CMakeFiles/libopenmc.dir/src/scattdata.cpp.o
[ 48%] Building CXX object CMakeFiles/libopenmc.dir/src/secondary_correlated.cpp.o
[ 50%] Building CXX object CMakeFiles/libopenmc.dir/src/secondary_kalbach.cpp.o
[ 51%] Building CXX object CMakeFiles/libopenmc.dir/src/secondary_nbody.cpp.o
[ 52%] Building CXX object CMakeFiles/libopenmc.dir/src/secondary_thermal.cpp.o
[ 53%] Building CXX object CMakeFiles/libopenmc.dir/src/secondary_uncorrelated.cpp.o
[ 54%] Building CXX object CMakeFiles/libopenmc.dir/src/settings.cpp.o
[ 55%] Building CXX object CMakeFiles/libopenmc.dir/src/simulation.cpp.o
[ 56%] Building CXX object CMakeFiles/libopenmc.dir/src/source.cpp.o
[ 57%] Building CXX object CMakeFiles/libopenmc.dir/src/state_point.cpp.o
[ 58%] Building CXX object CMakeFiles/libopenmc.dir/src/string_utils.cpp.o
[ 59%] Building CXX object CMakeFiles/libopenmc.dir/src/summary.cpp.o
[ 60%] Building CXX object CMakeFiles/libopenmc.dir/src/surface.cpp.o
[ 61%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/derivative.cpp.o
[ 62%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter.cpp.o
[ 63%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_azimuthal.cpp.o
[ 64%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_cellborn.cpp.o
[ 65%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_cellfrom.cpp.o
[ 67%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_cell.cpp.o
[ 68%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_cell_instance.cpp.o
[ 69%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_delayedgroup.cpp.o
[ 70%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_distribcell.cpp.o
[ 71%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_energyfunc.cpp.o
[ 72%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_energy.cpp.o
[ 73%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_legendre.cpp.o
[ 74%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_material.cpp.o
[ 75%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_mesh.cpp.o
[ 76%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_meshsurface.cpp.o
[ 77%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_mu.cpp.o
[ 78%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_particle.cpp.o
[ 79%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_polar.cpp.o
[ 80%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_sph_harm.cpp.o
[ 81%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_sptl_legendre.cpp.o
[ 82%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_surface.cpp.o
[ 84%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_universe.cpp.o
[ 85%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/filter_zernike.cpp.o
[ 86%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/tally.cpp.o
[ 87%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/tally_scoring.cpp.o
[ 88%] Building CXX object CMakeFiles/libopenmc.dir/src/tallies/trigger.cpp.o
[ 89%] Building CXX object CMakeFiles/libopenmc.dir/src/timer.cpp.o
[ 90%] Building CXX object CMakeFiles/libopenmc.dir/src/thermal.cpp.o
[ 91%] Building CXX object CMakeFiles/libopenmc.dir/src/track_output.cpp.o
[ 92%] Building CXX object CMakeFiles/libopenmc.dir/src/urr.cpp.o
[ 93%] Building CXX object CMakeFiles/libopenmc.dir/src/volume_calc.cpp.o
[ 94%] Building CXX object CMakeFiles/libopenmc.dir/src/wmp.cpp.o
[ 95%] Building CXX object CMakeFiles/libopenmc.dir/src/xml_interface.cpp.o
[ 96%] Building CXX object CMakeFiles/libopenmc.dir/src/xsdata.cpp.o
[ 97%] Linking CXX shared library lib/libopenmc.so
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lpugixml
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libopenmc.dir/build.make:1430: lib/libopenmc.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:189: CMakeFiles/libopenmc.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
The build process appears to be broken if pugixml is already installed elsewhere on the system. I'm getting the following error when I try to compile a second version of OpenMC on the same system:
[ 97%] Linking CXX shared library lib/libopenmc.so /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lpugixml collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/libopenmc.dir/build.make:1430: lib/libopenmc.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:189: CMakeFiles/libopenmc.dir/all] Error 2 make: *** [Makefile:149: all] Error 2
Perhaps this was caused by #1770?