Installing root on raspberry pi 3

I am trying to install 6 (versions 6.32.06, 6.34.02) Followed to the instructions here https://root.cern/install/dependencies/ to install the dependencies

Always getting error during linking stake of llvm

[ 22%] Built target obj.llvm-tblgen
[ 22%] Linking CXX executable ../../bin/llvm-tblgen
/usr/bin/ld: CMakeFiles/obj.llvm-tblgen.dir/TableGen.cpp.o: in function `(anonymous namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&)':
TableGen.cpp:(.text._ZN12_GLOBAL__N_116LLVMTableGenMainERN4llvm11raw_ostreamERNS0_12RecordKeeperE+0x110): undefined reference to `llvm::EmitGlobalISel(llvm::RecordKeeper&, llvm::raw_ostream&)'
collect2: error: ld returned 1 exit status
make[2]: *** [interpreter/llvm-project/llvm/utils/TableGen/CMakeFiles/llvm-tblgen.dir/build.make:202: interpreter/llvm-project/llvm/bin/llvm-tblgen] Error 1
make[1]: *** [CMakeFiles/Makefile2:9003: interpreter/llvm-project/llvm/utils/TableGen/CMakeFiles/llvm-tblgen.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I just need to run the root to make TTree on fly, when raspberry pi will be connected to CAEN V1720 in stand alone mode. Searched the net, did not find any working recommendation.
In one place someone even recommended to remove that anonymous namespace

Do I miss some library? Or is there any fix?

I tried normal config line this

    mkdir <builddir>
        cd <builddir>
        cmake ../root -DCMAKE_INSTALL_PREFIX=<prefix> -Dgnuinstall=ON 
        cmake --build .                  [ or simply "make -j<N>" on Unix systems ]
        cmake --build . --target install [ or simply "make install" on Unix systems ]

or minimal one, like this

cmake ../root -DCMAKE_INSTALL_PREFIX=/usr/local -Dgnuinstall=ON \ -DCMAKE_SHARED_LINKER_FLAGS=’-latomic’ \   
-Dxrootd=OFF  \          
-Dxml=OFF     \
-Dxft=OFF               \ 
-Dtable=OFF           \  
-Dssl=OFF              \ 
-Dsrp=OFF               \
-Dsqlite=OFF           \ 
-Dshadowpw=OFF \               
-Dsapdb=OFF  \            
-Drfio=OFF      \        
-Droofit=OFF  \
-Dqtgsi=OFF        \       
-Dpythia8=OFF  \         
-Dpythia6=OFF \          
-Dpgsql=OFF  \ 
-Doracle=OFF         \    
-Dopengl=OFF        \    
-Dodbc=OFF           \   
-Dmysql=OFF         \         
-Dmonalisa=OFF    \         
-Dminuit2=OFF       \  
-Dminimal=ON        \     
-Dmathmore=OFF  \                
-Dldap=OFF           \   
-Dkrb5=OFF           \  
-Dimt=OFF              \
-Dhdfs=OFF            \
-Dgviz=OFF             \  
-Dglite=OFF            \ 
-Dgfal=OFF            \  
-Dgenvector=OFF \                 
-Dfitsio=OFF  \         
-Dfftw3=OFF \
-Ddcache=OFF \              
-Dcastor=OFF  \
-Dbuiltin_glew=OFF \
-Dbuiltin_ftgl=ON              \
-Dbuiltin_freetype=OFF       \           
-Dbuiltin_afterimage=OFF    \  
-Dbonjour=OFF     \       
-Dastiff=OFF        \    
-Dasimage=OFF \          
-Dalien=OFF   \          
-Dtvma=OFF  \
-Dbuiltin_davix=OFF

I don’t know if someone already built the latest ROOT version on raspberry. Anyway, since it is a problem with llvm-tblgen, maybe @vvassilev has an idea

Does running make with -j1 help? You might be running out of memory.

Nope

make -j1

and

 Linking CXX executable ../../bin/llvm-tblgen
/usr/bin/ld: CMakeFiles/obj.llvm-tblgen.dir/TableGen.cpp.o: in function `(anonymous namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&)':
TableGen.cpp:(.text._ZN12_GLOBAL__N_116LLVMTableGenMainERN4llvm11raw_ostreamERNS0_12RecordKeeperE+0x110): undefined reference to `llvm::EmitGlobalISel(llvm::RecordKeeper&, llvm::raw_ostream&)'
collect2: error: ld returned 1 exit status
make[2]: *** [interpreter/llvm-project/llvm/utils/TableGen/CMakeFiles/llvm-tblgen.dir/build.make:202: interpreter/llvm-project/llvm/bin/llvm-tblgen] Error 1
make[1]: *** [CMakeFiles/Makefile2:9003: interpreter/llvm-project/llvm/utils/TableGen/CMakeFiles/llvm-tblgen.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

What undefined reference during linking has to do with running out of memory ?

One of the compilation (generation of a .o file) may have failed (stopped due to being out of memory) but left an empty (or near empty) .o file (so it is not being regenerated)

Thanks for your input @vvassilev and @pcanal. Case is exactly the same as @pcanal describes - GlobalISelEmitter.cpp.o never compiles. If run make without -j1 pi3 becomes completely unresponsive , when it to compile this file, when I run with -j1, slows down drastically.

Usually I run root compilation during the night and that is why I never noticed this fact. Will try to replace RPI3 with RPI4 and let see. Thank you

Here is some “workaround” for this my problem (in case someone else will need). What I was doing after compilation was crashing, is

make clean

and then make or make -j1. Now I just found aforementioned file

GlobalISelEmitter.cpp.o 

and just deleted it, then I rebooted PI and run make (accidentally , without -j1 option) and voila

[ 21%] Building CXX object interpreter/llvm-project/llvm/utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/CTagsEmitter.cpp.o
[ 22%] Built target obj.llvm-tblgen
[ 22%] Linking CXX executable ../../bin/llvm-tblgen
[ 22%] Built target llvm-tblgen

Thanks for the clue and your help