Skip to content

Building locale can fail on macOS #41

@Deadpikle

Description

@Deadpikle

When I run the following command:

./boost.sh -macos --boost-version 1.70.0 --macos-sdk 10.14 --min-macos-version 10.10 --macos-archs "i386 x86_64" --universal --framework-header-root --boost-libs "chrono date_time filesystem locale system timer"

The build fails with the following error:

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: i386/libboost_locale.a (No such file or directory)

Looking earlier in the build log and poking around on disk, I can see that there are no build files for locale. macos-build.log has a helpful error:

Boost.Locale needs either iconv or ICU library to be built

The docs for locale (here) state the following:

Building Boost.Locale
Dependencies

    ICU library 3.6 or above is strongly recommended
    If no ICU library is given, iconv support is required under POSIX platforms.

Platform Notes

    If you use Boost.Locale on Windows with MinGW/GCC < 4.5 you'll be able to use static version only. Mingw/GCC prior to 4.5 have no support of dynamic runtime linking.
    Using Boost.Locale DLL's with MinGW gcc also requires dynamic linking with the runtime libraries libstdc++ and libgcc. Some gcc builds use static linking by default so make sure you use correct link options with your compiler when you build your own programs.
    The AIX's iconv misses important character sets that Boost.Locale requires, so you need to either use GNU iconv or link with ICU library.
    If iconv library is not found on Darwin/Mac OS X builds make sure there is no multiple iconv installations and provide -sICONV_PATH build option to point to correct location of iconv library.

I'm looking into what this would take to fix now, as which iconv on my system returns a valid, usable binary.

http://metashapes.com/blog/building-boost-locale-ios/ has some interesting details, but adding -I$XCODE_ROOT/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${MACOS_SDK_VERSION}.sdk/usr/include/ -L$XCODE_ROOT/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${MACOS_SDK_VERSION}.sdk/usr/lib/ to EXTRA_MACOS_SDK_FLAGS doesn't seem to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions