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

how to add manual flags (eg. -std=gnu++98 -stdlib=libc++ -fembed-bitcode) #15

Open
mesqueeb opened this issue May 29, 2024 · 10 comments
Open

Comments

@mesqueeb
Copy link

Hello!
I need to add these manual flags to the boost build script to make my cpp code compatible.
-std=gnu++98 -stdlib=libc++ -fembed-bitcode
How to best add these ?

@mesqueeb
Copy link
Author

mesqueeb commented May 29, 2024

Could you kindly check for me if these changes to the build script are correct in your eyes?
https://github.com/mesqueeb/boost-iosx/pull/1/files

I feel like I did something wrong though because the build script stops midway with

iosx/product/frameworks/icudata.xcframework/macos-arm64/libicudata.a: No such file or directory

and re-trying gives the same

empidornis@Empidornis ~/g/g/m/F/boost (FuegoOnAppleSilicon)> ./scripts/build.sh
~/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost/boost ~/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost
patching boost...
patching file 'tools/build/src/tools/gcc.jam'
patching file 'tools/build/src/tools/features/instruction-set-feature.jam'
patching file 'tools/build/src/build/configure.jam'
cp: /Users/empidornis/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost/scripts/Pods/icu4c-iosx/product/frameworks/icudata.xcframework/macos-arm64/libicudata.a: No such file or directory

@mesqueeb
Copy link
Author

After browsing through the other issues, I

  1. recloned my fork
  2. deleted the folder at ~/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx
  3. tried ./scripts/boost.sh again, but same issue:
Integrating target `icu4c-iosx`
    Adding Build Phase '[CP] Copy XCFrameworks' to project.
  - Generating deterministic UUIDs
  - Stabilizing target UUIDs
  - Running post install hooks
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
  Cleaning up sandbox directory

Integrating client project

[!] Please close any current Xcode sessions and use `ICUdep.xcworkspace` for this project from now on.

Integrating target `Pods-ICUdep` (`ICUdep.xcodeproj` project)
  Adding Build Phase '[CP] Check Pods Manifest.lock' to project.
  - Running post integrate hooks
  - Writing Lockfile in `Podfile.lock`
  - Writing Manifest in `Pods/Manifest.lock`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update

-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] The Podfile contains command line tool target(s) (ICUdep) which are attempting to integrate dynamic frameworks or libraries.
This may not behave as expected, because command line tools are usually distributed as a single binary and cannot contain their own dynamic dependencies.
~/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost
~/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost/boost ~/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost
patching boost...
patching file 'tools/build/src/tools/gcc.jam'
patching file 'tools/build/src/tools/features/instruction-set-feature.jam'
patching file 'tools/build/src/build/configure.jam'
cp: /Users/empidornis/ghq/github.com/mesqueeb/FuegoOnAppleSilicon/boost/scripts/Pods/icu4c-iosx/product/frameworks/icudata.xcframework/macos-arm64/libicudata.a: No such file or directory

So I think it might really have something to do with my changes of the build script here...? 🤔

@apotocki
Copy link
Owner

I really doubt that you need these flags.
-std=gnu++98 I think most boost libraries will not even compile with this.
-stdlib=libc++ On systems where libc++ is the default library used, such as MacOS and FreeBSD, this flag is not needed.
-fembed-bitcode It's already included for device builds and -fembed-bitcode-marker for all simulators.

@mesqueeb
Copy link
Author

@apotocki thank you for your help.
I realised my fork works when executing ./scripts/build.sh directly in the fork clone.

But when installing it as a git-submodule in another repo, for whatever reason it fails. Even if I first do cd ./boost and do it from there. 🤔 Is there anything that could cause this?

-std=gnu++98 is required for some cpp code to compile.
I am basing the build settings on those here:
https://github.com/herzbube/fuego-on-ios/blob/fuego-on-ios/boost/boost.sh

I tried with all other standard libraries, but only -std=gnu++98 will work with the cpp code I'm trying to build.

The issue with that version is that it won't compile to visionOS 😭

@apotocki
Copy link
Owner

I have no idea why you can't run the build from the submodule. These are completely unrelated things.
The 98 standard is absolutely obsolete these days. You're better off fixing your C++ code than trying to build modern libraries with gnu++98 and link them.

@mesqueeb
Copy link
Author

@apotocki thanks. While I was able to get boost 1.75.0 to build with my fork that sets it to gnu++98, I still can't compile the Fuego c++ code.

I wonder, is there a way if boost was correctly compiled and is actually using gnu++98?

You're better off fixing your C++ code than trying to build modern libraries with gnu++98 and link them.

You're absolutely right :P But I don't know C++ and Fuego is an 11 y.o. unmaintained library... 🤦🏻 Do you wanna help modernise it? : P do you freelance? Add me on Discord! ;)

@apotocki
Copy link
Owner

I've sent e-mail

@mesqueeb
Copy link
Author

I've sent e-mail

I didn't receive it 😲

@apotocki
Copy link
Owner

I sent it to [email protected]

@apotocki
Copy link
Owner

Oh, sorry. I just found your email in my spam folder. :) I'll resend my letter to that email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants