问题
I am trying to install Metis. Since I am working on a public server, I couldn't install it as a root user. So I have installed metis in my account /home/jd/metis.
When I try to execute something, I get
fatal error: metis.h: No such file or directory
I guess the system looks for metis.h under /usr/local/include but couldnt find it there. How do I make linux look for metis.h under /home/jd/metis/include directory?
I added this path to the $PATH variable. But still the same error. Please advise.
回答1:
My advice is to work with cmake. In this question:install metis on unbuntu, I wrote down my cmake file. The command
include_directories("/home/jd/metis/include")
should solve your problem.
回答2:
You may change the environment variable CPLUS_INCLUDE_PATH
.
For example, add this kind of statement in your ~/.bashrc:
export CPLUS_INCLUDE_PATH=$HOME/metis/include:$CPLUS_INCLUDE_PATH
,
then,
source ~/.bashrc
As for dynamic link library(when you install other library such as libevent locally), you may want to change the following two environment variables:
export LIBRARY_PATH=$HOME/libevent/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$HOME/libevent/lib:$LD_LIBRARY_PATH
来源:https://stackoverflow.com/questions/37060100/linux-could-not-find-metis-h