简体   繁体   中英

make install saying CUDADIR environment variable not set, when it is

I'm currently trying to install MAGMA , however trying to run "sudo make install" gives me the error:

$ sudo make install prefix=/usr/local/magma
make.check-cuda:7: *** Set $CUDADIR, preferably in your environment, e.g., 
run "export CUDADIR=/usr/local/cuda" in ~/.bashrc, or "setenv CUDADIR 
/usr/local/cuda" in ~/.cshrc.  Stop.

I know for sure that CUDADIR is set, and it's set in ~/.bash_profile, so I'm not sure why it's failing. Is there any reason why it might not being finding it? It seemed to work fine when I ran "make".

$ set | grep CUDADIR
CUDADIR=/usr/local/cuda

It needs to be both set and exported. By looking at the output of set you're just seeing variables which are set in the shell... the shell will only send exported variables to programs (like make ) that it invokes. You didn't show us how the variable is set in ~/.bashrc but I assume it's something like this:

CUDADIR=/usr/local/cuda

Change that to:

export CUDADIR=/usr/local/cuda

If you want to see what variables are exported the simplest thing to do is use env , not set , like this:

$ env | grep CUDADIR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM