rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

Remove -march=native/-mcpu=native default compilation flags.

Open Romain-Geissler-1A opened this issue 5 years ago • 5 comments

Indeed this is making the assumption that the build machine is also the same (or in the case of -mcpu similar to) the CPU found on the run machines. In the general cases of distributions where compiling happens once and the file is binary is distributed on many other machines, this is actually a wrong assumption.

I know that most likely this pull request will be rejected as is. If that is the case, then what do you think about adding one CMAKE variable to conditionally enable these flags (and without cross-compiling) ? As really, if you are in the case of a distribution, you really don't want that behavior.

Romain-Geissler-1A avatar Oct 05 '20 16:10 Romain-Geissler-1A

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Oct 05 '20 16:10 tencent-adm

Coverage Status

Coverage increased (+0.1%) to 99.879% when pulling c944f0e997969ba4b1bdcae3f7115060f85716cb on Romain-Geissler-1A:remove-march-native-flag into ce81bc9edfe773667a7a4454ba81dac72ed4364c on Tencent:master.

coveralls avatar Oct 05 '20 17:10 coveralls

RapidJSON is header-only library. There is no binary distribution. The build is only for unit tests and performance tests.

miloyip avatar Oct 08 '20 10:10 miloyip

This PR fixes #1816. Without this change, it isn't possible to install rapidjson on ARM (for example, Apple's new M1 laptops).

adamjstewart avatar Jun 25 '22 18:06 adamjstewart

I'm also experiencing issues with -march=native being set when compiling on Apple Silicon. What can we do about this?

embluk avatar Jan 29 '23 14:01 embluk