General hints for compiling and installing in a user folder (no root access required)

A good source of information is: https://www.linuxfromscratch.org/

Set environment variables such that everything can be found:

  • Make sure the new binaries are found and used with priority:
    • export PATH=/home/fphysics/smeuren/bin/:$PATH
    • Test: which xyx → should now point to the home directory
  • export CFLAGS='-I/home/fphysics/smeuren/include/ -L/home/fphysics/smeuren/lib -L/home/fphysics/smeuren/lib64'
  • export CPPFLAGS='-I/home/fphysics/smeuren/include/ -L/home/fphysics/smeuren/lib/ -L/home/fphysics/smeuren/lib64'

  • export CXXFLAGS='-I/home/fphysics/smeuren/include/ -L/home/fphysics/smeuren/lib/ -L/home/fphysics/smeuren/lib64'
  • Make sure that the local libraries are used:
    https://stackoverflow.com/questions/13367025/how-to-force-using-local-shared-libraries-over-system-libraries
    • export LDFLAGS='-L/home/fphysics/smeuren/lib/ -L/home/fphysics/smeuren/lib64'

    • export LD_LIBRARY_PATH=/home/fphysics/smeuren/lib64/:/home/fphysics/smeuren/lib/:$LD_LIBRARY_PATH

  • sh configure --prefix=/home/fphysics/smeuren/
  • Parallel building: make all -j 40
  • IMPORTANT: if you use a script to set all variables:  "source set_env.sh"

Show current system info

Update May 19, 2024


Libraries compiled May 16, 2024

Libraries compiled Feb 24, 2024

Additional libraries Feb 13, 2024

  • pango-1.39.0 (later versions had issues with glib)
  • https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.htmlCMAKE_LIBRARY_PATH
    • create extra build directory
    • cmake: this worked: "cmake .. -DBUILD_JAVA=OFF -DBUILD_FAT_JAVA_LIB=OFF -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_videoio=OFF -DCMAKE_LIBRARY_PATH=/home/fphysics/smeuren/lib -DCMAKE_INSTALL_PREFIX:PATH=/home/fphysics/smeuren/ -DWITH_GSTREAMER=OFF -DBUILD_opencv_gapi=OFF
    • build: cmake --build . -j40
    • make install

Attempt Nov 24, 2023 (successful)

Unless otherwise specified, all packages are configured using:
configure --prefix=/home/fphysics/smeuren/

Installing GCC

  • Read:
  • Install required libraries:
  • Create a separate build directory outside of the source directory
  • Configure flags (update 2024, Feb. 13):
    • sh ../gcc-10.4.0/configure --prefix=/home/fphysics/smeuren/ --build=x86_64-linux-gnu --enable-languages=c,c++,fortran --with-mpfr-include=/home/fphysics/smeuren/include/ --with-gmp-include=/home/fphysics/smeuren/include/ --with-mpc-include=/home/fphysics/smeuren/include/ --with-mpfr-lib=/home/fphysics/smeuren/lib/ --with-gmp-lib=/home/fphysics/smeuren/lib/ --with-mpc-lib=/home/fphysics/smeuren/lib/ --disable-multilib --enable-static --disable-nls --disable-lto --disable-ce 
    • Before, this worked (apparently):
      sh ../gcc-10.4.0/configure --prefix=/home/fphysics/smeuren/ --build=x86_64-linux-gnu --enable-languages=c,c++,fortran --with-mpfr=/home/fphysics/smeuren/software/ --with-gmp=/home/fphysics/smeuren/software/ --with-mpc=/home/fphysics/smeuren/software/ --disable-multilib --enable-static --disable-nls --disable-lto --disable-ce
    • If there are some issues with loading libraries: make sure "export LD_LIBRARY_PATH=/home/fphysics/smeuren/lib64/:/home/fphysics/smeuren/lib/:$LD_LIBRARY_PATH"
    • If there is interference with a previous build: load profile "0" after login

  • First: 10.4, then 13.2 (maybe 13.2 immediately would have worked too)
  • Errors:

Installing Python

Prerequisites:

Installing Python 3.12:

Bug Fixes:

  • Initially, the build failed because I had include paths to a local python installation. They need to be removed
  • export LIBS="-lgcov" needed

Packages

  • use tinyproxy and port forwarding, then pip3 install as usual (set https_proxy=xyz properly!)




Recent version of Eigen

  • https://eigen.tuxfamily.org/
  • cmake ../eigen-3.4.0 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX:PATH=/home/fphysics/smeuren/

Recent version of cmake

Recent version of gdb (not needed so far)

Recent version of python3

Recent version of libffi

Recent version of openssl

Recent version of binutils

Recent version of texinfo

Recent version of make

Recent version of libtool

Recent version of bison

Recent version of gcc


Not needed, ignore

Recent version of glibc (better not to change, ignore this section)

TLDR: I followed the advice to 'install' to a tmp directory, and erase all files from my actual home directory, to get back to the version provided by the system. To do this, I used:

from os import walk
import sys
from os.path import exists
import os

erasepath	= ".."
path	= '/home/fphysics/smeuren/'

for (dirpath, dirnames, filenames) in walk('.'):
	for name in filenames:
		tempfile	= dirpath+"/"+name
		print('file: ',tempfile, 'test: ', path+tempfile[2:])
		
		if(exists(path+tempfile)== True):
			os.remove(path+tempfile[2:])

gcc was recompiled afterwards, no issues.


Recent Kernel Headers (better not to mess with this, ignore this section)




  • No labels