NUISANCEMC / nuisance

github mirror of the NUISANCE neutrino interaction generator comparison tool. Compare your favourite neutrino interaction generators to each other and over 350 published data sets
https://nuisance.hepforge.org
GNU General Public License v3.0
11 stars 21 forks source link

Issue with having an older version of HepMC3 #47

Open jxi24 opened 1 year ago

jxi24 commented 1 year ago

When attempting to build nuisance, I had a copy of HepMC3 installed that was an older version than that required by nuisance. However, the include directory for that version was the same include directory for the ROOT libraries. Therefore, when compiling the new version of HepMC3 pulled in by CPM, the include location for ROOT gets added in prior to the include flags from CPM. This causes issues if any signatures of functions have changed. Below is the output from make VERBOSE=1


/home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build/_deps/hepmc3-src/src/GenCrossSection.cc:23:5: error: no declaration matches ‘int HepMC3::GenCrossSection::windx(const std::string&) const’
   23 | int GenCrossSection::windx(const std::string& wName) const {
      |     ^~~~~~~~~~~~~~~
In file included from /home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build/_deps/hepmc3-src/src/GenCrossSection.cc:16:
/home/isaacson/.local/include/HepMC3/GenCrossSection.h:154:9: note: candidate is: ‘int HepMC3::GenCrossSection::windx(std::string) const’
  154 |     int windx(std::string wName) const;
      |         ^~~~~
/home/isaacson/.local/include/HepMC3/GenCrossSection.h:42:7: note: ‘class HepMC3::GenCrossSection’ defined here
   42 | class GenCrossSection : public Attribute {
      |       ^~~~~~~~~~~~~~~
/home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build/_deps/hepmc3-src/src/GenCrossSection.cc:39:6: error: no declaration matches ‘void HepMC3::GenCrossSection::set_cross_section(const std::vector<double>&, const std::vector<double>&, const long int&, const long int&)’
   39 | void GenCrossSection::set_cross_section(const std::vector<double>& xs, const std::vector<double>& xs_err, const long& n_acc, const long& n_att) {
      |      ^~~~~~~~~~~~~~~
/home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build/_deps/hepmc3-src/src/GenCrossSection.cc:28:6: note: candidate is: ‘void HepMC3::GenCrossSection::set_cross_section(const double&, const double&, const long int&, const long int&)’
   28 | void GenCrossSection::set_cross_section(const double& xs, const double& xs_err, const long& n_acc, const long& n_att) {
      |      ^~~~~~~~~~~~~~~
/home/isaacson/.local/include/HepMC3/GenCrossSection.h:42:7: note: ‘class HepMC3::GenCrossSection’ defined here
   42 | class GenCrossSection : public Attribute {
      |       ^~~~~~~~~~~~~~~
make[2]: *** [_deps/hepmc3-build/CMakeFiles/HepMC3.dir/build.make:76: _deps/hepmc3-build/CMakeFiles/HepMC3.dir/src/GenCrossSection.cc.o] Error 1
make[2]: Leaving directory '/home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build'
make[1]: *** [CMakeFiles/Makefile2:674: _deps/hepmc3-build/CMakeFiles/HepMC3.dir/all] Error 2
make[1]: Leaving directory '/home/isaacson/Documents/Projects/NeutrinoGenerator/nuisance/build'
make: *** [Makefile:156: all] Error 2```