The habit is to install the code under ~/build and then add the executable folder to path:
Export path= $HOME/build/bin: $PATH
For the code that uses configure-and make, simply add prefix to modify the installation path:
./configure--prefix= $HOME/build
For code that uses CMake, modify the Cmake_install_prefix variable to modify the installation path:
cmake-dcmake_install_prefix= $HOME/build
In the absence of root privileges, to specify the C and C + + compiler versions used at CMake, you will not be able to modify the user's. bashrc file by pointing to the implementation in the/usr/bin modify link. For example, if you want to use the compiler under/usr/local/bin instead of the default/usr/bin:
Export cc=/usr/local/bin/gccexport CXX=/usr/local/bin/g++
In GCC compilation, for some programs that might also refer to source and LIB, you need to specify the reference directory in the. bashrc file to prevent it from being found:
Export c_include_path= $HOME/build/INCLUDE: $C _include_pathexport cplus_include_path= $HOME/build/ Include: $CPLUS _include_pathexport ld_library_path= $HOME/build/lib:/usr/local/lib64: $LD _library_ Pathexport CFLAGS="-i$home/build/include"export ldflags="- L$home/build/lib"
Maintaining a personal library on a Linux server without root privileges