Re: [CMake] Should CMake use /etc/ld.so.conf.d for find_library's CMAKE_SYSTEM_LIBRARY_PATH?
On Thu, Jan 20, 2011 at 10:47 AM, Rolf Eike Beer wrote: > > On Thursday 20 January 2011, James Bigler wrote: > > > I'm noticing that on some systems they package the NVIDIA driver into > > > different directories than the driver is typically installed. In > > > order to make stuff link properly at run time these non-standard > > > locations are added to /etc/ld.so.conf.d. I'm wondering if there is a > > > reason not to use this information to add paths to > > > CMAKE_SYSTEM_LIBRARY_PATH? It would certainly help in finding > > > libraries that are installed in diverse places. > > > > Sounds like a useful idea IMO. > > It could be done in UnixPaths.cmake, if /etc/ld.so.conf exists, parse > > it, get the directories from it, check for duplicates, and add them to > > the search paths. > > Sounds indeed sane. But be aware that this file may contain include > directives with glob expressions, usually something like > /etc/ld.so.conf.d/*.conf. If you don't follow them you will hardly find > anything on modern distros. > > Eike > > Yeah, the one I'm looking at looks like this: $ cat ld.so.conf include /etc/ld.so.conf.d/*.conf /usr/local/lib $ for T in ld.so.conf.d/*;do echo $T; cat $T;done ld.so.conf.d/R-i386.conf /usr/lib/R/lib ld.so.conf.d/atlas-i386.conf /usr/lib/atlas ld.so.conf.d/cuda-%{arch}.conf /usr/lib/cuda ld.so.conf.d/kernel-2.6.35.10-69.fc14.i686.PAE.conf # Placeholder file, no vDSO hwcap entries used in this kernel. ld.so.conf.d/kernel-2.6.35.10-72.fc14.i686.PAE.conf # Placeholder file, no vDSO hwcap entries used in this kernel. ld.so.conf.d/kernel-2.6.35.10-74.fc14.i686.PAE.conf # Placeholder file, no vDSO hwcap entries used in this kernel. ld.so.conf.d/mysql-i386.conf /usr/lib/mysql ld.so.conf.d/nvidia-lib.conf /usr/lib/nvidia ld.so.conf.d/octave-i386.conf /usr/lib/octave-3.3.54 ld.so.conf.d/qt-i386.conf /usr/lib/qt-3.3/lib ld.so.conf.d/tix-i386.conf /usr/lib/tcl8.5 ld.so.conf.d/wine-32.conf /usr/lib/wine/ ld.so.conf.d/xulrunner-32.conf /usr/lib/xulrunner-1.9.2 ld.so.conf.d/xulrunner2-32.conf /usr/lib/xulrunner-2 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Should CMake use /etc/ld.so.conf.d for find_library's CMAKE_SYSTEM_LIBRARY_PATH?
> On Thursday 20 January 2011, James Bigler wrote: > > I'm noticing that on some systems they package the NVIDIA driver into > > different directories than the driver is typically installed. In > > order to make stuff link properly at run time these non-standard > > locations are added to /etc/ld.so.conf.d. I'm wondering if there is a > > reason not to use this information to add paths to > > CMAKE_SYSTEM_LIBRARY_PATH? It would certainly help in finding > > libraries that are installed in diverse places. > > Sounds like a useful idea IMO. > It could be done in UnixPaths.cmake, if /etc/ld.so.conf exists, parse > it, get the directories from it, check for duplicates, and add them to > the search paths. Sounds indeed sane. But be aware that this file may contain include directives with glob expressions, usually something like /etc/ld.so.conf.d/*.conf. If you don't follow them you will hardly find anything on modern distros. Eike ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Should CMake use /etc/ld.so.conf.d for find_library's CMAKE_SYSTEM_LIBRARY_PATH?
On Thursday 20 January 2011, James Bigler wrote: > I'm noticing that on some systems they package the NVIDIA driver into > different directories than the driver is typically installed. In order to > make stuff link properly at run time these non-standard locations are added > to /etc/ld.so.conf.d. I'm wondering if there is a reason not to use this > information to add paths to CMAKE_SYSTEM_LIBRARY_PATH? It would certainly > help in finding libraries that are installed in diverse places. Sounds like a useful idea IMO. It could be done in UnixPaths.cmake, if /etc/ld.so.conf exists, parse it, get the directories from it, check for duplicates, and add them to the search paths. Do you think it should be only added to the library search path or should the "/lib" at the end of each directory be removed and the remainder be added to the general search prefixes ? Otherwise it might now find the libs, but maybe not the corresponding headers. Alex ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Should CMake use /etc/ld.so.conf.d for find_library's CMAKE_SYSTEM_LIBRARY_PATH?
I'm noticing that on some systems they package the NVIDIA driver into different directories than the driver is typically installed. In order to make stuff link properly at run time these non-standard locations are added to /etc/ld.so.conf.d. I'm wondering if there is a reason not to use this information to add paths to CMAKE_SYSTEM_LIBRARY_PATH? It would certainly help in finding libraries that are installed in diverse places. James ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake