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

Build error on mac, related to boost libraries #56

Closed
arinabykadorova opened this issue Oct 19, 2021 · 4 comments
Closed

Build error on mac, related to boost libraries #56

arinabykadorova opened this issue Oct 19, 2021 · 4 comments

Comments

@arinabykadorova
Copy link

This occurred while building Kass inside of the Locust software, forked here. I was compiling from source on my mac (Mojave 10.14.6).

[  1%] Building CXX object Kommon/CMakeFiles/Kommon.dir/Gsl/Utility/KGslErrorHandler.cxx.o 
In file included from /Users/arinabtelles/locust_mc/kassiopeia/Kommon/Gsl/Utility/KGslErrorHandler.cxx:8:
In file included from /usr/local/include/boost/stacktrace.hpp:15:
In file included from /usr/local/include/boost/stacktrace/frame.hpp:20:
In file included from /usr/local/include/boost/stacktrace/safe_dump_to.hpp:217:
/usr/local/include/boost/stacktrace/detail/collect_unwind.ipp:33:2: error: "Boost.Stacktrace requires _Unwind_Backtrace function.
      Define _GNU_SOURCE macro or BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED if _Unwind_Backtrace is available without
      _GNU_SOURCE."
#error "Boost.Stacktrace requires _Unwind_Backtrace function. Define _GNU_SOURCE macro or BOOST_STACKTRACE_GNU_SOURCE_...
 ^
1 error generated.
make[5]: *** [Kommon/CMakeFiles/Kommon.dir/Gsl/Utility/KGslErrorHandler.cxx.o] Error 1
make[4]: *** [Kommon/CMakeFiles/Kommon.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [src/KassiopeiaExt-stamp/KassiopeiaExt-build] Error 2
make[1]: *** [CMakeFiles/KassiopeiaExt.dir/all] Error 2
make: *** [all] Error 2 

After doing some research, I was able to fix it by adding these lines right after line 102 of kassiopeia/Kommon/CMakeLists.txt:

if(UNIX OR APPLE OR MINGW)
    target_compile_definitions(Kommon PRIVATE _GNU_SOURCE)
endif()

I'm not entirely sure what the role of _GNU_SOURCE is in the build, but this seems to work. Is this a valid workaround? What is the cause of the build error? Thanks!

@arinabykadorova
Copy link
Author

Note, I found the fix at the bottom of the comments at this link: boostorg/stacktrace#88

@pslocum
Copy link
Contributor

pslocum commented Oct 19, 2021 via email

@arinabykadorova
Copy link
Author

Trying it just from the the main Kass branch on https://github.com/KATRIN-Experiment/Kassiopeia, I get the same behavior - same error and same fix works.

@zykure
Copy link
Member

zykure commented Oct 20, 2021

Thanks for reporting this! I think the workaround is fine. I'll add it to the CMake config.

zykure added a commit that referenced this issue Oct 20, 2021
@zykure zykure closed this as completed Oct 20, 2021
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

3 participants