Error Building "makefile" : cant find some library

Hello,

I am trying to make a offline analysis program on my machine.
But, somehow it fails because it cant find a library on machine.
This is the error which I get

usr/bin/ld: warning: libImt.so.6.10, needed by /usr/opt/root/lib/libTree.so.6.10, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_CTX_free@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_get_error@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_use_PrivateKey_file@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to EVP_sha1@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_read@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_set_quiet_shutdown@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSLv23_method@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_CTX_new@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_peek@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_new@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toHMAC@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_write@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_load_verify_locations@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_free@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_set_fd@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_connect@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_library_init@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to `SSL_shutdown@OPENSSL_1.0.0’
collect2: error: ld returned 1 exit status
make: *** [Makefile:33: AnalyzeDDAS] Error 1
[mansi@localhost RootAnalysis]$

I tried to check for this library -
[mansi@localhost lib] ls libImt* ls: cannot access 'libImt.so': Too many levels of symbolic links ls: cannot access 'libImt.so.6.10': Too many levels of symbolic links libImt.rootmap libImt.so.6.10.02 [mansi@localhost lib] pwd
/usr/opt/root/lib

I had earlier used the command -
sudo ln -s /usr/opt/root/lib/libImt.so /usr/opt/root/lib/libImt.so.6.10

to make sure I point to the library needed.
But, somehow the make command always fails.

Please help !


Please read tips for efficient and successful posting and posting code

ROOT Version: Root 6.18/00
Platform: fedora 31
Compiler: gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)


Hi,

Looks like you ended up with a mess that once was a ROOT installation. I have a hunch why: you report using “ROOT 6.18/00” but /usr/opt/root/lib/libNet.so.6.10 etc belong to v6.10. Did you mix libraries across ROOT versions somehow?

Axel.

Hi,

As far as I remember I did a clean installation of ROOT v 6.18.00.
I had installed another online/offline software which requires ROOT v6.18 and that installation was successful.

I am somehow having errors when i try to make this “Analysis Program”

I have a feeling that may be , it is looking for a older version of ROOT.

Please suggest.

Thanks,
Mansi

Hello Again,

I am trying to install a older version of ROOT on my machine, just to have two different versions going on.

So I am now trying to install ROOT_v6.06.
I am doing a out of source build. I tried to do it make and/or cmake command-
But I always end up getting the same error-

In file included from /home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/include/llvm/IR/DataLayout.h:23,
from /home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/include/llvm/IR/IRBuilder.h:23,
from /home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/tools/clang/lib/CodeGen/CGBuilder.h:13,
from /home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenFunction.h:17,
from /home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/tools/clang/lib/CodeGen/CGVTables.cpp:14:
/home/mansi/Downloads/root-6.06.00/interpreter/llvm/src/include/llvm/ADT/DenseMap.h:428:27: note: synthesized method ‘llvm::ValueMapCallbackVH<const llvm::Value*, llvm::WeakVH, llvm::ValueMapConfig<const llvm::Value*, llvm::sys::SmartMutex > >& llvm::ValueMapCallbackVH<const llvm::Value*, llvm::WeakVH, llvm::ValueMapConfig<const llvm::Value*, llvm::sys::SmartMutex > >::operator=(llvm::ValueMapCallbackVH<const llvm::Value*, llvm::WeakVH, llvm::ValueMapConfig<const llvm::Value*, llvm::sys::SmartMutex > >&&)’ first required here
428 | TheBucket->getFirst() = std::move(Key);
gmake[2]: *** [interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/build.make:479: interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CGVTables.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:10489: interpreter/llvm/src/tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/all] Error 2
gmake: *** [Makefile:152: all] Error 2
[mansi@localhost ROOT_v6.06]$

Is there a way out.

Thanks
Please suggest
Mansi

If you are on Fedora, I recommend using yum or dnf to install ROOT with dnf install root root-* or just install the parts you need. If you need an older version of ROOT for any particular reason, we’d like to know, so that we fix the newer version to let you always use the latest version of ROOT.

Hi Thanks Amadio

I have already installed the latest version of ROOT_V6.18 from the source code on my machine.
It was a clean installation.

I have a set of sorting code which I would like to compile on my machine. But, always I am getting a error. I was told to compile them using a older version of ROOT like 6.06.

The error which i get are as follows-
mansi@localhost RootAnalysis]$ make

g++ -O3 -I. -I/usr/opt/ddas/3.0/include -pthread -std=c++11 -m64 -I/home/mansi/build-6.18/include -c -o Correlator.o Correlator.cpp
g++ -O3 -I. -I/usr/opt/ddas/3.0/include -pthread -std=c++11 -m64 -I/home/mansi/build-6.18/include -c -o Variables-ddas.o Variables-ddas.cpp
g++ -O3 -I. -I/usr/opt/ddas/3.0/include -pthread -std=c++11 -m64 -I/home/mansi/build-6.18/include -c -o AnalyzeDDAS.o AnalyzeDDAS.cpp
rm -f ParametersddasDictionary.cc ParametersddasDictionary.h
rootcint -f ParametersddasDictionary.cxx -c -p Parameters-ddas.h Parametersddas_linkdef.h
Warning: Unused class rule: bdecaySegaTotal
Warning: Unused class rule: bdecaySega
Warning: Unused class rule: bdecaySssdout
Warning: Unused class rule: bdecaySssd
Warning: Unused class rule: bdecayDssdout
g++ -fPIC -shared -olibParametersddas.so -m64 -O3 -I. -I/usr/opt/ddas/3.0/include -pthread -std=c++11 -m64 -I/home/mansi/build-6.18/include -I/home/mansi/root/include ParametersddasDictionary.cxx Parameters-ddas.cpp
Parameters-ddas.cpp: In member function ‘int bdecayTrace::ProcessTrace(int, int, int)’:
Parameters-ddas.cpp:215:1: warning: no return statement in function returning non-void [-Wreturn-type]
215 | }
| ^
g++ -O3 -o AnalyzeDDAS Correlator.o Variables-ddas.o AnalyzeDDAS.o -L/usr/lib64 -lpthread -lrt -lm -L/home/mansi/build-6.18/lib -lGui -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic -L -I. -Wl,-rpath,/home/mansi/EXPT-NSCL/e17009/home/RootAnalysis -L/home/mansi/EXPT-NSCL/e17009/home/RootAnalysis -lParametersddas -Wl,-rpath,/usr/opt/ddas/3.0/lib -L/usr/opt/ddas/3.0/lib -lddaschannel
/usr/bin/ld: warning: libImt.so.6.10, needed by /usr/opt/root/lib/libTree.so.6.10, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_CTX_free@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_get_error@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_use_PrivateKey_file@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to EVP_sha1@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_read@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_set_quiet_shutdown@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSLv23_method@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_CTX_new@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_peek@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_new@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toHMAC@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_write@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_CTX_load_verify_locations@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_free@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_set_fd@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to SSL_connect@OPENSSL_1.0.0' /usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference toSSL_library_init@OPENSSL_1.0.0’
/usr/bin/ld: /usr/opt/root/lib/libNet.so.6.10: undefined reference to `SSL_shutdown@OPENSSL_1.0.0’
collect2: error: ld returned 1 exit status
make: *** [Makefile:33: AnalyzeDDAS] Error 1
[mansi@localhost RootAnalysis]$

I would be happy to use some help on this topic.

Thanks
Mansi

This error is saying that the ROOT installed into /usr/opt/root links against openssl 1.0.0, and your system probably has openssl 1.1.x only. You will probably have to install openssl 1.0.x if you want to use that ROOT, but I recommend to just use ROOT packaged in Fedora to avoid such problems, or you can rebuild ROOT from source again so that it gets linked with the right version of openssl that you have on your system.

Hello,

I actually did rebuild ROOT again from the source. But I end up having the same error.

So, If I would like to use the ROOT packaged in Fedora, then do I need to remove the ROOT v6.18 first from my computer and then install this using the dnf command.

If you built ROOT from source, then it’s probably linking against the builtin openssl. Try to set LD_LIBRARY_PATH to find the libraries from your installed ROOT and it should work. You can also try to build ROOT with -Drpath=ON to not need to set LD_LIBRARY_PATH. If you use the ROOT from Fedora, you can probably keep the one you have installed elsewhere. I’ve never had problems with having more than one installation. However, if you want to build ROOT yourself, you have to uninstall the one from Fedora, because it may cause your build to mix headers from the wrong version.

So , I have set the following environments in my bashrc file.
Should I change anything in this -

ROOTSYS=/home/mansi/build-6.18
source /home/mansi/build-6.18/bin/thisroot.sh
export LD_LIBRARY_PATH=$ROOTSYS/lib/:$LD_LIBRARY_PATH
PATH=$PATH:~/.scripts

I’d remove any ROOT setup from bashrc and only do it when necessary. It usually causes problems.

Hi,

I redid the ROOT installation on my machine.
I build it with -Drpath=ON

But, when I try to compile my analysis code- i end up having the same error as before.

My makefile looks as follows-

Establish the compilers

CC=gcc
CXX=g++
CXXLD=g++
CCLD=gcc

CXXFLAGS= -O3 -I. -I/usr/opt/ddas/3.0/include
CCFLAGS=$(CXXFLAGS)

LDFLAGS= -L/usr/lib64 -lpthread -lrt

ROOTCFLAGS := (shell root-config --cflags) ROOTGLIBS := (shell root-config --glibs)
ROOTLDFLAGS := $(shell root-config --ldflags)

LIB_DIR=

LIBS = -lm (ROOTGLIBS) -L(LIB_DIR) -I. -Wl,-rpath,/home/mansi/EXPT-NSCL/e17009/home/RootAnalysis -L/home/mansi/EXPT-NSCL/e17009/home/RootAnalysis -lParametersddas -Wl,-rpath,/usr/opt/ddas/3.0/lib -L/usr/opt/ddas/3.0/lib -lddaschannel

CXXFLAGS+=$(ROOTCFLAGS)
O_FILES = Correlator.o Variables-ddas.o AnalyzeDDAS.o
O_FILES_F = Variables-ddas.o FilterDDAS.o

all: AnalyzeDDAS FilterDDAS

FilterDDAS: (O_FILES_F) libParametersddas.so (CXXLD) -O3 -o FilterDDAS (O_FILES_F) (LDFLAGS) $(LIBS)

AnalyzeDDAS: (O_FILES) libParametersddas.so (CXXLD) -O3 -o AnalyzeDDAS (O_FILES) (LDFLAGS) $(LIBS)

ParametersddasDictionary.cxx: Parameters-ddas.h Parametersddas_linkdef.h
rm -f ParametersddasDictionary.cc ParametersddasDictionary.h
rootcint -f $@ -c -p Parameters-ddas.h Parametersddas_linkdef.h

libParametersddas.so: ParametersddasDictionary.cxx Parameters-ddas.cpp
(CXX) -fPIC -shared -o@ (ROOTLDFLAGS) (CXXFLAGS) -I$(ROOTSYS)/include $^

#%.o: %.cpp %.h

(CXX) -fPIC (CXXFLAGS) -c < -o @

depend:
makedepend $(CXXFLAGS) *.cpp *.c

clean:
rm -f .o AnalyzeDDAS libParametersddas.so ParametersddasDictionary

DO NOT DELETE

Your build is still mixing up different ROOT versions. See the command line, which contains -L/home/mansi/build-6.18/lib, vs the error message, which contains /usr/opt/root/lib/libNet.so.6.10

Yes,
How do I correct ?

I don’t know, somewhere in your configuration you must set environment variables that find ROOT 6.10, which you have to remove. Just look into LD_LIBRARY_PATH, PATH, etc, and remove paths pointing to /usr/opt/root. In your case, you should also check which root-config is being called from your Makefile.

If I try to find “root-config” This is what I get -

mansi@localhost ~]$ locate root-config
/home/mansi/Downloads/installation/usr/opt/root/bin/root-config

/home/mansi/Downloads/installation/usr/opt/root/man/man1/root-config.1

/home/mansi/Downloads/root/bin/root-config

/home/mansi/Downloads/root/man/man1/root-config.1

/home/mansi/Downloads/root-6.10.00/config/root-config.in

/home/mansi/Downloads/root-6.10.00/man/man1/root-config.1

/home/mansi/Downloads/root-6.18.00/config/root-config.in

/home/mansi/Downloads/root-6.18.00/man/man1/root-config.1

/home/mansi/Downloads/root_v6.10.00.Linux-fedora24-x86_64-gcc6.1
/root/bin/root-config

/home/mansi/Downloads/root_v6.10.00.Linux-fedora24-x86_64-gcc6.1/root/man/man1/root-config.1

/usr/opt/root/bin/root-config

/usr/opt/root/man/man1/root-config.1

[mansi@localhost ~]$

Which one check now ?

locate finds all of them, you want which root-config. But you should also run printenv | sed -ne /root/p to print which variables contain “root” in them.

This seems to be pointing to the correct place

[mansi@localhost RootAnalysis]$ which root-config

~/build_6.18/bin/root-config
[mansi@localhost RootAnalysis]$

[mansi@localhost RootAnalysis]$ printenv | sed -ne /root/p

ROOT_INCLUDE_PATH=/home/mansi/Downloads/go4-6.0.0:/home/mansi/Downloads/go4-6.0.0/include:/home/mansi/root/include:/home/mansi/Downloads/go4-6.0.0:/home/mansi/Downloads/go4-6.0.0/include:/home/mansi/root/include:

And if i try to locate -

mansi@localhost lib]$ locate libImt.so.6.10
/home/mansi/Desktop/libImt.so.6.10
/home/mansi/Downloads/installation/usr/opt/root/lib/libImt.so.6.10
/home/mansi/Downloads/installation/usr/opt/root/lib/libImt.so.6.10.02
/usr/opt/root/lib/libImt.so.6.10
/usr/opt/root/lib/libImt.so.6.10.02

mansi@localhost lib]$ locate libNet.so.6.10
/home/mansi/Downloads/installation/usr/opt/root/lib/libNet.so.6.10
/home/mansi/Downloads/installation/usr/opt/root/lib/libNet.so.6.10.02
/usr/opt/root/lib/libNet.so.6.10
/usr/opt/root/lib/libNet.so.6.10.02

So, I am still not sure about correcting this ?

It’s hard to guess what’s wrong in your configuration, but it’s not ROOT at fault here. The best you can do is to follow my recommendation, just remove your custom installations of ROOT and install it with dnf install root root-* as I suggested in the beginning. Cheers,