[CMake] Finding dynamic libraries with major interface revision numbers (2)

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Wed Apr 13 15:37:26 EDT 2011


On Wed, Apr 13, 2011 at 3:26 PM, Brad King <brad.king at kitware.com> wrote:

> On 04/13/2011 02:44 PM, Jean-Christophe Fillion-Robin wrote:
> > Is there a solution to find a library having a revision number ?
>
> You can specify the actual library file name "libgfortran.so.3".
>
Great

>
> However, you shouldn't need to find implicit compiler runtime libraries.
> Are you trying to mix C++ and Fortran?
>

More details ...

1) I have a project XYZ that linked against VTK static which also linked
GnuR shared

2) Using the faster Gold linker  (/usr/bin/ld -> /usr/bin/ld.gold)

3) If building against VTK-shared there is no issue, if building against
VTK-static,

tThe following undefined symbol errors arise:

/usr/bin/ld: /home/jchris/Projects/R-2.11.1/lib64/R/lib/libRlapack.so:
error: undefined reference to '_gfortran_concat_string'
/usr/bin/ld: /home/jchris/Projects/R-2.11.1/lib64/R/lib/libRlapack.so:
error: undefined reference to '_gfortran_pow_i4_i4'
/usr/bin/ld: /home/jchris/Projects/R-2.11.1/lib64/R/lib/libRlapack.so:
error: undefined reference to '_gfortran_compare_string'


>
> > Within cmake, is there a possibility to retrieve the lib directories
> > associated with the current compiler ?
>
> CMake 2.8.x already does this.  Look in the CMakeFiles/CMake*Compiler.cmake
> files in your build tree.  However, these variables are generally meant
> for internal use by the link line computation code.
>
Good to know


> If a binary contains sources from both C++ and Fortran CMake already knows
> how to link it with C++ and pass the Fortran runtime libraries on the link
> line.
>
> -Brad
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110413/cb98c9a3/attachment.htm>


More information about the CMake mailing list