# Problem building castor om Mac Ventura

**URL:** <https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487>\
**Category:** General Discussions\
**Created:** [March 22, 2023, 12:16pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487 "2023-03-22T12:16:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Ljungberg](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Michael\_Ljungberg](https://castor-project.discourse.group/u/Michael_Ljungberg)\
**Post date:** [March 22, 2023, 12:16pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/1 "2023-03-22T12:16:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [March 24, 2023, 11:52am UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/2 "2023-03-24T11:52:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_Ljungberg](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Michael\_Ljungberg](https://castor-project.discourse.group/u/Michael_Ljungberg)\
**Post date:** [March 24, 2023, 12:37pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/3 "2023-03-24T12:37:55Z")

</div>

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

 ![PastedGraphic-1.jpg](https://global.discourse-cdn.com/free1/uploads/castor_project/original/1X/44b86bdfda67d9d804ff7782bde19907a314f7ad.jpeg)

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [March 24, 2023, 12:47pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/4 "2023-03-24T12:47:34Z")

</div>

Could you retry after replacing the CMakeLists file with the one in attachment ?  
[CMakeLists.txt](https://castor-project.discourse.group/uploads/short-url/8jmu1nqj0QnMKzCPeMUjMSXZwPn.txt) (18.1 KB)

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

---

<div class="post-metadata">

**Author:** ![Michael\_Ljungberg](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Michael\_Ljungberg](https://castor-project.discourse.group/u/Michael_Ljungberg)\
**Post date:** [March 24, 2023, 5:05pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/5 "2023-03-24T17:05:07Z")

</div>

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 🙂

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

---

<div class="post-metadata">

**Author:** ![Michael\_Ljungberg](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Michael\_Ljungberg](https://castor-project.discourse.group/u/Michael_Ljungberg)\
**Post date:** [March 24, 2023, 7:57pm UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/6 "2023-03-24T19:57:46Z")

</div>

I fount this command

sudo spctl --master-disable

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

Hälsningar / Best Regards

Michael

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [March 27, 2023, 9:55am UTC](https://castor-project.discourse.group/t/problem-building-castor-om-mac-ventura/487/7 "2023-03-27T09:55:55Z")

</div>

Hi Michael,

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

Best regards,  
Thibaut
