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

Issues with building Boost.Math into a standard library implementation #1186

Open
frederick-vs-ja opened this issue Aug 24, 2024 · 1 comment

Comments

@frederick-vs-ja
Copy link

frederick-vs-ja commented Aug 24, 2024

Currently MSVC STL builds Boost.Math into its static library, which cause the static library contains non-_Uglified linking symbols and causes non-conforming linking behavior. See microsoft/STL#362.

I'm trying to resolve this in Boost.Math by adding the BOOST_MATH_NAMESPACE macro

#ifndef BOOST_MATH_NAMESPACE
#define BOOST_MATH_NAMESPACE math
#endif

and then replace every occurrence of math which is a namespace with BOOST_MATH_NAMESPACE.

With the changes above, MSVC STL's special_math.cpp can define BOOST_MATH_NAMESPACE as _Math (or some other _Uglified identifier, e.g. __math__) before including <boost/math/*> and then use ::boost::BOOST_MATH_NAMESPACE::* to get rid of non-_Uglified symbols.

But the changes need to touch 500+ files in Boost.Math and make maintenance a bit harder (every namespace math should be spelt as BOOST_MATH_NAMESPACE later). Not sure whether this approach is OK.

@ckormanyos
Copy link
Member

ckormanyos commented Aug 24, 2024

Hi @frederick-vs-ja this issue is also being tracked in #769. None of us has actually gotten around to progressing on it so far.

need to touch 500+

I believe we are generally aware of this and still consider the request to be reasonable.

I think we just need to discuss:

  • Is this actually is the best approach.
  • Who will actually do it (I wanted to give it a try, but find myself hopelessly busy with other projects)
  • Should the outer namespace be only for standalone Math only or for all of Boost.Math's configs?
  • When to do it?
  • Does anything need to be done for Multiprecision? I suspect there might be some moderately harmless cross-talk to Multiprecision.

Cc: @jzmaddock and @mborland and @NAThompson

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

No branches or pull requests

2 participants