zoglauer / megalib

MEGAlib - the Medium-Energy Gamma-ray Astronomy library
http://megalibtoolkit.com
Other
41 stars 32 forks source link

ROOT 6.28/6.30 Compilation error with XCode 15.3 #89

Closed avalluvan closed 5 months ago

avalluvan commented 5 months ago

Posting this here for completeness,

Screenshot 2024-04-05 at 7 05 11 PM
In file included from input_line_3:2:
In file included from /Users/penguin/MEGAlib/external/root_v6.28.12/root_v6.28.12-build/include/Rtypes.h:193:
/Users/penguin/MEGAlib/external/root_v6.28.12/root_v6.28.12-build/include/GenericClassInfo.h:22:10: remark: building module 'std_vector' as '/Users/penguin/MEGAlib/external/root_v6.28.12
/root_v6.28.12-build/lib/std_vector.pcm' [-Rmodule-build]
#include ‹vector>
Error: Building module 'std_vector' implicitly. If 'std_vector' requires a dictionary please specify build dependency: 'G__Core.cxx' depends on 'std_vector'.
Otherwise, specify '-mByproduct std_vector' to disable this diagnostic.

The above traceback can be solved by downgrading from XCode 15.3 to XCode 15.1 Source: https://root-forum.cern.ch/t/root-6-30-04-build-failed-on-macos-14-4-arm64-xcode-15-3/58415

zoglauer commented 5 months ago

The issue at hand was caused by changes Apple made to Xcode resulting in ROOT not finding header files. It is fixed in the v6-28-00-patches branch of ROOT. Please install that version of ROOT, or wait until it v6.28.14 is released.

Since Apple keeps tinkering with the current version of macOS and Xcode, which can break things in MEGAlib or any of the libraries it depends on (here: ROOT), I recommend to stay one version behind the latest version where using a Mac.

zoglauer commented 4 months ago

Addendum:

ROOT fixed the incompatibility in the head of the branch https://github.com/root-project/root/tree/v6-28-00-patches but they have not yet put it into a release.

Thus here is the work around (copied from my test to my production system, thus there might be typos):

Go to https://github.com/root-project/root/tree/v6-28-00-patches Click "Code" -> Download it as zip file

Convert the zip file to a tar.gz file: bsdtar -zcf root-6-28-00-patches.tar.gz @root-6-28-00-patches.zip

Switch to the MEGAlib external directory cd $MEGALIB/external

copy the root-6-28-00-patches.tar.gz tarball into the external directory: cp /path/to/root-6-28-00-patches.tar.gz .

Run the build root script: bash ../config/build-root.sh --tar=root-6-28-00-patches.tar.gz

wait

Switch back to the MEGAlib directory: cd $MEGALIB

Check what the name of the new ROOT directory in external is. Mine is external/root_v6-28-13

Then run setup: bash setup.sh --br=main --root=external/root_v6-28-13

wait

That should get everything to work again.