Ld: can't use -undefined warning or suppress with -twolevel_namespace

Dear all,
I am using ROOT on macosx. The installation is from source.
Since the last update and recompilation of ROOT, every time I try to use root to interactively compile a macro I get the following error message:

ld: can’t use -undefined warning or suppress with -twolevel_namespace
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In the error message I see
Error in : Executing ‘cd “/Users/asarti/analisi/thewall/anasim” ; c++ -fPIC -c -O3 -DNDEBUG -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -I$ROOTSYS/include -isysroot “/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk” -I"/Users/Shared/Packages/root-6.22.02/etc/" -I"/Users/Shared/Packages/root-6.22.02/etc//cling" -I"/Users/Shared/Packages/root-6.22.02/include/" -I"/Users/Shared/Packages/root-6.22.02/include" -D__ACLIC__ “/Users/asarti/analisi/thewall/anasim/MuonBkgStudy_C_ACLiC_dict.cxx” ; c++ -O3 -DNDEBUG “/Users/asarti/analisi/thewall/anasim/MuonBkgStudy_C_ACLiC_dict.o” -bundle -undefined suppress -o “/Users/asarti/analisi/thewall/anasim/./MuonBkgStudy_C.so”’ failed!

and the -undefined suppress explicit message that is causing problems.
How can I get rid of that?

Here are the details of my installation:
root-config --libs --ldflags --ld --cflags --version --arch

-L/Users/Shared/Packages/root-6.22.02/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -lfreetype -stdlib=libc++ -lpthread -lm -ldl -m64 c++ -stdlib=libc++ -D_REENTRANT -std=c++14 -m64 -I/Users/Shared/Packages/root-6.22.02/include 6.22/02 macosx64

and architecture:
uname -a

Darwin MacBook-Pro-3.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Thanks a lot for any help that would come.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi @asartim ,
maybe @Axel or @vvassilev have an idea of who is adding the invalid -undefined warning option and why, let’s see :smiley:

In the meanwhile, did you recompile ROOT from scratch after the last MacOS update (i.e. from an empty build directory)? If not, that could help.

You can also install ROOT on Mac in a number of other ways – you might not have to compile ROOT from source. See https://root.cern/install for an overview.

Cheers,
Enrico

Hi.
Indeed I scratched the builddir and reinstalled ROOT. (I haven’t re-downloaded root… just removed the build dir and recompiled/installed it).
And still when I try to compile using the interpreter I get the error message.
Any hint on where to look inside the root package? I am pretty sure that there should be a ‘macro’ that is called that I can try to hack…
Thanks a lot…

Hi,

That’s because you try to use v6.22.02 which doesn’t support macOS 11 yet - and I bet that’s what the Darwin version corresponds to: macOS 11.

Please try with 6.22.06, or even better yet, the branch v6-22-00-patches. We will be releasing 6.22/08 from that branch very soon.

Cheers, Axel

1 Like

Thanks a lot.
I confirm that I have macosx 11.2.
Indeed switching to v6-22-00-patches solved the problem.

1 Like

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