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

Building for mobile ios android #65

Closed
DAOCUONG opened this issue Aug 16, 2021 · 3 comments
Closed

Building for mobile ios android #65

DAOCUONG opened this issue Aug 16, 2021 · 3 comments

Comments

@DAOCUONG
Copy link

Try building for ios and android architect i have error with ios
It seem there is some thing wrong when it included x86intrin.h:

=================================================================
cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/x86intrin.h:15:
cargo:warning=In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/immintrin.h:15:
cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/mmintrin.h:33:25: error: too few arguments to function call, expected 2, have 0
cargo:warning= __builtin_ia32_emms();
cargo:warning= ^
exit status: 1
Detecting iOS SDK path for iphoneos
running: "clang++" "-O3" "-fPIC" "--target=aarch64-apple-ios" "-arch" "arm64" "-miphoneos-version-min=7.0" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk" "-fembed-bitcode" "-stdlib=libc++" "-I" "vendor/openjph/src/core" "-I" "vendor/openjph/src/core/codestream" "-I" "vendor/openjph/src/core/coding" "-I" "vendor/openjph/src/core/others" "-I" "vendor/openjph/src/core/transform" "-I" "vendor/openjph/src/core/common" "-std=c++17" "-DOJPH_DISABLE_INTEL_SIMD" "-mavx" "-mavx2" "-o" "/Users/dao/openjph_ffi/target/aarch64-apple-ios/release/build/openjphffi-21d36605edc8156d/out/vendor/openjph/src/core/transform/ojph_transform_avx2.o" "-c" "vendor/openjph/src/core/transform/ojph_transform_avx2.cpp"
cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/ia32intrin.h:305:10: error: use of undeclared identifier '__builtin_ia32_crc32hi'; did you mean '__builtin_arm_crc32h'?
cargo:warning= return __builtin_ia32_crc32hi(__C, __D);
cargo:warning= ^
cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/ia32intrin.h:305:10: note: '__builtin_arm_crc32h' declared here
exit status: 0
cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/mmintrin.h:50:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
cargo:warning= return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
cargo:warning= ^
cargo:warning=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/ia32intrin.h:326:10: error: use of undeclared identifier '__builtin_ia32_crc32si'

@aous72
Copy link
Owner

aous72 commented Aug 16, 2021

Hi Dao,

The x86intrin.h file is for Intel intrinsics, and since you are compiling for iOS or Android that runs on ARM, please use the suggested method for ARM compilation in README.md. In particular, use

cd build
cmake -DCMAKE_BUILD_TYPE=Release -DOJPH_DISABLE_INTEL_SIMD=ON ../
make

The important part here is "OJPH_DISABLE_INTEL_SIMD" that stops the inclusion of this file.

Let me know how it goes.

Kind regards,
Aous

@DAOCUONG
Copy link
Author

Thanks @aous72 i have successfully make it work in ios simulator time that it run on simulator and device is aground 0.2528867721557617 seconds . I hope when i build release the time will be dropped 5 times not sure it is the case i think if we use metal engine to process it will much better . I can lose the the issue if its ok with you

@aous72
Copy link
Owner

aous72 commented Aug 18, 2021

Sure. Thank you for the feedback. Let me know if how it goes.

@aous72 aous72 closed this as completed Aug 18, 2021
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

2 participants