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

Boost is not detected out of the box on FreeBSD #2239

Closed
mqudsi opened this issue Aug 23, 2017 · 8 comments
Closed

Boost is not detected out of the box on FreeBSD #2239

mqudsi opened this issue Aug 23, 2017 · 8 comments
Labels
boost bug dependencies OS:*BSD Issues specific to one of the BSD Operating Systems

Comments

@mqudsi
Copy link

mqudsi commented Aug 23, 2017

Before providing more details, I wanted to make sure that Boost is supposed to "just work" if installed with the system package manager with its headers in /usr/local/include/boost/ and its libs in /usr/local/lib/, because out-of-the-box meson on FreeBSD complains that boost was not found when it's included as a project dependency.

This is without BOOST_INCLUDEDIR or BOOST_ROOT set. I didn't have to set them on Ubuntu; I would have supposed the same would apply for FreeBSD. (Setting them and manually adding the link directory made everything work.)

@AlexandreFoley
Copy link
Contributor

Same problem on OSX. If BOOST_ROOT is unspecified, Meson complain that it can't find boost when it is located in /usr/local.
The manual entry about boost say that those environment variables need to be specified if boost is in a non-standard location. I have to wonder what is a standard location if /usr/local isn't one a unix like platform.

@nirbheek
Copy link
Member

This is a deficiency in the BoostDependency() implementation. Besides BOOST_ROOT, we should also look inside /usr/local on FreeBSD. What do other *BSDs do?

@nirbheek nirbheek added the OS:*BSD Issues specific to one of the BSD Operating Systems label Aug 31, 2017
@jpakkane
Copy link
Member

The bigger question here is when should be look under /usr/local in general? What other things does FreeBSD install there? Does it ever install Boost under /usr? How is its pkg-config set up? Does it look for pc files under /usr/local by default or not?

@mqudsi
Copy link
Author

mqudsi commented Aug 31, 2017

/usr/local is a unix standard that only (many) Linux distributions eschew.

OS X, the BSDs, and others use /usr/{bin|share|lib|etc} for binaries shipping with the base OS and /usr/local/{bin|share|lib|etc} for any user-installed binaries/libraries (via ./configure && make install or via the platform package manager (pkg, homebrew, ports, etc.). It's not a boost thing at all.

@mqudsi
Copy link
Author

mqudsi commented Aug 31, 2017

You can read about the filesystem hierarchy here: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

@NickeZ NickeZ mentioned this issue Sep 6, 2017
NickeZ added a commit to NickeZ/meson that referenced this issue Oct 1, 2017
The new implementation will correctly pick boost from 3 possible
locations on windows and two locations on posix compatible OSs.

The new search algorithm also differentiates between debug and
release builds of Boost and multi or single threading builds.

It was also decided to map "Meson modules" to Boost software libraries
and not Boost modules since it there are a lot of options regarding
linking. Some modules can even be used either as headers-only or with
dynamic linking.

This commit also fixes a bug that prevented header-only use on Windows.

Fixes: mesonbuild#2274 mesonbuild#2239 mesonbuild#1803 mesonbuild#669
@nirbheek
Copy link
Member

nirbheek commented Oct 1, 2017

This is fixed with #2282

@mqudsi
Copy link
Author

mqudsi commented Jan 17, 2019

This is not working with meson 0.4.9, boost 1.69, and FreeBSD 12. It fails to include boost/version.hpp which is installed to the system default (standard) path /usr/local/include/boost/version.hpp.

Relevant section from log file:

Boost library root dir is None
Boost include directory is None
Running compile:
Working directory:  /tmp/tmpg17rfl8h
Command line:  c++ /tmp/tmpg17rfl8h/testfile.cpp -pipe -D_FILE_OFFSET_BITS=64 -E -P -O0 -fpermissive 

Code:
 
        #include <boost/version.hpp>
        #ifndef BOOST_LIB_VERSION
        # define BOOST_LIB_VERSION
        #endif
        "MESON_GET_DEFINE_DELIMITER"
BOOST_LIB_VERSION
Compiler stdout:
 




        "MESON_GET_DEFINE_DELIMITER"

Compiler stderr:
 /tmp/tmpg17rfl8h/testfile.cpp:2:18: fatal error: 'boost/version.hpp' file not found
        #include <boost/version.hpp>
                 ^~~~~~~~~~~~~~~~~~~
1 error generated.

Dependency Boost (regex, system, filesystem, regex) found: NO 

meson.build:61:0: ERROR:  Dependency "boost" not found

and some more info for the record:

mqudsi@freebsd12 ~/easyre> meson --buildtype debug debug
The Meson build system
Version: 0.49.0
Source dir: /usr/home/mqudsi/easyre
Build dir: /usr/home/mqudsi/easyre/debug
Build type: native build
Project name: easyre
Project version: undefined
Native C compiler: cc (clang 6.0.1 "FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)")
Native C++ compiler: c++ (clang 6.0.1 "FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Message: regex test passed
Program nasm found: YES (/usr/local/bin/nasm)
Program dd found: YES (/bin/dd)
Library m found: YES
Library dl found: YES
Dependency threads found: YES
Found pkg-config: /usr/local/bin/pkg-config (1.5.4)
Dependency hivex found: YES 1.3.15
Dependency libsodium found: YES 1.0.16
Dependency Boost (regex, system, filesystem, regex) found: NO

meson.build:61:0: ERROR:  Dependency "boost" not found

A full log can be found at /usr/home/mqudsi/easyre/debug/meson-logs/meson-log.txt
mqudsi@freebsd12 ~/easyre> fd 'boost.*(regex|system)|(regex|system).*\.hpp' /usr/local
/usr/local/include/boost/algorithm/string/detail/finder_regex.hpp
/usr/local/include/boost/algorithm/string/detail/formatter_regex.hpp
/usr/local/include/boost/algorithm/string/regex.hpp
/usr/local/include/boost/algorithm/string/regex_find_format.hpp
/usr/local/include/boost/algorithm/string_regex.hpp
/usr/local/include/boost/asio/detail/regex_fwd.hpp
/usr/local/include/boost/asio/impl/system_context.hpp
/usr/local/include/boost/asio/impl/system_executor.hpp
/usr/local/include/boost/asio/system_context.hpp
/usr/local/include/boost/asio/system_executor.hpp
/usr/local/include/boost/asio/system_timer.hpp
/usr/local/include/boost/chrono/detail/system.hpp
/usr/local/include/boost/chrono/system_clocks.hpp
/usr/local/include/boost/compute/system.hpp
/usr/local/include/boost/cregex.hpp
/usr/local/include/boost/date_time/posix_time/posix_time_system.hpp
/usr/local/include/boost/date_time/time_system_counted.hpp
/usr/local/include/boost/date_time/time_system_split.hpp
/usr/local/include/boost/detail/winapi/get_system_directory.hpp
/usr/local/include/boost/detail/winapi/system.hpp
/usr/local/include/boost/dll/detail/system_error.hpp
/usr/local/include/boost/filesystem.hpp
/usr/local/include/boost/geometry/core/coordinate_system.hpp
/usr/local/include/boost/iostreams/detail/system_failure.hpp
/usr/local/include/boost/iostreams/filter/regex.hpp
/usr/local/include/boost/log/support/regex.hpp
/usr/local/include/boost/log/support/std_regex.hpp
/usr/local/include/boost/process/async_system.hpp
/usr/local/include/boost/process/system.hpp
/usr/local/include/boost/regex/regex_traits.hpp
/usr/local/include/boost/regex/v4/basic_regex.hpp
/usr/local/include/boost/regex/v4/basic_regex_creator.hpp
/usr/local/include/boost/regex/v4/basic_regex_parser.hpp
/usr/local/include/boost/regex/v4/c_regex_traits.hpp
/usr/local/include/boost/regex/v4/char_regex_traits.hpp
/usr/local/include/boost/regex/v4/cpp_regex_traits.hpp
/usr/local/include/boost/regex/v4/cregex.hpp
/usr/local/include/boost/regex/v4/regex.hpp
/usr/local/include/boost/regex/v4/regex_format.hpp
/usr/local/include/boost/regex/v4/regex_fwd.hpp
/usr/local/include/boost/regex/v4/regex_grep.hpp
/usr/local/include/boost/regex/v4/regex_iterator.hpp
/usr/local/include/boost/regex/v4/regex_match.hpp
/usr/local/include/boost/regex/v4/regex_merge.hpp
/usr/local/include/boost/regex/v4/regex_raw_buffer.hpp
/usr/local/include/boost/regex/v4/regex_replace.hpp
/usr/local/include/boost/regex/v4/regex_search.hpp
/usr/local/include/boost/regex/v4/regex_split.hpp
/usr/local/include/boost/regex/v4/regex_token_iterator.hpp
/usr/local/include/boost/regex/v4/regex_traits.hpp
/usr/local/include/boost/regex/v4/regex_traits_defaults.hpp
/usr/local/include/boost/regex/v4/regex_workaround.hpp
/usr/local/include/boost/regex/v4/u32regex_iterator.hpp
/usr/local/include/boost/regex/v4/u32regex_token_iterator.hpp
/usr/local/include/boost/regex/v4/w32_regex_traits.hpp
/usr/local/include/boost/regex.hpp
/usr/local/include/boost/regex_fwd.hpp
/usr/local/include/boost/spirit/home/classic/utility/regex.hpp
/usr/local/include/boost/spirit/include/classic_regex.hpp
/usr/local/include/boost/system/detail/system_category_posix.hpp
/usr/local/include/boost/system/detail/system_category_win32.hpp
/usr/local/include/boost/system/system_error.hpp
/usr/local/include/boost/units/get_system.hpp
/usr/local/include/boost/units/heterogeneous_system.hpp
/usr/local/include/boost/units/homogeneous_system.hpp
/usr/local/include/boost/units/is_quantity_of_system.hpp
/usr/local/include/boost/units/is_unit_of_system.hpp
/usr/local/include/boost/units/make_system.hpp
/usr/local/include/boost/wave/util/filesystem_compatibility.hpp
/usr/local/include/boost/winapi/get_system_directory.hpp
/usr/local/include/boost/winapi/system.hpp
/usr/local/include/boost/xpressive/basic_regex.hpp
/usr/local/include/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp
/usr/local/include/boost/xpressive/detail/core/matcher/regex_matcher.hpp
/usr/local/include/boost/xpressive/detail/core/regex_domain.hpp
/usr/local/include/boost/xpressive/detail/core/regex_impl.hpp
/usr/local/include/boost/xpressive/regex_actions.hpp
/usr/local/include/boost/xpressive/regex_algorithms.hpp
/usr/local/include/boost/xpressive/regex_compiler.hpp
/usr/local/include/boost/xpressive/regex_constants.hpp
/usr/local/include/boost/xpressive/regex_error.hpp
/usr/local/include/boost/xpressive/regex_iterator.hpp
/usr/local/include/boost/xpressive/regex_primitives.hpp
/usr/local/include/boost/xpressive/regex_token_iterator.hpp
/usr/local/include/boost/xpressive/regex_traits.hpp
/usr/local/include/boost/xpressive/traits/c_regex_traits.hpp
/usr/local/include/boost/xpressive/traits/cpp_regex_traits.hpp
/usr/local/include/boost/xpressive/traits/null_regex_traits.hpp
/usr/local/lib/libboost_filesystem.a
/usr/local/lib/libboost_filesystem.so
/usr/local/lib/libboost_filesystem.so.1.69.0
/usr/local/lib/libboost_regex.a
/usr/local/lib/libboost_regex.so
/usr/local/lib/libboost_regex.so.1.69.0
/usr/local/lib/libboost_system.a
/usr/local/lib/libboost_system.so
/usr/local/lib/libboost_system.so.1.69.0

@eli-schwartz
Copy link
Member

The boost dependency has been rewritten quite a bit since 2019 I think -- anyway, currently it detects the above mentioned layout just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
boost bug dependencies OS:*BSD Issues specific to one of the BSD Operating Systems
Projects
None yet
Development

No branches or pull requests

5 participants