Menu

Emscripten failed to compile: floating-point exceptions macro are not defined

2021-10-16
2021-10-18
  • Pixelblender

    Pixelblender - 2021-10-16

    Hi,

    Thank you for this awesome library. It works on desktop but unfortunately emscripten can't compile it.

    Macros such as FE_INEXACT and FE_INVALID are not defined. According to emscripten release 1.39.15: 05/06/2020:
    Stop defining FE_INEXACT and other floating point exception macros in libc, since we don't support them. That also prevents musl from including code using pragmas that don't make sense for wasm. Ifdef out other uses of those pragmas as well, as tip of tree LLVM now fails to compile them on wasm.

    more on the release note is in here: https://emscripten.org/docs/introducing_emscripten/release_notes.html

    Best regards,

     
    • Christian Rau

      Christian Rau - 2021-10-17

      Hello,

      In this case it seems you need to manually undefine support for the <cfenv>
      header. This is normally enabled automatically based on the
      compiler/library version used. But if you say your environment is
      explicitly unsupporting the standard there, then you can manually
      deactivate support for these macros by defining the HALF_ENABLE_CPP11_CFENF
      macro to 0 (either via compiler/preprocessor options or in code before
      including half.hpp), as described in the documentation on
      half.sourceforge.net. This will cause the library to define the FE_ macros
      itself.</cfenv>

      Regards,
      Christian Rau

      Am So., 17. Okt. 2021 um 00:35 Uhr schrieb Pixelblender pixelblender3d@users.sourceforge.net:

      Hi,

      Thank you for this awesome library. It works on desktop but unfortunately
      emscripten can't compile it.

      Macros such as FE_INEXACT and FE_INVALID are not defined. According to
      emscripten release 1.39.15: 05/06/2020:
      Stop defining FE_INEXACT and other floating point exception macros in
      libc, since we don't support them. That also prevents musl from including
      code using pragmas that don't make sense for wasm. Ifdef out other uses of
      those pragmas as well, as tip of tree LLVM now fails to compile them on
      wasm.

      more on the release note is in here:
      https://emscripten.org/docs/introducing_emscripten/release_notes.html

      Best regards,


      Emscripten failed to compile: floating-point exceptions macro are not
      defined


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/half/discussion/general/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       
  • Pixelblender

    Pixelblender - 2021-10-18

    Hi,

    Defining HALF_ENABLE_CPP11_CFENV=0 fix the issue. Thank you so much and keep up the good work!

    Cheers!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.