[Trilinos-Users] 10.0 CMake problem

Perschbacher, Brent M bmpersc at sandia.gov
Mon Oct 5 13:51:51 MDT 2009


This is an issue that one of our internal developers has reported as well. However, in their case they are mixing versions of gcc (gcc/g++ 4.2 and gfortran 4.3) between the gfortran and g++ compiler. I have just put in an option to skip that check for now. However, that won't be available to external customers until a minor release. FWIW I am not seeing this issue at all on my mac. I am using gcc 4.3.3(gcc, g++ and gfortran) and openmpi 1.3.2.

Jack,
  Could you please let us know which version of gcc you are using for each compiler. If you are using mpi wrappers you can get the path to the gcc version with "<mpiwrapper> --show" typically.

I would like to see if the differing version are the issue. It is definitely dangerous to be mixing versions as GCC makes no guarantees that they won't break the ABI between versions.

In the interim there are a couple things that you can try so that you can compile. The first and safest would be to disable fortran by putting
"-D Trilinos_ENABLE_Fortran:BOOL=OFF" into your configure script. This will disable anything that relies on fortran, but will also skip the verify_cxx test. If you need fortran on I can tell you how to hack the cmake files to skip this test. However, doing this is disabling a check that is there to make sure that mixed language executables can be linked, so you will probably have other issues linking tests, etc. later on.

In the file "<Trilinos_dir>/cmake/TrilinosFortranMangling.cmake" starting on line 9 you will find where this verify_cxx check is done. If you comment out lines that read:

  IF("${CMAKE_VERSION}" VERSION_GREATER 2.7.20090824)
    INCLUDE(FortranCInterface)
    FortranCInterface_VERIFY(CXX)
  ENDIF()

Which should be lines 9-12 you will disable this test. I caution against this, but by doing this I was able to configure, build and link most everything on the machine where we were seeing this. However, the changes I made along with that fix also had another fix that was necessary to link one of the zoltan test drivers so I wouldn't expect everything to work. But at least the majority of the code, which is c++, should build and link just fine for you.

Please let us know how this turns out for you.

Brent


On 10/5/09 7:41 AM, "Brad King" <brad.king at kitware.com> wrote:

Jack Chessa wrote:
> I am having some problems building 10.0 on an intel mac with OSX 10.5.7
>
> I am getting the linking problems
[snip]
> I think I need to add
> -lgfortran to the linking flags, but I am having a hard time finding
> where this is in CMake?

CMake is supposed to automatically add this library.  In fact the whole
purpose of the VerifyFortranC configuration check is to report failure
early if there is a problem using C++ and Fortran together.

Was this a fresh build tree?

Look for a line like

  SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "...;gfortran;...")

in CMakeFiles/CMakeFortranCompiler.cmake in the build tree.  Does any
such line appear?

-Brad

_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
http://software.sandia.gov/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20091005/4246e5b4/attachment.html 


More information about the Trilinos-Users mailing list