So I had successfully been using cmake and boost in my project. I wanted to start incorporating armadillo (4.400.1)
I use enivronment modules ( http://modules.sourceforge.net/ ) on my system. I built with gcc-4.8.1. CentOS 6.4. I installed OpenBLAS (0.2.10) and armadillo from source and created environment modules.
In the past I only needed to prepend LD_LIBRARY_PATH
with lib directories, but this was not sufficient for armadillo, as I was getting linking errors (unable to find lib) for the following:
g++ example1.cpp -o example1 -O2 -larmadillo
Using the -L
option works:
g++ example1.cpp -o example1 -O2 -larmadillo -L${ARMADILLO_HOME}/lib
I am already placing the armadillo lib directory in LD_LIBRARY_PATH
. How do I set environment variables so the following will link without error?
g++ example1.cpp -o example1 -O2 -larmadillo
I had to place the armadillo lib directory in the environment variable LIBRARY_PATH
not LD_LIBRARY_PATH
Doing this allowed the linking to proceed without error when issuing the command:
g++ example1.cpp -o example1 -O2 -larmadillo
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.