Home | News | Documentation | Download

Error while installing KDetSim library on Mac

Hello all,

I am trying to install the KDetSim library (http://kdetsim.org) on my MacBook Pro (macOS Mojave Version 10.14.6). I am running ROOT from a homebrew installation (ROOT 6.22/08).

After extracting the zip file from the KDetSim website, I tried running both “make -f makeLinuxMac KDetSimMacOS” and "make -f makeLinuxMacRoot6 KDetSimMacOS " from inside the KDetSim folder. The code does not compile and I receive an error about

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [KDetSimMacOS] Error 1

Various checks:
To make sure that I’m using the version of ROOT on my machine that I intend to use, I have

source /usr/local/Cellar/root/6.22.08/bin/thisroot.sh

in my .profile file and I get the following when I run “which root” and “which root-config”:

$ which root
/usr/local/Cellar/root/6.22.08/bin/root

$ which root-config
/usr/local/Cellar/root/6.22.08/bin/root-config

Also,

$ echo $LD_LIBRARY_PATH
/usr/local/Cellar/root/6.22.08/lib/root:/usr/local/Cellar/root/6.22.08/lib/root:/usr/local/Cellar/root/6.22.08/lib/root

and

$ echo $DYLD_LIBRARY_PATH
/usr/local/Cellar/root/6.22.08/lib/root:/usr/local/Cellar/root/6.22.08/lib/root:/usr/local/Cellar/root/6.22.08/lib/root

I also tried loading a few libraries in ROOT, forgetting KDetSim
$ root

| Welcome to ROOT 6.22/08 https://root.cern |
| © 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for macosx64 on Mar 10 2021, 14:20:04 |
| From tags/v6-22-08@v6-22-08 |
| Try ‘.help’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/’.q’ |

root [0] gSystem->Load(“libPhysics.so”)
(int) 0
root [1] gSystem->Load(“libHist.so”)
(int) 0

Is it possible that something went wrong with my homebrew installation of ROOT? The paths point to the same Cellar/root/6.22.08 installation so it may not be an issue with KDetSim failing to find the proper installation.

Any help is appreciated! Thank you in advance. Perhaps I’m missing something simple.

Hi @jbeechert,

Did you try to contact the developers of KDetSim, it seems for me Makefiles should be updated?

@oshadura , I downloaded KDetSim and did
make -f makeLinuxMacRoot6 KDetSimMacOS
on my MacBook where I have 6.22.08 installed from source and had no problems.

Jacqueline has a problem in the linking where the root libraries are not found:

g++ -shared -fPIC -g -O -o lib/KDetSim.sl /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KPad.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KDetector.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KField.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/K3D.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KPixel.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KGeometry.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KMaterial.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KStruct.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KStrip.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KImplant2D.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KImplant3D.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KMesh.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/nrutil.o /Users/jacqueline/Desktop/KDetSimDist.1.1/obj/KDetSimDictUX.o -L/usr/local/Cellar/root/6.22.08/lib/root -lGui -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -stdlib=libc++ -lpthread -lm -ldl -lpthread -lm -ldl
Undefined symbols for architecture x86_64:
  "TPolyLine3D::TPolyLine3D(int, float*, float*, float*, char const*)", referenced from:
      KDetector::ShowMipIR(int, int, int) in KDetector.o
      KDetector::ShowGaussBeam(int, float, float, float, int, int) in KDetector.o
  "TF1::TF1(char const*, char const*, double, double)", referenced from:
      KImplant2D::KImplant2D(double*, double, double) in KImplant2D.o
      KImplant3D::KImplant3D(double*, double, double) in KImplant3D.o
  "TF3::TF3(char const*, char const*, double, double, double, double, double, double)", referenced from:
      KDetector::KDetector() in KDetector.o
  "ROOTDict::GenerateInitInstance(KImplant2D const*)", referenced from:
      __GLOBAL__sub_I_KImplant2D.cxx in KImplant2D.o
  "ROOTDict::GenerateInitInstance(KImplant3D const*)", referenced from:
      __GLOBAL__sub_I_KImplant3D.cxx in KImplant3D.o
  "ROOTDict::GenerateInitInstance(K3D const*)", referenced from:
      __GLOBAL__sub_I_K3D.cxx in K3D.o
  "ROOTDict::GenerateInitInstance(KPad const*)", referenced from:
      __GLOBAL__sub_I_KPad.cxx in KPad.o
  "ROOTDict::GenerateInitInstance(KMesh const*)", referenced from:
      __GLOBAL__sub_I_KMesh.cxx in KMesh.o
  "ROOTDict::GenerateInitInstance(KPixel const*)", referenced from:
      __GLOBAL__sub_I_KPixel.cxx in KPixel.o
  "ROOTDict::GenerateInitInstance(KStrip const*)", referenced from:
      __GLOBAL__sub_I_KStrip.cxx in KStrip.o
  "ROOTDict::GenerateInitInstance(KDetector const*)", referenced from:
      __GLOBAL__sub_I_KDetector.cxx in KDetector.o
  "ROOTDict::GenerateInitInstance(KGeometry const*)", referenced from:
      __GLOBAL__sub_I_KGeometry.cxx in KGeometry.o
  "ROOTDict::GenerateInitInstance(KMaterial const*)", referenced from:
      __GLOBAL__sub_I_KMaterial.cxx in KMaterial.o
  "TVector3::TVector3(float const*)", referenced from:
      KDetector::Drift(double, double, double, float, KStruct*, double) in KDetector.o
  "TVector3::TVector3(double, double, double)", referenced from:
      KDetector::Drift(double, double, double, float, KStruct*, double) in KDetector.o
      KField::CalFieldXYZ(float, float, float) in KField.o
  "TVector3::TVector3()", referenced from:
      KDetector::Drift(double, double, double, float, KStruct*, double) in KDetector.o
  "TVector3::~TVector3()", referenced from:
      KDetector::Drift(double, double, double, float, KStruct*, double) in KDetector.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [KDetSimMacOS] Error 1

@jbeechert can you try to install root binaries from here: Release 62208 - ROOT instead of root from Homebrew?

@oshadura Thank you for the suggestion. I installed the macOS 10.14 x86_64 Xcode 10 ROOT binary and cloned the latest version of KDetSim on GitHub to my machine (I have since learned that the link I previously provided to the KDetSim website is not the most recent version of the library).

When I run the makefile using the new ROOT installation and this new version of KDetSim, I see:

$ make -f makeLinuxMacRoot6 KDetSimMacOS

g++ -I /c/cern/rootcyg/include -I /Users/jacqueline/root/include/ -I /Users/jacqueline/Desktop/KDetSim -I /Users/jacqueline/Desktop/KDetSim/inc/ -std=c++11 -fPIC -g -O -c /Users/jacqueline/Desktop/KDetSim/src/KPad.cxx -o /Users/jacqueline/Desktop/KDetSim/obj/KPad.o

error: unable to open output file ‘/Users/jacqueline/Desktop/KDetSim/obj/KPad.o’: ‘No such file or directory’
1 error generated.
make: *** [/Users/jacqueline/Desktop/KDetSim/obj/KPad.o] Error 1

To mitigate this error, I created an “obj” directory myself inside the KDetSim folder and re-ran the makefile. It compiles without errors but gives several warnings. Then, when I test it within ROOT with gSystem->Load(“KDetSim.sl”); I get

root [0] gSystem->Load(“lib/KDetSim.sl”);

Error in <TCling::LoadPCM>: ROOT PCM /Users/jacqueline/Desktop/KDetSim/lib/KDetSimDictUX_rdict.pcm file does not exist

Info in <TCling::LoadPCM>: In-memory ROOT PCM candidate /Users/jacqueline/root/lib/libASImageGui_rdict.pcm

Info in <TCling::LoadPCM>: In-memory ROOT PCM candidate /Users/jacqueline/root/lib/libASImage_rdict.pcm

Info in <TCling::LoadPCM>: In-memory ROOT PCM candidate /Users/jacqueline/root/lib/libEG_rdict.pcm

Info in <TCling::LoadPCM>: In-memory ROOT PCM candidate /Users/jacqueline/root/lib/libEve_rdict.pcm

Info in <TCling::LoadPCM>: In-memory ROOT PCM candidate /Users/jacqueline/root/lib/libFFTW_rdict.pcm

…with many more similar “In-memory ROOT PCM candidate” messages.

Incidentally, I’m running into the same types of errors when trying to install KDetSim on my Linux machine. I created the “obj” directory myself there as well and then receive PCM errors when loading the .sl file.

@oshadura @vvassilev any idea how to fix the

root [0] gSystem->Load(“lib/KDetSim.sl”);

Error in <TCling::LoadPCM>: ROOT PCM /Users/jacqueline/Desktop/KDetSim/lib/KDetSimDictUX_rdict.pcm file does not exist

?