我试图在unix集群中安装一个C ++库( armadillo ),我没有root权限。
我通过运行以下make命令设法编译没有用户权限的C ++库:
make install DESTDIR=my_usr_dir但是在犰狳自述文件中它说:
其中“my_usr_dir”用于存储C ++标头和库文件。 确保将C ++编译器配置为使用此目录中的子目录。
犰狳用来安装库的编译器是gcc-4.8.1。 我不确定编译器的安装位置,但是当我在unix集群中启动会话时它已加载。
安装armadillo之后,我正在尝试编译使用armadillo库的开源代码。 这个开源代码也有一个makefile。
但是,当我转到开源代码并输入时:
make它叫g ++。 如何确保g ++能够识别以前安装在my_usr_dir中的armadillo库?
目前,如果我转到src然后输入make,我会收到以下错误:
opencode.cpp:28:21: fatal error: armadillo: No such file or directory #include <armadillo> ^ compilation terminated. make: *** [mmcollapse] Error 1I am trying to install a C++ library (armadillo) in a unix cluster where I do not have root permissions.
I managed to compile the C++ libraries without user permissions by running the following make command:
make install DESTDIR=my_usr_dirBut then in the armadillo readme file it says:
where "my_usr_dir" is for storing C++ headers and library files. Make sure your C++ compiler is configured to use the sub-directories present within this directory.
The compiler the armadillo uses to install the libraries is gcc-4.8.1. I am not sure where the compiler was installed but it's loaded when I start my session in the unix cluster.
After installing armadillo I am trying to compile open source code that uses the armadillo libraries. This open source code also has a makefile.
However, when I go to the open source code and I type in:
makeit calls g++. How can I make sure g++ will recognize the armadillo libraries previously installed in my_usr_dir?
Currently I get the following error if I go to src and then type make:
opencode.cpp:28:21: fatal error: armadillo: No such file or directory #include <armadillo> ^ compilation terminated. make: *** [mmcollapse] Error 1最满意答案
您可以使用
alias gcc="gcc -I./my_usr_dir/include -L./my_usr_dir/lib"等等.bashrc文件中。 这样,无论何时在命令行上调用gcc,都会在命令行中输入的每个其他参数之前添加标志。
you can use
alias gcc="gcc -I./my_usr_dir/include -L./my_usr_dir/lib"and so on in your .bashrc file. In that way, whenever you invoke gcc on the command line, the flags will be added before every other argument you enter on the command line
更多推荐
发布评论