View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012874CMakeModulespublic2012-01-15 14:432012-09-03 16:01
ReporterMourad 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version
Product VersionCMake 2.8.7 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0012874: Bug in FindMPI.cmake under Windows
DescriptionI get a link problem when linking to MPI libraries found by FindMPI.cmake. The error I get is :

LINK : fatal error LNK1104: cannot open file 'C:\Program Files\MPICH2\lib\mpi.lib C:\Program Files\MPICH2\lib\cxx.lib'

The problem is caused by line 416 of FindMPI.cmake, a "patch" is also given below.

Line 416 :

- set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}")
+ set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK};${MPI_LIB}")
Steps To ReproduceJust try to build this empty main.cpp with the provided CMakeLists.txt

CMakeLists.txt :

cmake_minimum_required(VERSION 2.8)
project(test_mpi)
find_package(MPI)
add_executable(test_mpi main.cpp)
target_link_libraries(test_mpi ${MPI_LIBRARIES})

main.cpp :

int main()
{
  return 0;
}
Additional InformationMPI installed from http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0028316)
Brad King (manager)
2012-01-16 09:06

Does this patch work?

-          set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}")
+          list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
(0028318)
Mourad (reporter)
2012-01-16 09:23

it works, too.
(0028319)
Brad King (manager)
2012-01-16 09:28

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87737e62 [^]
(0030874)
David Cole (manager)
2012-09-03 16:01

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-01-15 14:43 Mourad New Issue
2012-01-16 09:06 Brad King Note Added: 0028316
2012-01-16 09:06 Brad King Assigned To => Brad King
2012-01-16 09:06 Brad King Status new => assigned
2012-01-16 09:23 Mourad Note Added: 0028318
2012-01-16 09:28 Brad King Note Added: 0028319
2012-01-16 09:28 Brad King Status assigned => resolved
2012-01-16 09:28 Brad King Fixed in Version => CMake 2.8.8
2012-01-16 09:28 Brad King Resolution open => fixed
2012-04-19 15:44 David Cole Target Version => CMake 2.8.8
2012-09-03 16:01 David Cole Note Added: 0030874
2012-09-03 16:01 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team