Problem with compiling macro with custom class in MacOS

Hi ,

There is ongoing development of MCH-MFT Matching for O2, however, some systems are unable to use our prototype MUONMatcher class as defined an implemented on MUONMatcher.h and MUONMatcher.cxx when used on macro runMatching.C in compiled mode. It is a linker issue that cannot find the methods implemented on the cxx file. See error at the bottom. Users of MacOS and CentOS reported the same problem, but it works fine on Ubuntu 18.04, which I used to develop this code.

Advice on how to get this code running on is very much appreciated. @laphecet :wink:

Kind regards,
Rafael

Undefined symbols for architecture x86_64:
  "o2::mch::TrackParam::setCovariances(TMatrixT<double> const&)", referenced from:
      MUONMatcher::loadMCHTracks() in runMatching_C_ACLiC_dict.o
  "o2::mch::TrackParam::TrackParam(o2::mch::TrackParam const&)", referenced from:
      MUONMatcher::loadMCHTracks() in runMatching_C_ACLiC_dict.o
      void std::__1::vector<o2::mch::TrackParam, std::__1::allocator<o2::mch::TrackParam> >::__push_back_slow_path<o2::mch::TrackParam const&>(o2::mch::TrackParam const&) in runMatching_C_ACLiC_dict.o
  "o2::mch::TrackExtrap::extrapToVertex(o2::mch::TrackParam*, double, double, double, double, double, bool, bool)", referenced from:
      MUONMatcher::initGlobalTracks() in runMatching_C_ACLiC_dict.o
  "o2::mch::TrackExtrap::setField()", referenced from:
      MUONMatcher::MUONMatcher() in runMatching_C_ACLiC_dict.o
  "o2::mch::TrackParam::getCovariances() const", referenced from:
      MUONMatcher::MCHtoGlobal(o2::mch::TrackParam&) in runMatching_C_ACLiC_dict.o
ld: symbol(s) not found for architecture x86_64
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

Hi,

Have you tried loading the related library before running the macro?:
gSystem->Load(“libO2MCHTracking”)

Cheers,
Philippe

Hi Philippe,

Indeed, loading the library fixes this issue, thanks!

Cheers,
Javier

p.s. The other issue also mentioned in the related PR (the one on o2::mft::Cluster requiring a default constructor) remains though.