Bug 756141

Summary: findboost.cmake can't find boost::mpi library
Product: [Fedora] Fedora Reporter: tawakiy
Component: cmakeAssignee: Orion Poplawski <orion>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: jreznik, junghans, me, orion, pertusus, rdieter
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: cmake-2.8.12.2-2.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-14 08:12:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
sample code for cmake boost::mpi compile test none

Description tawakiy 2011-11-22 19:50:02 UTC
Created attachment 535149 [details]
sample code for cmake boost::mpi compile test

Description of problem:
FIND_PACKAGE(Boost 1.45.0 COMPONENT mpi REQUIRED) in CMakeLists.txt can't find boost_mpi library.

Version-Release number of selected component (if applicable):
boost 1.47.0
mpich2 1.4.1p1-1 AND openmpi 1.5-4
cmake 2.8.5
Both for i686 and x86_64.

How reproducible:
Everytime `cmake .` for CMakeLists.txt with boost::mpi dependencies.`

Steps to Reproduce:
1. Install cmake, boost and one of the MPI software (can be mpich2, openmpi or other).
2. Install boost-mpich2 or boost-openmpi with dependencies.
3. Try to compile attached code with next CMakeLists.txt:
ADD_EXECUTABLE(mpi-test test.cpp)

FIND_PACKAGE(Boost 1.47.0 COMPONENTS mpi serialization REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(mpi-test ${Boost_LIBRARIES})
4. cmake .
  
Actual results:
Error due to:
    The following Boost libraries could not be found:
        boost_mpi

Expected results:
cmake finds boost_mpi and creates error-free Makefile.

Additional info:
set(BOOST_ROOT "/usr/lib/mpich2/") or, other, for different architecture and MPI software can be a solution. But, it isn't portable, and, looks like, it this (/usr/lib/mpich2/lib or /usr/lib/openmpi/lib) path is standard and correct - FindBoost.cmake from cmake package should find it by itself. Without any user-defined paths.

Comment 1 Orion Poplawski 2011-11-22 22:05:08 UTC
I really don't see how this can be done automatically.  How is it supposed to know you want the openmpi or mpich2 (or other) version?

Comment 2 tawakiy 2011-11-23 07:08:17 UTC
And FindBoost.cmake cooperate with FindMPI.cmake and on that information finds boost::mpi?

Just run FIND_PACKAGE(MPI..) if the component is mpi in the foreach(COMPONENT..) section of FindBoost?

Comment 3 Orion Poplawski 2011-11-23 16:00:06 UTC
FIND_PACKAGE(MPI) isn't really going to help either.

I think you are asking too much of FindBOOST.  If you still think this should be addressed, please take it up on the cmake list of file a bug in the cmake mantis issue tracker.

Comment 4 Christoph Junghans 2014-02-05 02:52:39 UTC
I was hit by this issue (see line 51 of
<https://build.opensuse.org/package/view_file/Education/espressopp/espressopp.spec?expand=1>) and googling
(<https://www.google.com/search?q=fedora+%22boost_mpi%22+cmake>)
revealed that several other projects are affected, too.

If fedora puts libboost_mpi in a non-standard location (/usr/lib{,64}/{openmpi,mpich}/lib), then FindBoost.cmake of the cmake package should be patched accordingly to allow automatic detection by cmake.

Setting BOOST_ROOT doesn't help as the other Boost libraries can then not be detected by cmake anymore. At this point setting Boost_MPI_LIBRARY_RELEASE to something like $MPI_LIB/libboost_mpi-mt.so is the only solution (see <https://github.com/TRIQS/TRIQS/issues/23>)

Comment 5 Orion Poplawski 2014-02-06 19:21:52 UTC
So, how is FindBoost supposed to know *which* mpi flavor you are using?  And Fedora is not going to be carrying a patch to FindBoost to handle it - it's going to need to be addressed upstream.

Comment 6 Christoph Junghans 2014-02-06 20:11:58 UTC
(In reply to Orion Poplawski from comment #5)
> So, how is FindBoost supposed to know *which* mpi flavor you are using?
You have to do "modules load openmpi" or something anyhow to make FindPackage(MPI) works. So FindBoost could use these variables, too.

> And
> Fedora is not going to be carrying a patch to FindBoost to handle it - it's
> going to need to be addressed upstream.
As this is a fedora specific issue, I don't think this is of upstream's matter.

Comment 7 Christoph Junghans 2014-02-06 20:35:04 UTC
http://public.kitware.com/Bug/view.php?id=14739

Comment 8 Christoph Junghans 2014-02-11 15:28:26 UTC
Workaround added by upstream!

Comment 9 Orion Poplawski 2014-02-11 15:48:41 UTC
Christoph - Thanks for taking the initiative to file this upstream.  See, that wasn't so hard :).  They are good folks.

Comment 10 Fedora Update System 2014-02-11 16:37:51 UTC
cmake-2.8.12.2-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/cmake-2.8.12.2-2.fc20

Comment 11 Fedora Update System 2014-02-11 16:38:00 UTC
cmake-2.8.12.2-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/cmake-2.8.12.2-2.fc19

Comment 12 Fedora Update System 2014-02-12 14:35:56 UTC
Package cmake-2.8.12.2-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cmake-2.8.12.2-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2331/cmake-2.8.12.2-2.fc20
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-02-14 08:12:05 UTC
cmake-2.8.12.2-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2014-02-22 00:37:27 UTC
cmake-2.8.12.2-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.