mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.51k stars 1.6k forks source link

boost log on mac os x is not using -mt variant #2436

Open gauteh opened 6 years ago

gauteh commented 6 years ago

Hi,

the correct -mt version of boost_thread is chosen on mac, but not for boost_log. Also re-arranging the boost components did not trigger a reconfiguration, but this changes if I clean out build and rebuild.

Lib order: https://stackoverflow.com/questions/38121947/boost-log-linking-error-on-osx#answer-38122244

Apparently no non-mt version of log is present with homebrew. Manually editing build.ninja to use -mt makes it work.

Error:

gauteh commented 6 years ago

Could this be related to the order of the 'threads' component?

NickeZ commented 6 years ago

If you want to debug this a little bit further yourself you can add some mlog.log() statements in the following function detect_lib_modules_nix():

https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/misc.py#L308

I don't have access to Mac OS so I can't help you further..

gauteh commented 6 years ago

This bug was reported by another user, I don't have ready access to Mac OS either.

NickeZ commented 6 years ago

From the gist it looks like the boost dependency module picks the thread safe library of boost_thread but not for any other libraries. I don't understand why by simply looking at the code though.. By default it really should pick the threadsafe (-mt) versions of all boost libraries.

 -L/usr/local/lib -lboost_filesystem -lboost_system -lboost_program_options -lboost_log_setup -lboost_log -lboost_thread-mt -lboost_date_time
gauteh commented 6 years ago

Yeah - I couldn't immediately spot the issue either, I've recently got reports of the same issues with the boost thread library as well (which were fixed by downgrading to meson 0.42.1). I've requested some more feedback.

Both boost and meson installed through homebrew.

NickeZ commented 6 years ago

Could it be that Mac OS has a system wide installation of Boost that gets precedence over an homebrew installation when it searches for libs? Maybe you could ask your users to set BOOST_ROOT and/or BOOST_LIBDIR

gauteh commented 6 years ago

Niklas Claesson writes on oktober 18, 2017 10:57:

Could it be that Mac OS has a system wide installation of Boost that gets precedence over an homebrew installation when it searches for libs? Maybe you could ask your users to set BOOST_ROOT and/or BOOST_LIBDIR

BOOST_ROOT is set according to: https://github.com/astroidmail/homebrew-astroid/blob/master/Formula/astroid.rb#L23-L24

(you can also see the boost_log hack there).

drsog commented 6 years ago

LabelAs: macos

Recently I got CI running and it failed I believe because boost did not exist on my mac (so I would doubt the precedence theory). Still working on a release for the CI. I'll see what happens as I climb out of my rabbit hole..

bredelings commented 6 years ago

@gauteh Hi, I think this might be fixed now in master. Can you check?

gauteh commented 6 years ago

@bredelings: Hi, sorry - but we are no longer using meson, and I don't have access to a Mac.