[CMake] Finding dynamic libraries with major interface revision numbers

Jack Poulson jack.poulson at gmail.com
Sun Jan 30 16:04:43 EST 2011


On Sun, Jan 30, 2011 at 2:48 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 30.01.11 13:43:13, Jack Poulson wrote:
> > Hello,
> >
> > I am having a hard time figuring out what the appropriate method is for
> > getting cmake to find a library of the form /usr/lib/libgfortran.so.2.
> > Unfortunately, it is fairly common for /usr/lib/libgfortran.so not to
> exist.
> > I am fairly certain that forming /usr/lib/libgfortran.so as a symbolic
> link
> > would solve the problem, but I obviously cannot assume that the user has
> > administrator privileges.
>
> Actually, noting having the .so or a symlink of that name suggests a
> broken installation. The 'pure' .so file is usually only included in the
> development packages, as its only necessary when building software
> against the shared library. Hence lacking that file, suggests that also
> headers are missing and possibly more things.
>
>
I realize that this is _usually_ the case, but this is typical for gfortran
installations and linking is successful if the .so.2 version is manually
specified. I'm shooting for robustness.


> > The find_library documentation for CMake 2.8 does not seem to specify how
> > NAMES can be used to specify the library extension. The following does
> not
> > find /usr/lib/libgfortran.so.2 when GFORTRAN_LIB_DIR_HINT is set to
> > /usr/lib:
>
> You can't, your gfortran installation is not complete (in terms of
> linking to it), so fix that and then cmake will just fine the .so file.
>
>
Again, it links just fine if the library is manually supplied. I am trying
to make the build as portable as possible and needlessly requiring the user
to have administrative rights does not help.

Jack

--
> You should emulate your heros, but don't carry it too far.  Especially
> if they are dead.
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110130/41e27292/attachment.htm>


More information about the CMake mailing list