benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Conan ARM gcc build fails due to -m32/-m64 flags not supported

Open michkrom opened this issue 7 years ago • 7 comments

The conan create or (build as dependency) fails on ARM targets (such as RPi) as the -m32/-m64 flags are not supported by arm gcc compiler.

Possibly, fence setting BENCHMARK_BUILD_32_BITS when ARM target is detected (conanfile.py). E.g.:

cmake.definitions["BENCHMARK_BUILD_32_BITS"] = "ON" if "64" not in str(self.settings.arch) and 'arm' not in str(self.settings.arch) else "OFF"

However, clang seems to support -m32/64 bit so the above suggestion may not be the best.

michkrom avatar Oct 17 '19 02:10 michkrom

@Croydon who did the conan integration.

dmah42 avatar Feb 25 '20 13:02 dmah42

@michkrom For issues with Conan packages please fill an issue in the Conan Center Index

Upstream maintainers might not be involved in the Conan recipes so their issue trackers are most of the time the wrong place to report issues

Thanks! 😄

Croydon avatar Feb 25 '20 15:02 Croydon

Actually, I forgot that we have a conanfile directly in this repository too. Never mind then

It is still an open question how to handle such a hybrid setup: https://github.com/conan-io/conan-center-index/issues/22

Croydon avatar Feb 25 '20 16:02 Croydon

This might be issue https://github.com/conan-io/conan-center-index/issues/370

@michkrom You are cross-compiling to ARM, right?

Croydon avatar Feb 25 '20 16:02 Croydon

Actually, I was just compiling on the target, a rpi4.

On Tue, Feb 25, 2020, 8:16 AM Croydon [email protected] wrote:

This might be issue conan-io/conan-center-index#370 https://github.com/conan-io/conan-center-index/issues/370

@michkrom https://github.com/michkrom You are cross-compiling to ARM, right?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/benchmark/issues/892?email_source=notifications&email_token=AAYOHOK5IKTQQR6RMEQZRSLREU75BA5CNFSM4JBTI6XKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4SUMY#issuecomment-590948915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYOHOK44EZJGS2JLPUY6F3REU75BANCNFSM4JBTI6XA .

michkrom avatar Feb 26 '20 03:02 michkrom

Not to revive a zombie thread here, but the issue still exists even with the prior fix. The string check for "64" doesnt work for most ARM arch types in Conan (for example, armv8). I ran into it building for a Jetson TX2. The CMake-only solution you have to this was to pass the responsibility of adding -m32 compiler flag to to user (https://github.com/google/benchmark/blob/master/CMakeLists.txt#L22).

Unless Conan has a decent way of understanding when a 32-bit build needs to be made, I would recommend doing the same here and forcing the user to add the compiler flag themselves.

dnilosek avatar Oct 03 '20 04:10 dnilosek

I guess this has been fixed in the Conan Center Index recipe via https://github.com/conan-io/conan-center-index/pull/4653

Croydon avatar Mar 03 '21 19:03 Croydon