Re: [CMake] Cmake appears to substitute -llibrary when a full path is given.

2013-09-25 Thread Andreas Naumann

Hi Seth,
I had the same problem some time ago. In my case, the environment 
variable LIBRARY_PATH contained the boost directory, which instructs the 
linker to use it as standard library directory.
CMake asks the compiler for implicit linking directories. I am not 
completly sure, but the directories should be documented in some 
CMakeFiles/*Output* file.


I hope, that helps a little.
Andreas

On 23.09.2013 10:01, S'orlok Reaves wrote:

Good afternoon all,


This is my first post to this list, so please redirect me if I'm in the wrong 
place. So far cmake has been great, but I've run into an issue that I am having 
trouble understanding.

I'm searching for the Boost libs on a server that has two different versions 
installed. One is in my home directory; the other is a system-wide install 
(which is older).

In my CMakeLists.txt:

set(Boost_NO_SYSTEM_PATHS ON)
set(BOOST_ROOT "/home/me/opt")
find_package(Boost COMPONENTS system REQUIRED)
MESSAGE("${Boost_LIBRARIES}")
#later:
target_link_libraries (My_Program ${Boost_LIBRARIES})


This prints out the following, so I know the correct library is indeed found:
/home/me/opt/lib/libboost_system.so


Now, I "make" the project, and everything compiles, but fails to link, 
specifying several missing symbols in boost::system. The linker command includes the 
following:
#g++ etc., then:
-o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so -lboost_system 
-Wl,-rpath,/usr/local/lib64


If I change it to the following, it compiles, links, and runs fine:
-o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so 
/home/me/opt/lib/libboost_system.so -Wl,-rpath,/usr/local/lib64

Clearly the "-lboost_system" flag is catching the old libraries. From reading the cmake 
docs, I was under the impression that the full path (/home/me/opt/lib/libboost_system.so) would 
only be truncated to an "-lboost_system" if it was on the implicit path (e.g., /usr/lib). 
In that case, I have two questions:

1) Why is boost_system not being included via its complete path? Is this a bug, 
or am I doing something wrong?
2) Why is soci_core being included by the full path. Is it because "/usr/local" 
is not on the implicit path?

The second question is just out of curiosity; it is the first question that is 
causing me a lot of grief right now. Any suggestions?

The server I'm compiling on is running Debian Squeeze (6.0.7), with a 
locally-installed version of cmake (2.8.11.2).

Thanks,
Seth

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake appears to substitute -llibrary when a full path is given.

2013-09-23 Thread S'orlok Reaves


Just confirming that moving the library to a different path (e.g., 
/home/me/opt/local/lib/libboost_system.so) solves the problem, so 
LD_LIBRARY_PATH was definitely causing the "-l" path to be used. Thanks again; 
everything works now.

Seth




- Original Message -
From: S'orlok Reaves 
To: "a.neundorf-w...@gmx.net" ; "cmake@cmake.org" 

Cc: 
Sent: Tuesday, September 24, 2013 10:54 AM
Subject: Re: [CMake] Cmake appears to substitute -llibrary when a full path 
is given.



Ah, thanks, it's probably LD_LIBRARY_PATH. I'll install boost into a different 
path and try again.

Seth




- Original Message -
From: Alexander Neundorf 
To: cmake@cmake.org; S'orlok Reaves 
Cc: 
Sent: Tuesday, September 24, 2013 4:12 AM
Subject: Re: [CMake] Cmake appears to substitute -llibrary when a full path is 
given.

On Monday 23 September 2013, S'orlok Reaves wrote:
> Good afternoon all,
> 
> 
> This is my first post to this list, so please redirect me if I'm in the
> wrong place. So far cmake has been great, but I've run into an issue that
> I am having trouble understanding.
> 
> I'm searching for the Boost libs on a server that has two different
> versions installed. One is in my home directory; the other is a
> system-wide install (which is older). 
> 
> In my CMakeLists.txt:
> 
> set(Boost_NO_SYSTEM_PATHS ON)
> set(BOOST_ROOT "/home/me/opt")
> find_package(Boost COMPONENTS system REQUIRED)
> MESSAGE("${Boost_LIBRARIES}")
> #later:
> target_link_libraries (My_Program ${Boost_LIBRARIES})
> 
> 
> This prints out the following, so I know the correct library is indeed
> found: /home/me/opt/lib/libboost_system.so
> 
> 
> Now, I "make" the project, and everything compiles, but fails to link,
> specifying several missing symbols in boost::system. The linker command
> includes the following: #g++ etc., then:
> -o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so -lboost_system
> -Wl,-rpath,/usr/local/lib64
> 
> 
> If I change it to the following, it compiles, links, and runs fine:
> -o ../My_Program -rdynamic
> /usr/local/lib64/libsoci_core.so /home/me/opt/lib/libboost_system.so -Wl,-
> rpath,/usr/local/lib64
> 
> Clearly the "-lboost_system" flag is catching the old libraries. From
> reading the cmake docs, I was under the impression that the full path
> (/home/me/opt/lib/libboost_system.so) would only be truncated to an
> "-lboost_system" if it was on the implicit path (e.g., /usr/lib). In that
> case, I have two questions:
> 
> 1) Why is boost_system not being included via its complete path? Is this a
> bug, or am I doing something wrong? 

There is some environment variable involved, LIBDIR or LIBRARY_PATH or 
something like that, I don't remember exactly right now. grep your env for 
"LIB".
If the path to the library is contained in this environment variable, the full 
path is not used, but instead -l is used.

Alex

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake appears to substitute -llibrary when a full path is given.

2013-09-23 Thread S'orlok Reaves


Ah, thanks, it's probably LD_LIBRARY_PATH. I'll install boost into a different 
path and try again.

Seth




- Original Message -
From: Alexander Neundorf 
To: cmake@cmake.org; S'orlok Reaves 
Cc: 
Sent: Tuesday, September 24, 2013 4:12 AM
Subject: Re: [CMake] Cmake appears to substitute -llibrary when a full path is 
given.

On Monday 23 September 2013, S'orlok Reaves wrote:
> Good afternoon all,
> 
> 
> This is my first post to this list, so please redirect me if I'm in the
> wrong place. So far cmake has been great, but I've run into an issue that
> I am having trouble understanding.
> 
> I'm searching for the Boost libs on a server that has two different
> versions installed. One is in my home directory; the other is a
> system-wide install (which is older). 
> 
> In my CMakeLists.txt:
> 
> set(Boost_NO_SYSTEM_PATHS ON)
> set(BOOST_ROOT "/home/me/opt")
> find_package(Boost COMPONENTS system REQUIRED)
> MESSAGE("${Boost_LIBRARIES}")
> #later:
> target_link_libraries (My_Program ${Boost_LIBRARIES})
> 
> 
> This prints out the following, so I know the correct library is indeed
> found: /home/me/opt/lib/libboost_system.so
> 
> 
> Now, I "make" the project, and everything compiles, but fails to link,
> specifying several missing symbols in boost::system. The linker command
> includes the following: #g++ etc., then:
> -o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so -lboost_system
> -Wl,-rpath,/usr/local/lib64
> 
> 
> If I change it to the following, it compiles, links, and runs fine:
> -o ../My_Program -rdynamic
> /usr/local/lib64/libsoci_core.so /home/me/opt/lib/libboost_system.so -Wl,-
> rpath,/usr/local/lib64
> 
> Clearly the "-lboost_system" flag is catching the old libraries. From
> reading the cmake docs, I was under the impression that the full path
> (/home/me/opt/lib/libboost_system.so) would only be truncated to an
> "-lboost_system" if it was on the implicit path (e.g., /usr/lib). In that
> case, I have two questions:
> 
> 1) Why is boost_system not being included via its complete path? Is this a
> bug, or am I doing something wrong? 

There is some environment variable involved, LIBDIR or LIBRARY_PATH or 
something like that, I don't remember exactly right now. grep your env for 
"LIB".
If the path to the library is contained in this environment variable, the full 
path is not used, but instead -l is used.

Alex

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake appears to substitute -llibrary when a full path is given.

2013-09-23 Thread Alexander Neundorf
On Monday 23 September 2013, S'orlok Reaves wrote:
> Good afternoon all,
> 
> 
> This is my first post to this list, so please redirect me if I'm in the
> wrong place. So far cmake has been great, but I've run into an issue that
> I am having trouble understanding.
> 
> I'm searching for the Boost libs on a server that has two different
> versions installed. One is in my home directory; the other is a
> system-wide install (which is older). 
> 
> In my CMakeLists.txt:
> 
> set(Boost_NO_SYSTEM_PATHS ON)
> set(BOOST_ROOT "/home/me/opt")
> find_package(Boost COMPONENTS system REQUIRED)
> MESSAGE("${Boost_LIBRARIES}")
> #later:
> target_link_libraries (My_Program ${Boost_LIBRARIES})
> 
> 
> This prints out the following, so I know the correct library is indeed
> found: /home/me/opt/lib/libboost_system.so
> 
> 
> Now, I "make" the project, and everything compiles, but fails to link,
> specifying several missing symbols in boost::system. The linker command
> includes the following: #g++ etc., then:
> -o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so -lboost_system
> -Wl,-rpath,/usr/local/lib64
> 
> 
> If I change it to the following, it compiles, links, and runs fine:
> -o ../My_Program -rdynamic
> /usr/local/lib64/libsoci_core.so /home/me/opt/lib/libboost_system.so -Wl,-
> rpath,/usr/local/lib64
> 
> Clearly the "-lboost_system" flag is catching the old libraries. From
> reading the cmake docs, I was under the impression that the full path
> (/home/me/opt/lib/libboost_system.so) would only be truncated to an
> "-lboost_system" if it was on the implicit path (e.g., /usr/lib). In that
> case, I have two questions:
> 
> 1) Why is boost_system not being included via its complete path? Is this a
> bug, or am I doing something wrong? 

There is some environment variable involved, LIBDIR or LIBRARY_PATH or 
something like that, I don't remember exactly right now. grep your env for 
"LIB".
If the path to the library is contained in this environment variable, the full 
path is not used, but instead -l is used.

Alex
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cmake appears to substitute -llibrary when a full path is given.

2013-09-23 Thread S'orlok Reaves
Good afternoon all,


This is my first post to this list, so please redirect me if I'm in the wrong 
place. So far cmake has been great, but I've run into an issue that I am having 
trouble understanding.

I'm searching for the Boost libs on a server that has two different versions 
installed. One is in my home directory; the other is a system-wide install 
(which is older). 

In my CMakeLists.txt:

set(Boost_NO_SYSTEM_PATHS ON)
set(BOOST_ROOT "/home/me/opt")
find_package(Boost COMPONENTS system REQUIRED)
MESSAGE("${Boost_LIBRARIES}")
#later:
target_link_libraries (My_Program ${Boost_LIBRARIES})


This prints out the following, so I know the correct library is indeed found:
/home/me/opt/lib/libboost_system.so


Now, I "make" the project, and everything compiles, but fails to link, 
specifying several missing symbols in boost::system. The linker command 
includes the following:
#g++ etc., then:
-o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so -lboost_system 
-Wl,-rpath,/usr/local/lib64


If I change it to the following, it compiles, links, and runs fine:
-o ../My_Program -rdynamic /usr/local/lib64/libsoci_core.so 
/home/me/opt/lib/libboost_system.so -Wl,-rpath,/usr/local/lib64

Clearly the "-lboost_system" flag is catching the old libraries. From reading 
the cmake docs, I was under the impression that the full path 
(/home/me/opt/lib/libboost_system.so) would only be truncated to an 
"-lboost_system" if it was on the implicit path (e.g., /usr/lib). In that case, 
I have two questions:

1) Why is boost_system not being included via its complete path? Is this a bug, 
or am I doing something wrong?
2) Why is soci_core being included by the full path. Is it because "/usr/local" 
is not on the implicit path? 

The second question is just out of curiosity; it is the first question that is 
causing me a lot of grief right now. Any suggestions?

The server I'm compiling on is running Debian Squeeze (6.0.7), with a 
locally-installed version of cmake (2.8.11.2).

Thanks,
Seth

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake