[英]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: 我目前正在尝试安装MAGMA ,但是尝试运行“ sudo make install”会给我错误:
$ 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. 我肯定知道CUDADIR已设置,并且已在〜/ .bash_profile中设置,因此我不确定为什么它会失败。 Is there any reason why it might not being finding it?
有什么理由可能找不到它? It seemed to work fine when I ran "make".
当我运行“ 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. 通过查看
set
的输出,您只会看到在shell中设置的变量... shell只会将导出的变量发送到它调用的程序(例如make
)。 You didn't show us how the variable is set in ~/.bashrc
but I assume it's something like this: 您没有向我们展示如何在
~/.bashrc
设置变量,但是我认为它是这样的:
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
,而不是set
,如下所示:
$ env | grep CUDADIR
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.