Emscripten compilation issue
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp, wasm
- Domain
- build-system
Research direction
Start with include/boost/numeric/interval/hw_rounding.hpp and include/boost/config/platform/wasm.hpp, then inspect how BOOST_NO_FENV_H selects the rounding implementation for the Emscripten toolchain. Reproduce the Boost 1.82.0 build with Emscripten 3.1.51 and compare the C99 implementation against the failing path. Done means the library builds without the reported local patch and the resulting behavior is verified.
Written by the indexing model from the issue text.
Description
Hello!
I might do something wrong, but I had to apply the following patch to the boost interval library (v1.82.0) in order to build it successfully using the emscripten toolchain (v3.1.51).
diff --git a/include/boost/numeric/interval/hw_rounding.hpp b/include/boost/numeric/interval/hw_rounding.hpp
index 46d452e..4211079 100644
--- a/include/boost/numeric/interval/hw_rounding.hpp
+++ b/include/boost/numeric/interval/hw_rounding.hpp
@@ -16,6 +16,7 @@
#include <boost/numeric/interval/rounded_arith.hpp>
#define BOOST_NUMERIC_INTERVAL_NO_HARDWARE
+#undef BOOST_NO_FENV_H
// define appropriate specialization of rounding_control for built-in types
#if defined(__x86_64__) && !defined(BOOST_NO_FENV_H)
This reverts to the c99 impl, which builds and works fine as far I can tell.
From what I gathered, the definition of BOOST_NO_FENV_H occurs in include/boost/config/platform/wasm.hpp:23 and commenting it out also fixes the issue.
This is, however, very hacky and I was wondering if there way a cleaner way to achieve the same results.
- Dominant language
- C++
- Stars
- 31
- Forks
- 49
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/interval
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in boostorg/interval
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
godotengine/godot#124139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ChicoState/autovalidate#195 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
petercorke/robotics-toolbox-python#709 ·
Maintainers usually reply within 2 days
-
bug documentation LOW ui
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mgradwohl/tasksmack#1212 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day