I have found a nice video explaining how to set up ROOT paths and so on for XCODE on INTEL based laptop. I tried on a MacBook M1 (Sonoma 14.2.1 latest version), and it didn’t work due to some errors.
I installed ROOT long time ago, and it has been working since then. I am currently running the root on a terminal from a macro, and it’s working fine. However, I’d like to use XCODE.
On XCODE, I went to Build Settings on a project I created as in the video.
On my terminal, I found where my ROOT is with …
root-config --prefix
/opt/homebrew/Cellar/root/6.30.02
I set up the path as stated on the video: ROOTSYS = /opt/homebrew/Cellar/root/6.30.02
Then, I defined Header Search Paths: $(ROOTSYS)/include/root
Then, I set Runpath Search Path: $(ROOTSYS)/lib/root
However, I got these 2 errors which I added the photo of it.
The project name and the function name in the file are not the same. I am not sure if that’S the issue. Normally, the main function name should be the same in ROOT as far as I remember.
I am sorry to hear you are experiencing this issue.
Have you tried to use as your linker command with the output of root-config --libs --glibs --cflags ?
The screenshot seems to hint to a debugging output: could you perhaps dig it out? Useful information about the cause of this issue might be found there.
I have just install new ROOT version 6.30, and it works fine on terminal.
I repeated the procedure I explained above with screenshots again, but XCODE cannot compile the code.
The error at this time is “… .h. files not found”. I guess XCODE cannot reach the library files. I set up the PATH already. Why it cannot find it? It should be easy.
I reinstalled ROOT with macport. Here is its details:
Welcome to ROOT 6.30/03
| Built for macosxarm64 on Jan 16 2024, 13:11:20
| From heads/master@tags/v6-30-03
| With Apple clang version 15.0.0 (clang-1500.1.0.2.5)
///////////////////////////////////////////////
I have XCODE 15.2 installed.
////////////////////////////////////////////////
I have SONOMA 14.2.1 on my MacBook.
/////////////////////////////////////////////////////////////////////
These are the commands on terminal. and their results to place in XCODE to make ROOT work (hopefully).
I finally concluded that it is nothing to do with me. The headers got errors (BUGS) in them. For instance, parameter pr is not defined in TMath.h and implicit conversion error in line " return TString(buffer, strlen(buffer), s.Data(), s.Length());" in TString.h file.
I will stick with stand alone ROOT. I will just run the macro from a file on a terminal. Unfortunately, I can’t get the benefit of using XCODE which might have speed up my code writing. I still use XCODE but only to read the code not to compile.