Maintaining a personal library on a Linux server without root privileges

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.