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

-march=native is not supported on all architectures #185

Closed
Tachi107 opened this issue Jan 10, 2023 · 4 comments
Closed

-march=native is not supported on all architectures #185

Tachi107 opened this issue Jan 10, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Tachi107
Copy link
Contributor

Hi, the meson.build files currently add -march=native when the compiler is detected as GCC or Clang; unfortunately, the flag isn't available on all GCC's supported targets, so compilation currently fails on Debian's ia64, mipsel, powerpc, ppc64, ppc64el, riscv64 and sparc64 architectures; you can find the build logs at https://buildd.debian.org/status/logs.php?pkg=tomlplusplus&ver=3.2.0%2Bds-2

tomlplusplus/meson.build

Lines 62 to 64 in 698285d

if is_gcc or is_clang
devel_args += '-march=native'
endif

I can think of two possible solutions:

  1. Remove the is_gcc or is_clang check, and instead write devel_args += compiler.get_supported_arguments('-march=native') (see the docs). This could be done for pretty much all the added compiler flags by the way.
  2. Remove -march=native altogether

PS: yes, I don't know if I've mentioned this before but tomlplusplus is now packaged by Debian :)

@Tachi107 Tachi107 added the bug Something isn't working label Jan 10, 2023
@marzer
Copy link
Owner

marzer commented Jan 10, 2023

Yeah I recently learned about get_supported_arguments, and have been meaning to go back and re-write this repo's build scripts to use it (and other things I've learned).

@Tachi107
Copy link
Contributor Author

Okay, I'm going to patch this in the Debian package waiting for this rewrite, since this only affects exotic architectures. As always, feel free to ping me if you need help! (I'll try to reply in less than two months this time :p)

Feel free to close this whenever you prefer :)

@marzer marzer closed this as completed in cb1d6d7 Jan 22, 2023
@marzer
Copy link
Owner

marzer commented Jan 22, 2023

Just finished the re-write, everything should be much simpler and less hacky (i.e. things that are supposed to be handled at the CI level are now handled there, lol). You may want to give it a look to verify I haven't broken various things, though.

marzer added a commit that referenced this issue Jan 22, 2023
marzer added a commit that referenced this issue Jan 22, 2023
@Tachi107
Copy link
Contributor Author

Tachi107 commented Jan 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants