Closed ki82 closed 6 years ago
I can say for certain that this script will build Boost 1.63.0 using Xcode 9. Someone had this same problem a while ago and it wound up being a system configuration problem (had an invalid user-config.jam that Boost.Build was picking up from somewhere). Here's a couple things to try.
Firstly, just try deleting everything from the directory except the build script itself (if you've cloned the repository, you can use git clean -fdX
to wipe out everything not under version control) and just try rebuilding again. (You might copy the boost tarball somewhere else first if you don't want to wait for it to re-download).
If that doesn't work, clear everything out again, unset the BOOST_BUILD_USER_CONFIG
environment variable (You can simply do unset BOOST_BUILD_USER_CONFIG
), and try building again.
If neither of this work, try this. You'll have to modify the script. In the function buildBoost_iOS
, after the very first ./b2
command (after the "Install this one" comment), add -d 11
, so the command now looks like:
echo Building Boost for iPhone
# Install this one so we can copy the headers for the frameworks...
./b2 -d 11 $THREADS --build-dir=iphone-build --stagedir=iphone-build/stage \
--prefix="$IOS_OUTPUT_DIR/prefix" toolset=darwin cxxflags="${CXX_FLAGS}" architecture=arm target-os=iphone \
macosx-version=iphone-${IOS_SDK_VERSION} define=_LITTLE_ENDIAN \
link=static stage >> "${IOS_OUTPUT_DIR}/ios-build.log" 2>&1
if [ $? != 0 ]; then echo "Error staging iPhone. Check log."; exit 1; fi
Open the resulting ios-build.log file (build/boost/1.63.0/ios/ios-build.log) in the Console app (it's the default for *.log files, so it should open automatically), search for "is not a known value of". This will filter the (enormous) log down to just a few lines. You should see something similar to this:
(builtin):>>>>|>>>>|>>>>|>>>>| errors.error "iphone-10.0" is not a known value of feature <macosx-version> : legal values: "iphone-11.0" "iphonesim-11.0"
(builtin):>>>>|>>>>|>>>>|>>>>|>> errors.error-skip-frames 3 "iphone-10.0" is not a known value of feature <macosx-version> : legal values: "iphone-11.0" "iphonesim-11.0" : : : : : : : : : : : : : : : : :
(builtin):>>>>|>>>>|>>>>|>>>>|>>>> errors.backtrace 3 error: "iphone-10.0" is not a known value of feature <macosx-version> : legal values: "iphone-11.0" "iphonesim-11.0" : : : : : : : : : : : : : : : : :
get messages = "iphone-10.0" is not a known value of feature <macosx-version>
get messages = "iphone-10.0" is not a known value of feature <macosx-version>
(builtin):>>>>|>>>>|>>>>|>>>>|>>>>|> ECHO error: "iphone-10.0" is not a known value of feature <macosx-version>
error: "iphone-10.0" is not a known value of feature <macosx-version>
What is shown where it says legal values: "iphone-XX.X" "iphonesim-XX.X" ... etc
? You should be able to re-run the script using the version number indicated there.
e.g. if, for legal values, it says "iphone-10.3", try this:
./boost.sh -ios --boost-version 1.63.0 --ios-sdk 10.3
Thanks for the response. git clean -fdX, unset BOOST_BUILD_USER_CONFIG or adding -d 11 did not help.
I think that the problem is: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/crt_externs.h: No such file or directory
I think that crt_externs.h did exist before, i was able too build boost 1.63 with Xcode 8. This script started to fail after I upgraded to Xcode 9
build/boost/1.63.0/ios/ios-build.log says:
(builtin):>>>>|>>>>|>>>>|>>>>| errors.error "iphone-11.2" is not a known value of feature <macosx-version> : legal values:
(builtin):>>>>|>>>>|>>>>|>>>>|>> errors.error-skip-frames 3 "iphone-11.2" is not a known value of feature <macosx-version> : legal values: : : : : : : : : : : : : : : : : :
(builtin):>>>>|>>>>|>>>>|>>>>|>>>> errors.backtrace 3 error: "iphone-11.2" is not a known value of feature <macosx-version> : legal values: : : : : : : : : : : : : : : : : :
get messages = "iphone-11.2" is not a known value of feature <macosx-version>
get messages = "iphone-11.2" is not a known value of feature <macosx-version>
(builtin):>>>>|>>>>|>>>>|>>>>|>>>>|> ECHO error: "iphone-11.2" is not a known value of feature <macosx-version>
error: "iphone-11.2" is not a known value of feature <macosx-version>
So I have no legal values to change too.
I can say that the missing crt_externs.h
is not the problem - i get that same message then building on my machine and I am able to run the script on 3 of my machines using the same parameters you are.
The problem is definitely that Boost.build cannot find a legal value for <macosx-version>
(this includes iOS / iOS Simulators). Boost.build is supposed to (I believe...) use your active Xcode developer directory (should be the same as output by xcodeselect -p
) as the root directory for its SDK search. boost_1_63_0/tools/build/src/tools/darwin.jam
is set to look in <root>/Platforms/<target_platform>/Developer/SDKs
, which for me lists all of the SDKs available on my system.
First make sure that your default Xcode is set as you expect (it's /Applications/Xcode.app/Contents/Developer
for me). Then make sure that xcode-root/Platforms/iPhoneOS.platform/Developer/SDKs
does indeed have an iPhoneOS11.2.sdk
in it.
If that all looks right, then the only other thing I can think is that there is something set (or not set?) somewhere on your system (no idea what it would be) and Boost.build isn't able to search for the SDK in the proper location. If that seems to be the case, your probably going to have to dig into boost_1_63_0/tools/build/src/tools/darwin.jam
and add some ECHO
s to figure out where it's actually searching. A good place to start would probably be in the rule init ( version ? : command * : options * : requirement * )
function. There is a block in there for detecting the root dir (comment above the block that says # - Autodetect the root and bin dir if not given
. You might try ECHO $(root)
at the bottom of that block.
A couple of other things you might try is to
Aside from that, I really don't have any other ideas right now. I'm no Boost.build expert, just kind of taking stabs at things at this point. My typical debugging workflow when I run into this kind of stuff is to start digging through all the build config files and see if I can find something that looks even remotely like the problem. Usually really nonsensical problems like this stick around for me for weeks while I just continue to use whatever the current version I already have built is until I get it figured out.
Did you find a solution to this?
Closing due to inactivity
I also faced this issue, got the same message of the missing header. I cleaned the repo and issue resolved for me (The missing header message still showing but everything just builds fine)
I had this exact same issue and resolved it.
Since I built boost manually outside of this I had a ~/user-config.jam file that was causing the darwin.jam file to not work correctly (wrong sdk-root). I moved the ~/user-config.jam out of the way temporarily and reran boost.sh and I was able to start building. This is probably why some people experience this issue and other's don't. It might be worth having boost.sh check for this file and warn about it.
./boost.sh --boost-version 1.63.0 --boost-libs "system date_time thread chrono atomic random filesystem regex" -ios BUILD_IOS: YES BUILD_TVOS: NO BUILD_MACOS: NO BOOST_VERSION: 1.63.0 IOS_SDK_VERSION: 11.2 MIN_IOS_VERSION: 10.0 TVOS_SDK_VERSION: 11.2 MIN_TVOS_VERSION: 10.0 MACOS_SDK_VERSION: 10.13 MIN_MACOS_VERSION: 10.10 MACOS_ARCHS: x86_64 (1) BOOST_LIBS: system date_time thread chrono atomic random filesystem regex BOOST_SRC: /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0 IOS_BUILD_DIR: /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/build/boost/1.63.0/ios/build MACOS_BUILD_DIR: /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/build/boost/1.63.0/macos/build IOS_FRAMEWORK_DIR: /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/build/boost/1.63.0/ios/framework MACOS_FRAMEWORK_DIR: /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/build/boost/1.63.0/macos/framework XCODE_ROOT: /Applications/Xcode.app/Contents/Developer THREADS: -j8
...
Invent missing headers cp: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/crt_externs.h: No such file or directory
...
Error staging iPhone. Check log.
ios-build.log /Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build/feature.jam:494: in validate-value-string from module feature error: "iphone-11.2" is not a known value of feature
error: legal values:
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build/feature.jam:364: in expand-subfeatures-aux from module feature
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build/feature.jam:425: in feature.expand-subfeatures from module feature
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build/build-request.jam:20: in apply-to-property-set from module build-request
(builtin):-1: in sequence.transform from module sequence
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build/build-request.jam:32: in build-request.expand-no-defaults from module build-request
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/build-system.jam:692: in load from module build-system
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/Users/ki/ws-xm/xmios/common-libs/cpprestsdk/Build_iOS/boostoniphone/src/boost_1_63_0/boost-build.jam:17: in module scope from module