Error compiling with Ubuntu 20.04.4 LTS on virtual machine

ROOT Version: 6.18.00
Platform: Ubuntu 20.04.4_ARM (virtualized with Parallels from a Mac M1 PRO)
Compiler: gcc(g++) 9.4.0

Goodmorning,
I just received my new MAC Book PRO with M1 PRO chip and I’m trying to install root on a virtual machine (with Parallels) of Ubuntu 20.04.4 LTS.
I downloaded the source code from: root.cern/releases/release-61800/
I need to make this option (needed for the analysis tool we have in lab):

cmake -DCMAKE_INSTALL_PREFIX=/home/cmspix/daq/root-6.18.00/install -DPYTHON_EXECUTABLE=/usr/bin/python3 --enable-minuit2 -DCMAKE_CXX_STANDARD=17 -Ddavix=off ..

Everything seems fine and when I run:

cmake --build . --target install -j4

It start compiling but it stops here:

[ 80%] Generating G__Matrix.cxx, ../../lib/libMatrix_rdict.pcm, ../../lib/libMatrix.rootmap
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
(.text+0x1240): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): in function `sha256_block_data_order':
(.text+0xf48): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order':
(.text+0x10c8): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
make[2]: *** [net/http/CMakeFiles/RHTTP.dir/build.make:284: lib/libRHTTP.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:22291: net/http/CMakeFiles/RHTTP.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
(.text+0x1240): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): in function `sha256_block_data_order':
(.text+0xf48): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order':
(.text+0x10c8): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
make[2]: *** [net/net/CMakeFiles/Net.dir/build.make:667: lib/libNet.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:22027: net/net/CMakeFiles/Net.dir/all] Error 2

Do you have some suggestions? What I’m doing wrong?
Thanks for your help and time!

Maybe @axel knows if 6.18.00 is supported on ARM, but meanwhile you can try to disable ssl (-Dbuiltin_ssl=OFF)

Thanks, I’m trying but with no success… Anyway yesterday I managed to install both 6.26 and 6.18 but for a bug in the virtual machine I lost everything and I started again from scratch but now I’m stacked here =(

FWIW, and depending on what you want to do, Go-HEP/groot may be an option:

  • it’s in Go instead of C++,
  • it can read and write ROOT files (that are readable by C++/ROOT),
  • and it can be installed on {Linux,Darwin,Windows}/{amd64,arm,arm64,386} (and even cross-compiled from one to the other)

Did you install the binaries or did you build from source?

I need to build from source for some compatibility with my analysis framework

It gives me the same error:

[ 79%] Linking CXX shared library ../../lib/libNet.so
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
(.text+0x1240): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha256-armv8.o): in function `sha256_block_data_order':
(.text+0xf48): dangerous relocation: unsupported relocation
/usr/bin/ld: ../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
../../builtins/openssl/OPENSSL-prefix/lib/libcrypto.a(sha512-armv8.o): in function `sha512_block_data_order':
(.text+0x10c8): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status
make[2]: *** [net/net/CMakeFiles/Net.dir/build.make:667: lib/libNet.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:22027: net/net/CMakeFiles/Net.dir/all] Error 2
[ 79%] Linking CXX shared library ../../lib/libROOTVecOps.so

OK, I have no experience with Ubuntu 20.04.4_ARM but maybe you can try to install ssl in your VM and try again. Otherwise I’ll let @axel comment on this

If it could help:
The verison I’m using is the default after the installation of all the root dependencies as reported in the web site:

cmspix@cmspix:~/daq$ openssl version -a
OpenSSL 3.1.0-dev  (Library: OpenSSL 3.1.0-dev )
built on: Fri Mar 11 13:36:49 2022 UTC
platform: linux-aarch64
options:  bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/lib/engines-3"
MODULESDIR: "/usr/local/lib/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_armcap=0xbf

I obtain the same error also trying with a new virtual machine and Openssl 1.1.1.f

Let’s first fix your CMake configuration such that it uses your distro’s openssl. Can you share your cmake invocation and your CMakeCache.txt?

Hi! Thanks for the reply but I managed to install root using an old version of the Ubuntu kernel (I honestly don’t know what I did wrong before).

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