[CMake] Version 2.8 affects exception handling?

Brad King brad.king at kitware.com
Mon Nov 30 09:51:02 EST 2009


Bill Hoffman wrote:
> Bill Spotz wrote:
>>> when the epetra dynamic library gets linked under the new cmake and
>>> not the old.  This could be problematic because it is using the
>>> compiler /usr/bin/c++, which on my system is version 4.0.1 (although
>>> the gfortran compiler is version 4.4.1).
>>
>> So I have been able to confirm that it is these fortran-related link
>> options that are causing my problem.  I'm not exactly sure what to
>> make of the fact that it links and runs properly without them, but
>> links and runs improperly with them.
> 
> I think we sort of decided that mixing versions of gcc tools does work
> reliably.

Bill H. meant "mixing versions of gcc tools does NOT work reliably".

The flags

    -L/sw/lib/gcc4.4/lib/gcc/i686-apple-darwin9/4.4.1
    -L/sw/lib/gcc4.4/lib
    -lgfortranbegin
    -lgfortran

have been detected as something gfortran implicitly uses to link.
Since the project contains both C++ and Fortran code, it uses the
C++ linker and passes the implicit Fortran flags explicitly.  The
problem with mixed versions is that the .../4.4.1 path probably
contains its own libstdc++, so when the C++ compiler from 4.0.1
implicitly links to that library it finds the wrong version because
the explicit search path comes first.

-Brad


More information about the CMake mailing list