ibc / libsdptransform

Session Description Protocol C++ parser/writer based on the sdp-transform JavaScript library
MIT License
136 stars 56 forks source link

Unable to build tests on aarch64-darwin #18

Closed haze closed 1 year ago

haze commented 3 years ago

Reproduction steps (on M1 apple silicon)

git clone https://github.com/ibc/libsdptransform
cd libsdptransform && cmake . && make

The following build error will occur when attempting to build the tests:

[ 11%] Building CXX object CMakeFiles/sdptransform.dir/src/grammar.cpp.o
[ 22%] Building CXX object CMakeFiles/sdptransform.dir/src/parser.cpp.o
[ 33%] Building CXX object CMakeFiles/sdptransform.dir/src/writer.cpp.o
[ 44%] Linking CXX static library libsdptransform.a
[ 44%] Built target sdptransform
[ 55%] Building CXX object test/CMakeFiles/test_sdptransform.dir/tests.cpp.o
In file included from /Users/haze/src/libsdptransform/test/tests.cpp:4:
/Users/haze/src/libsdptransform/test/include/catch.hpp:8164:13: error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not?
            CATCH_BREAK_INTO_DEBUGGER();
            ^
/Users/haze/src/libsdptransform/test/include/catch.hpp:7876:79: note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER'
    #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
                                                                              ^
/Users/haze/src/libsdptransform/test/include/catch.hpp:7855:34: note: expanded from macro 'CATCH_TRAP'
    #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
                                 ^
<inline asm>:1:2: note: instantiated into assembly here
        int $3
        ^
1 error generated.
make[2]: *** [test/CMakeFiles/test_sdptransform.dir/tests.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_sdptransform.dir/all] Error 2
make: *** [all] Error 2

If I remove the test subdirectory from CMakeLists.txt, I can build libsdptransform just fine

regexident commented 3 years ago

While not a fix for the issue you're observing, #19 would allow you to compile on M1 via cmake . -Bbuild -DSDPTRANSFORM_BUILD_TESTS=OFF

I feel like test-compilation should preferably be opt-in (or at least opt-out) via CMake config anyway (as it drastically cuts down the compile-time of dependent libraries for non-test builds)?

ibc commented 1 year ago

Should be fixed in libsdptransform 1.2.10.