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

Having ode conditionally depend on Boost::MPI (or allow standalone for cmake) #82

Closed
SteveBronder opened this issue Jun 13, 2024 · 3 comments · Fixed by #83
Closed

Having ode conditionally depend on Boost::MPI (or allow standalone for cmake) #82

SteveBronder opened this issue Jun 13, 2024 · 3 comments · Fixed by #83

Comments

@SteveBronder
Copy link

odeint's cmake currently requires Boost::mpi (see here) and I think a few other boost libraries that much be prebuilt before hand. I think mpi can be kind of a big requirement for a lot of users. It's possible for odeint to be included as a header only library if it is in standalone mode.

Could you add a cmake flag to specify whether the other boost libraries should be included as dependencies? Something like

if (not BOOST_NUMERIC_ODEINT_STANDALONE)
  target_link_libraries(boost_numeric_odeint ...)
else()
  target_compile_definitions(boost_numeric_odeint BOOST_NUMERIC_ODEINT_STANDALONE)
endif()
@mborland
Copy link
Member

It wouldn't be truly standalone because the library has a ton of internal boost dependencies. Would removing all the adapters from boost/odeint/external/ be sufficient for a standalone mode? Maybe BOOST_NUMERIC_ODEINT_NO_ADAPTORS? See current rationale in: #64

@SteveBronder
Copy link
Author

SteveBronder commented Jun 18, 2024

I think BOOST_NUMERIC_ODEINT_NO_ADAPTORS would make sense as a compile flag.

From reading those comments it looks like odeint would have to be careful that boostdep does not re-add the Boost::mpi dependency. @pdimov is there a way to tell boostdep "This file was modified by hand do not overwrite it"? Otherwise it will take a lot of extra care each release.

For background, I'm moving Stan Math over to use cmake and I'd like to use boosts cmake scheme. We currently use odeint as a header only library from the release version of boost, which is fine and does not depend on the user having mpi. But using the cmake scheme does require mpi which is not super fun. I also fear many of our users just won't have that installed. Boost::Compute is also probably an issue.

I think just excluding the adaptors (and their dependencies)** would fix this though. Another fix would be to allow users to specify which adaptors they want and then make them in charge of including the dependencies for those

**EDIT

@pdimov
Copy link
Member

pdimov commented Jun 18, 2024

boostdep never overwrites anything, it just writes to stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants