The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14870 
====================================================================== 
Reported By:                Melven Roehrig-Zoellner
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14870
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-04-09 16:22 EDT
Last Modified:              2014-04-09 16:22 EDT
====================================================================== 
Summary:                    FindMPI.cmake returns 32-bit libraries on 64-bit
systems for Fortran-only projects
Description: 
Linker errors for pure Fortran projects using MPI because find_package(MPI)
adds a 32-bit library to MPI_Fortran_LIBRARIES.
This occurs with the PGI-Compilers, but could also affect other
compilers/MPI-versions.

This affects at least CMake 2.8.11 and 2.8.12

Steps to Reproduce: 
Minimal CMakeLists-example:

project(test Fortran)
find_package(MPI REQUIRED)
message(STATUS ${MPI_Fortran_LIBRARIES})

For PGI-Fortran-Compilers:
This shows: [...]/usr/lib/librt.so
But must be: [...]/usr/lib64/librt.so
So Linking with MPI_Fortran_LIBRARIES produces linker errors.

In FindMPI.cmake system libraries are searched in /usr/lib and not in
/usr/lib64. One can circumvent this bug through enabling C/C++, but this is not
always an option (I only have a PGI Fortran License)

Additional Information: 
Possible bugfix:
In FindMPI.cmake replace:
        # add the compiler implicit directories because some compilers
        # such as the intel compiler have libraries that show up
        # in the showme list that can only be found in the implicit
        # link directories of the compiler. Do this for C++ and C
        # compilers if the implicit link directories are defined.
        if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES)
          set(MPI_LINK_PATH
            "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}")
        endif ()

        if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
          set(MPI_LINK_PATH
            "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
        endif ()
by the respective language-specific variant:
        # add the compiler implicit directories because some compilers
        # such as the intel compiler have libraries that show up
        # in the showme list that can only be found in the implicit
        # link directories of the compiler.
        if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
          set(MPI_LINK_PATH
            "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
        endif ()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-04-09 16:22 Melven Roehrig-ZoellnerNew Issue                               
    
2014-04-09 16:22 Melven Roehrig-ZoellnerFile Added: FindMPI.cmake               
    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to