Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] conan-boost: cant install the boost::mpi library #2501

Closed
rasmus98 opened this issue Aug 12, 2020 · 17 comments
Closed

[package] conan-boost: cant install the boost::mpi library #2501

rasmus98 opened this issue Aug 12, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@rasmus98
Copy link

rasmus98 commented Aug 12, 2020

I dont know if this is a bug per say, but it is at least a problem which makes a part of the boost library uninstallable, and is easilly fixable. I would create a pull request if I knew how to, sorry...

When boost is installing, the boost::mpi library along with assosiated components in various other boost libraries are only istalled if the following line is added to the user-config.cam:

using mpi ;

This file is being autogenerated by the conanfile.py, so it is not possible to just add this line manually. An easy fix would be to add the following code on line 748 of the conanfile.py:

        if self.options.custom_userconfig:
            contents += '\n' + self.options.custom_userconfig

And we could thus in our conanfile.txt specify,

[options]
boost::custom_userconfig="using mpi ;"

or similar, I dont quite understand how string literalts work in conan.txt files

@rasmus98 rasmus98 added the bug Something isn't working label Aug 12, 2020
@SSE4
Copy link
Contributor

SSE4 commented Aug 13, 2020

boost MPI requires an actual MPI implementation, such as OpenMPI, Microsoft MPI or Intel MPI. they need to be packaged first.

@rasmus98
Copy link
Author

Yes yes absolutely, in order to compile it! Of cause it would be nice if conan could also handle this part, but for most places where this library would be used (clusters, supercomputers) the system admins have already installed (multiple) MPI implementations. I think most users of boost.mpi would be well aware that this is something they would have to install themselves externally to conan (like the rest of the compiler).

The point is just that without this change, I dont know that i can use conan to install boost at all, since it it just missing this one build flag which i cant add.

@SSE4
Copy link
Contributor

SSE4 commented Aug 13, 2020

what we can do is to add some options to specify mpi implementation, then conan will include that during the generation of user-config.yml.

@oleurodecision
Copy link
Contributor

Hi,

Can't the recipe just rely on the without_mpi recipe option ? Something like

        if not self.options.without_mpi:
            # https://www.boost.org/doc/libs/1_74_0/doc/html/mpi/getting_started.html
            contents += '\nusing mpi ;'

Later, optional settings could also be set up,

using mpi
   : [<MPI compiler wrapper>]
   : [<compilation and link options>]
   : [<mpi runner>] ;

as most (all ?) of these values can be retrieve from the mpi wrapper (using --showme variants, see mpi wrapper manpage for details)

(Note that I'm not an advanced MPI user, only a consumer facing the same problem here)

@SSE4
Copy link
Contributor

SSE4 commented Sep 1, 2020

@oleurodecision something like that could work, yes.
however, that needs an error handling for the following case:

  1. user specifies without_mpi=False, he wants to build with MPI support
  2. there is no valid MPI installation on the machine
  3. boost silently turns MPI off, build successfully, but without MPI libraries
  4. as result users gets package with incorrect package id - it's labeled as built with MPI support, but actually it wasn't

this needs to be tested if there is an error handling to be added to prevent such incorrect builds.
if you can confirm that it's not needed (e.g. you tested it, and boost refuses to build instead off silently turning MPI support off), then I think we're good to go for the first iteration.
feel free to submit PR in such a case.

@oleurodecision
Copy link
Contributor

oleurodecision commented Sep 7, 2020

see #2842

seems there is things to fix in config.yml/conandata.yml KB-H052 (not related to current PR though)

@NashTools
Copy link

@oleurodecision
i added the changes you proposed in #2842 but it still does not work for me. i get ./boost/mpi/config.hpp:20:10: fatal error: mpi.h: No such file or directory during compilation. However, the logs say the MPI Auto-configuration was successful. I have openmpi installed using apt-get in ubuntu.`

@oleurodecision
Copy link
Contributor

oleurodecision commented Dec 19, 2020 via email

@oleurodecision
Copy link
Contributor

oleurodecision commented Dec 19, 2020

Just tested on ubuntu 18.04 server "vanilla" (fresh install in vm), using apt install mpi-default-dev for mpi setup, everything seems ok, see attached files.

boost-1.72.0-default.log
boost-1.72.0-mpi-no_headers.log
boost-1.72.0-mpi.log
conan-boost-packages.txt

@oleurodecision
Copy link
Contributor

Note that #2842 was closed and replaced with #3959 (needed to change branch name 😞 )

@NashTools
Copy link

@oleurodecision first of all thank you for your reply
i checked out #3959 and simply executed conan create . boost/1.72.0@ -o boost:without_mpi=False in the folder /conan-center-index/recipes/boost/all
here are the logs
output.txt
on line 15450 and subsequent logs you can see mpi.h was not found
Im using gcc-10 though. Any hint is very much appreciated.

@oleurodecision
Copy link
Contributor

Can you indicate which ubuntu version you are using please ?
I'll try to test tonight, else we'll need to wait a few days (first holidays for months 🎉)

@NashTools
Copy link

im using ubuntu 20.10 groovy gorilla

@oleurodecision
Copy link
Contributor

Tested with success :

  • on ubuntu 10.04
    • using gcc-7
  • on ubuntu 20.04
    • using gcc-9
    • using gcc-10
  • on ubuntu 20.10
    • using gcc-10

let's check that more precisely in a few days ;)

@NashTools
Copy link

i finally got it running. The issue was on my side, somehow openmpi was not installed correctly. To all who has the same problem look up here https://stackoverflow.com/questions/60982859/why-openmpi-package-from-apt-is-incomplete?noredirect=1&lq=1

Again thank you @oleurodecision for your support

@oleurodecision
Copy link
Contributor

you're welcome (btw, url markdown seems wrong)

@perseoGI
Copy link
Contributor

perseoGI commented Sep 3, 2024

Hi there!
I'm closing this issue as it seems to be already addressed.
If problem persists, do not hesitate to reopen this issue or create a new ticket.
Happy coding 🐸

@perseoGI perseoGI closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants