osamu620 / OpenHTJ2K

An open source implementation of ITU-T Rec.814 | ISO 15444-15 (a.k.a. HTJ2K).
BSD 3-Clause "New" or "Revised" License
36 stars 10 forks source link

Compiling problem on aarch64 platform #156

Closed v2aus closed 11 months ago

v2aus commented 11 months ago

Hello, when I compile the source code on aarch64 platform with g++ 8.5.0. The compiler gives out the error information below:

[ 3%] Building CXX object CMakeFiles/open_htj2k.dir/source/core/codestream/j2kmarkers.cpp.o In file included from /home/centos/OpenHTJ2K-0.2.1-origin/source/core/codestream/codestream.hpp:37, from /home/centos/OpenHTJ2K-0.2.1-origin/source/core/codestream/j2kmarkers.hpp:34, from /home/centos/OpenHTJ2K-0.2.1-origin/source/core/codestream/j2kmarkers.cpp:29: /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:41: error: variable or field ‘_mm256_storeu2_m128i’ declared void static inline void _mm256_storeu2_m128i(m128i_u* __addr_hi, m128i_u addr_lo, m256i a) { ^~~~~ /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:41: error: ‘__m128i_u’ was not declared in this scope /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:52: error: ‘addr_hi’ was not declared in this scope static inline void _mm256_storeu2_m128i(__m128i_u addr_hi, __m128i_u* addr_lo, m256i a) { ^~~~~ /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:52: note: suggested alternative: ‘caddr_t’ static inline void _mm256_storeu2_m128i(m128i_u __addr_hi, __m128i_u addr_lo, m256i a) { ^~~~~ __caddr_t /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:63: error: ‘m128i_u’ was not declared in this scope static inline void _mm256_storeu2_m128i(m128i_u* __addr_hi, m128i_u __addr_lo, m256i a) { ^~~~~ /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:74: error: ‘addr_lo’ was not declared in this scope static inline void _mm256_storeu2_m128i(m128i_u addr_hi, __m128i_u* addr_lo, m256i a) { ^~~~~ /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:74: note: suggested alternative: ‘caddr_t’ static inline void _mm256_storeu2_m128i(m128i_u __addr_hi, __m128i_u addr_lo, m256i a) { ^~~~~ __caddr_t /home/centos/OpenHTJ2K-0.2.1-origin/source/core/common/utils.hpp:62:85: error: ‘m256i’ was not declared in this scope static inline void _mm256_storeu2_m128i(m128i_u* __addr_hi, m128i_u* __addr_lo, m256i a) {

and the cmake output information is:

-- The CXX compiler identification is GNU 8.5.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Performing Test COMPILER_SUPPORTS_CXX14 -- Performing Test COMPILER_SUPPORTS_CXX14 - Success -- Performing Test COMPILER_SUPPORTS_CXX17 -- Performing Test COMPILER_SUPPORTS_CXX17 - Success -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) -- aarch64 GNU -- Thread library found -- OPENHTJ2K_THREAD is set -- OPENHTJ2K_ENABLE_ARM_NEON is set -- Configuring done -- Generating done -- Build files have been written to: /home/centos/OpenHTJ2K-0.2.1-origin/build

osamu620 commented 11 months ago

Thank you for reporting this issue. b021173 may fix this problem. Could you try fix_utils branch?

v2aus commented 11 months ago

Thank you for reporting this issue. b021173 may fix this problem. Could you try fix_utils branch?

Thank you for fixing the error. The problem has been solved.

v2aus commented 11 months ago

Thank you for reporting this issue. b021173 may fix this problem. Could you try fix_utils branch?

I compiled the 0.2.2 version. And I met another problem:

[ 80%] Linking CXX shared library bin/libopen_htj2k_R.so [ 80%] Built target open_htj2k [ 83%] Building CXX object CMakeFiles/open_htj2k_dec.dir/source/apps/decoder/main_dec.cpp.o [ 87%] Linking CXX executable bin/open_htj2k_dec bin/libopen_htj2k_R.so: undefined reference to typeinfo for std::filesystem::__cxx11::filesystem_error' bin/libopen_htj2k_R.so: undefined reference tostd::filesystem::cxx11::path::_M_split_cmpts()' bin/libopen_htj2k_R.so: undefined reference to `std::filesystem::file_size(std::filesystem::cxx11::path const&)' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/open_htj2k_dec.dir/build.make:98: bin/open_htj2k_dec] Error 1 make[1]: [CMakeFiles/Makefile2:232: CMakeFiles/open_htj2k_dec.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

I googled, and I found the solution, which is adding below code into CmakeLists.txt file:

target_link_libraries(open_htj2k PUBLIC stdc++fs)