Problem building castor om Mac Ventura

Hi all

I am trying to build Castor on newest Ventura for Mac and I get errors like below when I want to include ROOT or/and MPI. Buildning a clean castor-recon works

Any ideas from anyone.

Thanks

Michael Ljungberg
Lund University

/Applications/root_v6.28.00/include/ROOT/TypeTraits.hxx:201:29: error: no template named ‘result_of_t’ in namespace ‘std’; did you mean ‘result_of’?
using InvokeResult_t = std::result_of_t<F(Args…)>;
~^~~~~~~
result_of
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/type_traits:4009:62: note: ‘result_of’ declared here
template class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
^
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:44:
In file included from /Applications/root_v6.28.00/include/TROOT.h:28:
In file included from /Applications/root_v6.28.00/include/TDirectory.h:25:
In file included from /Applications/root_v6.28.00/include/TClass.h:29:
In file included from /Applications/root_v6.28.00/include/TObjArray.h:25:
In file included from /Applications/root_v6.28.00/include/TSeqCollection.h:25:
In file included from /Applications/root_v6.28.00/include/TCollection.h:33:
/Applications/root_v6.28.00/include/ROOT/RRangeCast.hxx:144:64: error: no member named ‘cbegin’ in namespace ‘std’; did you mean ‘begin’?
using const_iterator = Internal::TypedIter<T, decltype(std::cbegin(std::declval<Range_t>())), isDynamic>;
~^~
begin
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/initializer_list:99:1: note: ‘begin’ declared here
begin(initializer_list<_Ep> __il) _NOEXCEPT
^
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:44:
In file included from /Applications/root_v6.28.00/include/TROOT.h:28:
In file included from /Applications/root_v6.28.00/include/TDirectory.h:25:
In file included from /Applications/root_v6.28.00/include/TClass.h:29:
In file included from /Applications/root_v6.28.00/include/TObjArray.h:25:
In file included from /Applications/root_v6.28.00/include/TSeqCollection.h:25:
In file included from /Applications/root_v6.28.00/include/TCollection.h:33:
/Applications/root_v6.28.00/include/ROOT/RRangeCast.hxx:145:47: error: no member named ‘cbegin’ in namespace ‘std’; did you mean ‘begin’?
const_iterator begin() const { return std::cbegin(fInputRange); }
~^~
begin
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/initializer_list:99:1: note: ‘begin’ declared here
begin(initializer_list<_Ep> __il) _NOEXCEPT
^
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:44:
In file included from /Applications/root_v6.28.00/include/TROOT.h:28:
In file included from /Applications/root_v6.28.00/include/TDirectory.h:25:
In file included from /Applications/root_v6.28.00/include/TClass.h:29:
In file included from /Applications/root_v6.28.00/include/TObjArray.h:25:
In file included from /Applications/root_v6.28.00/include/TSeqCollection.h:25:
In file included from /Applications/root_v6.28.00/include/TCollection.h:33:
/Applications/root_v6.28.00/include/ROOT/RRangeCast.hxx:146:45: error: no member named ‘cend’ in namespace ‘std’; did you mean ‘end’?
const_iterator end() const { return std::cend(fInputRange); }
~^~
end
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/initializer_list:108:1: note: ‘end’ declared here
end(initializer_list<_Ep> __il) _NOEXCEPT
^
1 warning and 15 errors generated.
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:44:
In file included from /Applications/root_v6.28.00/include/TROOT.h:28:
/Applications/root_v6.28.00/include/TDirectory.h:281:16: error: no template named ‘enable_if_t’ in namespace ‘std’; did you mean ‘enable_if’?
inline std::enable_if_t<!std::is_base_of<TObject, T>::value, Int_t>
~^
~~~~
enable_if
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/type_traits:546:63: note: ‘enable_if’ declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
^
make[2]: *** [CMakeFiles/castor-PetScannerLutEx.dir/src/management/gDataConversionUtilities.cc.o] Error 1
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:44:
In file included from make[2]: /Applications/root_v6.28.00/include/TROOT.h:28:
*** Waiting for unfinished jobs…
/Applications/root_v6.28.00/include/TDirectory.h:295:16: error: no template named ‘enable_if_t’ in namespace ‘std’; did you mean ‘enable_if’?
inline std::enable_if_t<std::is_base_of<TObject, T>::value, Int_t>
~^~~~~~~
enable_if
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/type_traits:546:63: note: ‘enable_if’ declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
^
[ 38%] Building CXX object CMakeFiles/castor-scannerLUTExplorer.dir/src/management/gOptions.cc.o
In file included from /Users/michael/gate/castor/src/management/gDataConversionUtilities.cc:32:
In file included from /Users/michael/gate/castor/include/management/gDataConversionUtilities.hh:47:
In file included from /Applications/root_v6.28.00/include/TCanvas.h:15:
In file included from /Applications/root_v6.28.00/include/TPad.h:15:
/Applications/root_v6.28.00/include/TVirtualPad.h:68:8: error: ‘auto’ return without trailing return type; deduced return types are a C++14 extension
auto IsInteractive() const { return fInteractive; }
^
/Applications/root_v6.28.00/include/TVirtualPad.h:69:8: error: ‘auto’ return without trailing return type; deduced return types are a C++14 extension
auto GetSaved() const { return fSaved; }
^
/Applications/root_v6.28.00/include/TVirtualPad.h:69:39: error: cannot initialize return object of type ‘int’ with an lvalue of type ‘TVirtualPad *const’
auto GetSaved() const { return fSaved; }
^~~~~~
[ 38%] Building CXX object CMakeFiles/castor-scannerLUTExplorer.dir/src/management/sAddonManager.cc.o
1 warning and 15 errors generated.
make[2]: *** [CMakeFiles/castor-scannerLUTExplorer.dir/src/management/gDataConversionUtilities.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [CMakeFiles/castor-datafileExplorer.dir/all] Error 2
make[1]: *** [CMakeFiles/castor-imageDynamicTools.dir/all] Error 2
make[1]: *** [CMakeFiles/castor-recon.dir/all] Error 2
make[1]: *** [CMakeFiles/castor-PetScannerLutEx.dir/all] Error 2
make[1]: *** [CMakeFiles/castor-scannerLUTExplorer.dir/all] Error 2

Hi Michael,

I think this could come from compilation options incompatibility between late ROOT version (>6.24 I believe) and CASToR. CASToR still forces compilation with c++11, while ROOT uses more recent norm (14 or 17). It could be related to something else as well though.
So I would first try to recompile CASToR with CXXFLAGS / CMAKE_CXX_FLAGS set to a more recent norm and check if that solves the issue.

Best,
Thibaut

OK

Thanks. Do you have what I actually should write as a flag in the ccmake menue. I have tried 14 and c++14 but these seems not to work

Hälsningar / Best regards,

Michael

Could you retry after replacing the CMakeLists file with the one in attachment ?
CMakeLists.txt (18.1 KB)

(The current file still enforces c++11 despite user input).

Hi Thibaut

With your new Cmake file and theCMAKE_FLAGS -std=c++14 I could compile (c++17 does not work) but I then had to give MacOS permission manually to about 30-40 libXXX.so files before I actual could do the conversion. However, but after that I can convert without these irretating questions :slight_smile:

So thanks for helping out with this.

BTW - Maybe some reading this perhaps know a command how to grant access in a macos terminal to files without going through the ‘open in finder’ process. Then one could write a script that do this.

Best regards,

Michael

I fount this command

sudo spctl --master-disable

to avoid these security questions and compiles fine now works on both M2 computers and intel :slight_smile:

Hälsningar / Best Regards

Michael

Hi Michael,

Glad you could sort it out, and thanks for the tip!

Best regards,
Thibaut