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

clang: error: unknown argument: '-mnative' #8

Closed
jamesb93 opened this issue Jan 12, 2021 · 6 comments
Closed

clang: error: unknown argument: '-mnative' #8

jamesb93 opened this issue Jan 12, 2021 · 6 comments

Comments

@jamesb93
Copy link
Member

When using the recommended flags for compiling to the instruction set on my machine I get this error at the make stage:

clang: error: unknown argument: '-mnative'

I am running this on a new arm Mac though, so obviously this is a YMMV situation I realise. Just curious if this is something to be fixed in the cmake?

@tremblap
Copy link
Member

tremblap commented Jan 12, 2021

I am running this on a new arm Mac though

nice flex, bradbry 👍

@weefuzzy
Copy link
Member

weefuzzy commented Jan 12, 2021

I don't think anything in our build scripts passes -mnative (and, indeed, it's not a correct flag, even though our readme erroneously refers to it)

Have you ported a build folder over from your old machine and not rerun cmake? Sounds like you might have the FLUID_ARCH build variable set. If you don't want to scrub and reconfigure, try

cmake -UFLUID_ARCH ..
cmake -DFLUID_ARCH=-mcpu=native ..

?

@jamesb93
Copy link
Member Author

I cloned it fresh from master. I am at dfb6918 for reference.

Those commands in that order worked after rm -rfing the build folder. The build was also insanely quick compared to what my intel Mac goes through.

Doing a rough benchmark with hyperfine running 1000 iterations of fluid-noveltyslice on a 4 minute stereo file @ 48khz the m1 is looking to be about 25% faster overall at completing with default parameters.

Over 1000 iterations the average time for the m1 was 750ms, while my 2015 intel was averaging around 1000ms. Promising!

@jamesb93
Copy link
Member Author

jamesb93 commented Jun 10, 2021

These build steps no longer on RC1b. I get this error compiling with:

cmake -DFLUID_ARCH=-mcpu=native ..

make install
[  2%] Building CXX object _deps/flucoma-core-build/CMakeFiles/HISSTools_AudioFile.dir/__/hisstools-src/AudioFile/BaseAudioFile.cpp.o
[  5%] Building CXX object _deps/flucoma-core-build/CMakeFiles/HISSTools_AudioFile.dir/__/hisstools-src/AudioFile/IAudioFile.cpp.o
[  7%] Building CXX object _deps/flucoma-core-build/CMakeFiles/HISSTools_AudioFile.dir/__/hisstools-src/AudioFile/OAudioFile.cpp.o
[ 10%] Linking CXX static library libHISSTools_AudioFile.a
[ 10%] Built target HISSTools_AudioFile
[ 13%] Building CXX object _deps/flucoma-core-build/CMakeFiles/HISSTools_FFT.dir/__/hisstools-src/HISSTools_FFT/HISSTools_FFT.cpp.o
[ 15%] Linking CXX static library libHISSTools_FFT.a
[ 15%] Built target HISSTools_FFT
[ 18%] Building CXX object _deps/flucoma-core-build/examples/CMakeFiles/describe.dir/describe.cpp.o
[ 21%] Linking CXX executable describe
[ 21%] Built target describe
[ 23%] Building CXX object src/fluid-ampgate/CMakeFiles/fluid-ampgate.dir/fluid-ampgate.cpp.o
[ 26%] Linking CXX executable ../../../bin/fluid-ampgate
[ 26%] Built target fluid-ampgate
[ 28%] Building CXX object src/fluid-ampslice/CMakeFiles/fluid-ampslice.dir/fluid-ampslice.cpp.o
[ 31%] Linking CXX executable ../../../bin/fluid-ampslice
[ 31%] Built target fluid-ampslice
[ 34%] Building CXX object src/fluid-hpss/CMakeFiles/fluid-hpss.dir/fluid-hpss.cpp.o
[ 36%] Linking CXX executable ../../../bin/fluid-hpss
[ 36%] Built target fluid-hpss
[ 39%] Building CXX object src/fluid-loudness/CMakeFiles/fluid-loudness.dir/fluid-loudness.cpp.o
[ 42%] Linking CXX executable ../../../bin/fluid-loudness
[ 42%] Built target fluid-loudness
[ 44%] Building CXX object src/fluid-melbands/CMakeFiles/fluid-melbands.dir/fluid-melbands.cpp.o
[ 47%] Linking CXX executable ../../../bin/fluid-melbands
[ 47%] Built target fluid-melbands
[ 50%] Building CXX object src/fluid-mfcc/CMakeFiles/fluid-mfcc.dir/fluid-mfcc.cpp.o
[ 52%] Linking CXX executable ../../../bin/fluid-mfcc
[ 52%] Built target fluid-mfcc
[ 55%] Building CXX object src/fluid-nmf/CMakeFiles/fluid-nmf.dir/fluid-nmf.cpp.o
[ 57%] Linking CXX executable ../../../bin/fluid-nmf
[ 57%] Built target fluid-nmf
[ 60%] Building CXX object src/fluid-noveltyslice/CMakeFiles/fluid-noveltyslice.dir/fluid-noveltyslice.cpp.o
In file included from /Users/james/dev/software/flucoma-cli/src/fluid-noveltyslice/fluid-noveltyslice.cpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/rt/NoveltySliceClient.hpp:22:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/rt/../../algorithms/public/NoveltySegmentation.hpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/common/../../algorithms/public/../util/ConvolutionTools.hpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/hisstools-src/SIMDSupport.hpp:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/emmintrin.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/xmmintrin.h:13:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:33:5: error: 
      use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
    __builtin_ia32_emms();
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:647:12: note: 
      '__builtin_isless' declared here
    return isless(__lcpp_x, __lcpp_y);
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/math.h:545:22: note: 
      expanded from macro 'isless'
#define isless(x, y) __builtin_isless((x),(y))
                     ^
In file included from /Users/james/dev/software/flucoma-cli/src/fluid-noveltyslice/fluid-noveltyslice.cpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/rt/NoveltySliceClient.hpp:22:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/rt/../../algorithms/public/NoveltySegmentation.hpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/flucoma-core-src/include/clients/common/../../algorithms/public/../util/ConvolutionTools.hpp:13:
In file included from /Users/james/dev/software/flucoma-cli/build/_deps/hisstools-src/SIMDSupport.hpp:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/emmintrin.h:13:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/xmmintrin.h:13:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:33:25: error: 
      too few arguments to function call, expected 2, have 0
    __builtin_ia32_emms();
                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:50:19: error: 
      use of undeclared identifier '__builtin_ia32_vec_init_v2si'
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:67:12: error: 
      use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:129:19: error: 
      use of undeclared identifier '__builtin_ia32_packsswb'
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:159:19: error: 
      use of undeclared identifier '__builtin_ia32_packssdw'
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:189:19: error: 
      use of undeclared identifier '__builtin_ia32_packuswb'
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:216:19: error: 
      use of undeclared identifier '__builtin_ia32_punpckhbw'
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:239:19: error: 
      use of undeclared identifier '__builtin_ia32_punpckhwd'
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:260:19: error: 
      use of undeclared identifier '__builtin_ia32_punpckhdq'
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:287:19: error: 
      use of undeclared identifier '__builtin_ia32_punpcklbw'
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:310:19: error: 
      use of undeclared identifier '__builtin_ia32_punpcklwd'
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:331:19: error: 
      use of undeclared identifier '__builtin_ia32_punpckldq'
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:352:19: error: 
      use of undeclared identifier '__builtin_ia32_paddb'; did you mean '__builtin_arm_addg'?
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:352:19: note: 
      '__builtin_arm_addg' declared here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:352:19: error: 
      first argument of MTE builtin function must be a pointer ('__v8qi'
      (vector of 8 'char' values) invalid)
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^                    ~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:373:19: error: 
      use of undeclared identifier '__builtin_ia32_paddw'; did you mean '__builtin_arm_addg'?
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:352:19: note: 
      '__builtin_arm_addg' declared here
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:373:19: error: 
      first argument of MTE builtin function must be a pointer ('__v4hi'
      (vector of 4 'short' values) invalid)
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
                  ^                    ~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:394:19: error: 
      use of undeclared identifier '__builtin_ia32_paddd'; did you mean '__builtin_arm_addg'?
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:352:19: note: 
      '__builtin_arm_addg' declared here
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:394:19: error: 
      first argument of MTE builtin function must be a pointer ('__v2si'
      (vector of 2 'int' values) invalid)
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
                  ^                    ~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/fluid-noveltyslice/CMakeFiles/fluid-noveltyslice.dir/fluid-noveltyslice.cpp.o] Error 1
make[1]: *** [src/fluid-noveltyslice/CMakeFiles/fluid-noveltyslice.dir/all] Error 2
make: *** [all] Error 2

I can however get a build going by doing:

cmake -DFLUID_ARCH=-msse4.2 -DCMAKE_OSX_ARCHITECTURES=x86_64 ..

but you lose the speed of not running in Rosetta. Just thought i'd keep these steps updated here.

@weefuzzy
Copy link
Member

I think that means you never had a native ARM build happening in the first place. In any case, it's trying to use Intel SIMD intrinsics.

Those objects aren't going to work for ARM yet, because they include a header that doesn't have conditional includes yet (I put in a PR to HissTools yesterday for this, as it happens).

@jamesb93
Copy link
Member Author

I think that means you never had a native ARM build happening in the first place. In any case, it's trying to use Intel SIMD intrinsics.

That sounds very reasonable 🐒

Thanks for having a gander 🇦🇺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants