marzer / tomlplusplus

Header-only TOML config file parser and serializer for C++17.
https://marzer.github.io/tomlplusplus/
MIT License
1.53k stars 146 forks source link

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

Closed Tachi107 closed 1 year ago

Tachi107 commented 1 year ago

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

https://github.com/marzer/tomlplusplus/blob/698285d9b2f3f6756fcdab8b93f60352325764e1/meson.build#L62-L64

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 :)

marzer commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

Tachi107 commented 1 year ago

Il giorno dom 22 gen 2023 alle 11:53:34 -08:00:00, Mark Gillard @.***> ha scritto:

Closed #185 as completed via cb1d6d7.

That surely is a rewrite!

Had a brief look, and it looks good. Just some notes:

But as you can see, these are almost useless nitpicks. Good job, and thank you!

-- OpenPGP key: 66DE F152 8299 0C21 99EF A801 A8A1 28A8 AB1C EE49