Re: [Cppcms-users] cppcms doesn't seem to honor my -DCMAKE_LIBRARY_PATH option to cmake
Brought to you by:
artyom-beilis
|
From: Ross R. <ros...@gm...> - 2013-09-27 00:45:40
|
After racking my brain yesterday, firing off the last post was enough of an
inspiration to solve my own problem... apologies for the noise.
The issue is that my corporate g++ installation is the kitchen-sink install
and the linker knows about many libraries. They take priority over
LD_LIBRARY_PATH when creating a shared library
ldconfig -p | g libgcrypt
libgcrypt.so.11 (libc6,x86-64) => /usr/lib64/libgcrypt.so.11
libgcrypt.so.11 (libc6) => /usr/lib/libgcrypt.so.11
libgcrypt.so (libc6,x86-64) => /usr/lib64/libgcrypt.so
The workaround is to add to the linker command by appending this to my
cmake runline:
-DCMAKE_CXX_LINK_FLAGS='-L /tmp/rbroger1/libgcrypt/lib -L
/tmp/rbroger1/libgpg-error/lib'
- Ross
On Thu, Sep 26, 2013 at 5:26 PM, Ross Rogers <ros...@gm...> wrote:
> I am a newb to both cppcms and cmake. I have to compile with tar-balls,
> because I am in a corporate linux environment.
>
> That said, my "-DCMAKE_LIBRARY_PATH" option doesn't seem to be honored. I
> run cmake from the suggested build directory like:
>
> /usr/intel/pkgs/cmake/2.8.10.2/bin/cmake -DCMAKE_CXX_FLAGS='-fpermissive'
> -DCMAKE_INCLUDE_PATH=/tmp/rbroger1/libgcrypt/include
> -DCMAKE_LIBRARY_PATH=/tmp/rbroger1/libgcrypt/lib:/tmp/rbroger1/libgpg-error/lib
> ..
>
> (The -fpermissive switch is necessary due to using the 4.8.1 version of
> gcc. Also, I'm doing a trial installation in a temporary area.)
>
> cmake goes on its merry way and then I run
>
> make VERBOSE=1
>
> The header files seem to be found locally, because I no longer get
> complaints about missing function signatures, but when it goes to the
> linker it complains about missing symbols:
>
> /nfs/pdx/itools/em64t_SLES10/pkgs/cmake/2.8.10.2/bin/cmake -E
> cmake_link_script CMakeFiles/cache_backend_test.dir/link.txt --verbose=1
> /usr/bin/c++ -fpermissive -Wall -Wextra -O2 -g -DNDEBUG
> CMakeFiles/cache_backend_test.dir/tests/cache_backend_test.cpp.o -o
> cache_backend_test -rdynamic libcppcms.so.1.0.4 booster/libbooster.so.0.0.2
> -lpthread -lpcre -lgcrypt -ldl -lz
> -Wl,-rpath,/tmp/rbroger1/cppcms-1.0.4/build:/tmp/rbroger1/cppcms-1.0.4/build/booster
>
> If I run strace -o log -f make VERBOSE=1 and look at which directories
> are being scanned for libgcrypt.so, it seems to be looking at the corporate
> NFS installation:
>
> 26940
> open("/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/libgcrypt.so",
> O_RDONLY) = 13
>
> If I run the line that it is trying to run with a tweak, then the compile
> works for that one line:
>
> /nfs/pdx/itools/em64t_SLES10/pkgs/cmake/2.8.10.2/bin/cmake -E
> cmake_link_script CMakeFiles/cache_backend_test.dir/link.txt --verbose=1
> /usr/bin/c++ -fpermissive -Wall -Wextra -O2 -g -DNDEBUG
> CMakeFiles/cache_backend_test.dir/tests/cache_backend_test.cpp.o -o
> cache_backend_test -rdynamic libcppcms.so.1.0.4 booster/libbooster.so.0.0.2
> -lpthread -lpcre -lgcrypt -ldl -lz
> -Wl,-rpath,/tmp/rbroger1/cppcms-1.0.4/build:/tmp/rbroger1/cppcms-1.0.4/build/booster -L
> /tmp/rbroger1/libgcrypt/lib
>
>
> How can I get the cppcms build flow to look in my specific library
> directories first?
>
> - Ross
>
>
|