[CMake] ctest puts LD_LIBRARY_PATH into environment impacts sub-runs of cmake/ctest

Wheeler, Frederick W (GE, Research) wheeler at crd.ge.com
Mon Sep 8 13:39:52 EDT 2008


CMake List:

I have a ctest/cmake issue where LD_LIBRARY_PATH must be set to run
test execs produced by ctest but that LD_LIBRARY_PATH setting causes
ctest/cmake to not run due to a library mismatch.  Does anyone have a
solution or any advice?  Details below.

After a recent upgrade to FreeBSD 7.0, using cmake/ctest compiled from
the FreeBSD /usr/ports using the system gcc (4.2.1), but using a
non-system gcc installed in /home/wheeler/dev/gcc-4.0.4 as the
compiler for the VXL project being built by cmake/ctest, I'm getting
errors like this when I run ctest:

/libexec/ld-elf.so.1: /home/wheeler/dev/gcc-4.0.4/lib/libstdc++.so.6:
version GLIBCXX_3.4.9 required by cmake not found
/libexec/ld-elf.so.1: /home/wheeler/dev/gcc-4.0.4/lib/libstdc++.so.6:
version GLIBCXX_3.4.9 required by ctest not found
Unable to run cmake:
/libexec/ld-elf.so.1: /home/wheeler/dev/gcc-4.0.4/lib/libstdc++.so.6:
version GLIBCXX_3.4.9 required by cmake not found

The file /home/wheeler/dev/gcc-4.0.4/lib/libstdc++.so.6 is present,
but apparently it is not version GLIBCXX_3.4.9.

In my ctest config file I use CTEST_ENVIRONMENT to set LD_LIBRARY_PATH
like you see below because that LD_LIBRARY_PATH setting is needed to
run test executables created by the ctest run.  LD_LIBRARY_PATH is not
set in the environment when ctest is run initially.

SET(CTEST_ENVIRONMENT
  "LD_LIBRARY_PATH=/home/wheeler/dev/gcc-4.0.4/lib"
  "CVS_RSH=ssh"
  "http_proxy=proxy.research.ge.com:8080"
  "FTP_PROXY=proxy.research.ge.com:8080"
)

The problem seems to be that this LD_LIBRARY_PATH setting is in the
environment when ctest runs cmake and ctest (ctest running itself I
guess), and this causes those programs to not run.  I think a solution
might be for ctest to put the contents of CTEST_ENVIRONMENT into the
environment when running 'make' or one of the tests, but not when it
is running cmake or ctest.  This, however sounds like a difficult fix.


System information:
% uname -a
FreeBSD green.local.domain 7.0-RELEASE-p3 FreeBSD 7.0-RELEASE-p3 #0: Tue
Sep  2 19:29:24 EDT 2008
wheeler at green.local.domain:/usr/obj/usr/src/sys/GENERIC  i386
% cmake --version
cmake version 2.6-patch 1
% gcc --version
gcc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
% /home/wheeler/dev/gcc-4.0.4/bin/gcc --version
gcc (GCC) 4.0.4
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
% echo $LD_LIBRARY_PATH

% 

(You can see above that LD_LIBRARY_PATH is *not* set in the environment
of the shell used to run ctest.)

Thanks,
Fred Wheeler


More information about the CMake mailing list