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

Error building in MacOS #921

Open
henry1593572 opened this issue Dec 30, 2022 · 5 comments · Fixed by #1042
Open

Error building in MacOS #921

henry1593572 opened this issue Dec 30, 2022 · 5 comments · Fixed by #1042

Comments

@henry1593572
Copy link

henry1593572 commented Dec 30, 2022

Describe the bug
I was following the build instructions, everything was working perfectly until the building step. It stopped because of too many errors.

error: "This header is only meant to be used on x86 and x64 architecture"
error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
error: too few arguments to function call, expected 2, have 0
error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
error: use of undeclared identifier '__builtin_ia32_packsswb'
error: use of undeclared identifier '__builtin_ia32_paddb'; did you mean '__builtin_arm_addg'?
error: first argument of MTE builtin function must be a pointer ('__v8qi' (vector of 8 'char' values) invalid)
fatal error: too many errors emitted, stopping now [-ferror-limit=]

I had no idea what was going on.

kuokchonweng@guojunyingdeMacBook-Pro make % cmake --build . -j4
[  1%] Building CXX object libs/Common/CMakeFiles/Common.dir/cmake_pch_arm64.hxx.pch
In file included from <built-in>:1:
In file included from /Users/kuokchonweng/openMVS/make/libs/Common/CMakeFiles/Common.dir/cmake_pch_arm64.hxx:5:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Common.h:176:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Types.h:161:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
In file included from <built-in>:1:
In file included from /Users/kuokchonweng/openMVS/make/libs/Common/CMakeFiles/Common.dir/cmake_pch_arm64.hxx:5:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Common.h:176:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Types.h:161:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
 ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
    __builtin_ia32_emms();
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/math.h:670:12: note: '__builtin_isless' declared here
    return isless(__lcpp_x, __lcpp_y);
           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.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 <built-in>:1:
In file included from /Users/kuokchonweng/openMVS/make/libs/Common/CMakeFiles/Common.dir/cmake_pch_arm64.hxx:5:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Common.h:176:
In file included from /Users/kuokchonweng/openMVS/libs/Common/Types.h:161:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:37:25: error: too few arguments to function call, expected 2, have 0
    __builtin_ia32_emms();
    ~~~~~~~~~~~~~~~~~~~~^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:54:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:71:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
           ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:133:19: error: use of undeclared identifier '__builtin_ia32_packsswb'
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:163:19: error: use of undeclared identifier '__builtin_ia32_packssdw'
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:193:19: error: use of undeclared identifier '__builtin_ia32_packuswb'
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:220:19: error: use of undeclared identifier '__builtin_ia32_punpckhbw'
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:243:19: error: use of undeclared identifier '__builtin_ia32_punpckhwd'
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:264:19: error: use of undeclared identifier '__builtin_ia32_punpckhdq'
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:291:19: error: use of undeclared identifier '__builtin_ia32_punpcklbw'
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:314:19: error: use of undeclared identifier '__builtin_ia32_punpcklwd'
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:335:19: error: use of undeclared identifier '__builtin_ia32_punpckldq'
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:356:19: error: use of undeclared identifier '__builtin_ia32_paddb'; did you mean '__builtin_arm_addg'?
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:356:19: note: '__builtin_arm_addg' declared here
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:356: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);
                  ^                    ~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:377:19: error: use of undeclared identifier '__builtin_ia32_paddw'; did you mean '__builtin_arm_addg'?
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:356:19: note: '__builtin_arm_addg' declared here
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.0/include/mmintrin.h:377: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);
                  ^                    ~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [libs/Common/CMakeFiles/Common.dir/cmake_pch_arm64.hxx.pch] Error 1
make[1]: *** [libs/Common/CMakeFiles/Common.dir/all] Error 2
make: *** [all] Error 2

Desktop (please complete the following information):

  • OS: macOS 13.1 (22C65)
  • Chip: Apple M1 Max
@henry1593572 henry1593572 changed the title False building in MacOS Error building in MacOS Dec 30, 2022
@cdcseacave
Copy link
Owner

can you try adding -DOpenMVS_USE_SSE=OFF at cmake command line?

@henry1593572
Copy link
Author

Can you provide a more precise method to do so? I don't quite know how to do it. Thanks!

@cdcseacave
Copy link
Owner

I'm afraid I do not understand

@pierotofy
Copy link
Contributor

mkdir -p build && cd build && cmake -DOpenMVS_USE_SSE=OFF .. && make -j4

@verhovsky
Copy link

verhovsky commented Apr 4, 2023

I built openMVS following these instructions and I can confirm that #921 (comment) fixes the issue, I was able to build openmvs on my M1 Macbook air with these commands:

brew install boost eigen opencv cgal ceres-solver
git clone https://github.com/cdcseacave/VCG.git vcglib
git clone https://github.com/cdcseacave/openMVS.git
mkdir openMVS_build && cd openMVS_build
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DOpenMVS_USE_SSE=OFF -DVCG_ROOT="`pwd`/../vcglib" -G "Xcode"
xcodebuild -configuration Release

(for reference, this seems to be a related issue: mapillary/OpenSfM#766 (comment))

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

Successfully merging a pull request may close this issue.

4 participants