c++linuxunixpath

how to add c++ library to compiler on a public linux/unix cluster


I'm using the school public cluster and want to include c++ library paths to the c++ compiler. I've installed boost, armadillo and so on. After make them, the program told me to add the header path to the c++ compiler. As I'm in a public cluster, how can I do that? Obviously I do not have sudo or yum authorities.


Solution

  • -I/home/username/where/your/directories/are/include for headers

    -L/home/username/where/your/directories/are/lib for your libraries

    From here, if you want to run your executables, you have two options:

    1. Update your LD_LIBRARY_PATH with /home/username/where/your/directories/are/lib
    2. In your compile line add: -Wl,-rpath,/home/username/where/your/directories/are/lib

    HTH