dec1/Boost-for-Android

ls: cannot access 'Boost-for-Android/build/install/libs/arm64-v8a': No such file or directory

Closed this issue · 12 comments

wwdok commented

I am building it on Windows, i changed do.sh to:
image
execute do.sh, it throw errors:
image
I checked the D:\Dependency\Boost-for-Android\build\install, found there is only a include folder
I look into the code, find the erroe occurs at here.
I am wondering when was boost_for_android/build/install/libs/ABI_NAME created

wwdok commented

BTW, i see in example-app, it add specific boost module, how to all all of boost module ?

dec1 commented

Hello

I am building it on Windows, i changed do.sh to: image execute do.sh, it throw errors: image I checked the D:\Dependency\Boost-for-Android\build\install, found there is only a include folder I look into the code, find the erroe occurs at here. I am wondering when was boost_for_android/build/install/libs/ABI_NAME created

Building on windows is only officially supported via docker or virtual machines. But MingGW should work without much trouble too (I just havent had the time to test it).

The error message seems to indicate it just cant delete/create the dirs where it wants to put the built files. I recommend uncommenting the lines you quoted and get more info. Maybe its a user permission issue or some other problem with the path (mingw access to the windows dir) etc

dec1 commented

BTW, i see in example-app, it add specific boost module, how to all all of boost module ?

You would need to add each (dynamic) library individually.
If you want all, it might be easier to use the static libs

dec1 commented

Note, I have various prebuilt static and dynamic libs available for download

wwdok commented

I also try to build boost in virtual machine, but still encounter this issue:
image
I think i shoud have full permission:
image
As you said, i can either use the prebuilt libs, yes, i finnal choose this method, i just need to modify the code the adapt the higher version boost, but anyway at least my code can works now ~

dec1 commented

Glad you got the prebuilt libs working.

If you want to sort out building yourself, I would suggest modifying the script so that you isolate exactly the step that causes the problem. (eg By commenting out lines starting esp at the end of __build.sh). Also try reenabling some debug info eg by uncommenting lines like:
# echo "checking file " $Del_File
You could also look in the ${BUILD_DIR}/build.log).

is the file version_ndk.hpp getting written correctly ?
does install/libs exist?

Its either trying to write to a dir that isnt there or create one that it doesnt have permission to write into. You just have to figure out which and why.

dec1 commented

I think. I see where the root cause might be:
In do.sh you have left"LINKAGES" empty. You need to specify here whether you want static, dynamic or both kinds of libs

wwdok commented

You are right ! I am careless to set LINKAGES ! After set it, rerun ./do.sh, the build process move forward a lot, but after building a few minutes, i got another error unknown argument '-emit-pth'; did you mean '-emit-pch'? , some of the log:

...on 200th target...
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/..
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src
common.mkdir /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src/tr1
clang-linux.compile.c++.pch /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src/tr1/pch.hpp.pth
error: unknown argument '-emit-pth'; did you mean '-emit-pch'?

  rm -f "/home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src/tr1/pch.hpp.pth" && "clang++" -x c++-header -O3 -Wno-inline -Wall  -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DNDEBUG -I"." -I"libs/math/src/tr1" -Xclang -emit-pth -o "/home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src/tr1/pch.hpp.pth" "libs/math/build/../src/tr1/pch.hpp"

...failed clang-linux.compile.c++.pch /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/../src/tr1/pch.hpp.pth...
...skipped <p/home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi>assoc_laguerre.o for lack of <p/home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/math/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi>../src/tr1/pch.hpp.pth...
clang-linux.compile.c++.without-pth /home/xjsd/repo/boost_for_android/build/tmp/arm64-v8a/boost/bin.v2/libs/log/build/clang-linux-arm64v8a/release/abi-aapcs/link-static/target-os-android/threading-multi/setup/default_formatter_factory.o
...failed updating 1 target...
...skipped 1 target...
...updated 205 targets...
Error: Failed to build boost for arm64-v8a!
writing NDK version 21.3.6528147 to /home/xjsd/repo/boost_for_android/build/install/include/boost/version_ndk.hpp 
built boost to  /home/xjsd/repo/boost_for_android/build/install

I search emit-pth in this repo, found base_clang++ has emit-pth, i change it to emit-pch, rerun ./do.sh,but still got the same error

dec1 commented

Seems you are using ndk version 21?
This could be a problem with boost (build) itself calling the clang in this ndk with a parameter it doesnt understand.
Please try the boost (1.79.0) and ndk (25) combination as in my latest release

wwdok commented

I see you upload ndk_21_boost_1.72.0, so i try to build boost 1.72.0 with ndk 21 on my computer, it turns out success, so the version of ndk and boost matters

dec1 commented

Yes, each boost and ndk version may have their own bugs and quirks. In general its not possible to combine arbitrary versions (without manual intervention). Some boost versions eg 1.71.0 need code adaptations before they build properly.
I try to support the latest ndk with the latest boost, in regular intervals.

dec1 commented

Were you able to build with MinGW?