How to change architecture settings to compile files in interactive mode?

Hello.
I am using ROOT on a Mac (OS: 14.7 / M3), and I recently encountered an issue where ROOT does not work properly on my system. After some effort, I was able to successfully install ROOT using Homebrew with the following command:

arch -arm64 brew install root.

However, when I compile files in interactive mode, I receive warnings about architecture mismatches, as shown below:

root [0] .L Show_BEPM_Fitting_Result_Exact_Func.C+g

ld: warning: ignoring file ‘/opt/homebrew/Cellar/lz4/1.10.0/lib/liblz4.1.10.0.dylib’: found architecture ‘arm64’, required architecture ‘x86_64’.

My question is: can I change the architecture settings for the compilers used in interactive mode? If so, how can I do that?

Thanks.

ROOT Version: ROOT 6.32.06 With Apple clang version 15.0.0 (clang-1500.3.9.4)
Platform: Mac OSX 14.7 apple silicon M3

Hi,

Thanks for the post and welcome to the ROOT Forum.
The architecture should be arm64 everywhere: it could be a problem of brew. Do you see the same for every compiled macro?

Cheers,
D

Thank you for your reply.
I tried to compile my macro by Makefile as

ROOTLIBS = $(shell root-config --libs)

CXXLIBS = $(ROOTLIBS)

g++ -o test test.o $(CXXLIBS)

and get the same message: ld: warning: ignoring file ‘/opt/homebrew/Cellar/root/6.32.06/lib/root/libNet.so’: found architecture ‘arm64’, required architecture ‘x86_64’

Then I modified the make file as
g++ -arch arm64 -o test test.o $(CXXLIBS)

as suggested by chatGPT, and it works well.
So I guess that the same kind of manner will work for the .L test.C+g command, but I don’t know how to.

The architecture should be arm64 everywhere: it could be a problem of brew.

My brew is installed in /opt/homebrew, which means arm64 is selected for brew, right?
If there are any other things I should look into or try, please let me know.

Hi,

I suspect that there is something wrong in the way brew sets flags. Could you share the output of root-config --libs? (you used it above to compile the test program)
and also root-config --cflags?

Cheers,
D

Hi,
Thank you for your suggestion.
The outputs are as below:

root-config --libs
-L/opt/homebrew/Cellar/root/6.32.06/lib/root -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -Wl,-rpath,/opt/homebrew/Cellar/root/6.32.06/lib/root -stdlib=libc++ -lpthread -lm -ldl

root-config --cflags
-stdlib=libc++ -pthread -std=c++17 -m64 -I/opt/homebrew/Cellar/root/6.32.06/include/root

I hope these will tell us something.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.