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
aarch64-linux 交叉 freetype模块失败 #3553
Comments
Hello.
For example) what is OS ued?: Fedora ? CentOS ? Ubuntu ? Debian ? Alpine ? ... By analogy from the fragmentary information so far, I think that the cmake sets both FREETYPE_LIBRARIES(-lfreetype) and HARFBUZZ_LIBRARIES(-lharfbuzz) , but linker cannot find out these libraries. It seems that you should check your ld settings or re-install these libraries. It is hard to more advice/comment without additional information. |
I expect that you tried cross compile on x86_64 host for aarch64 target.
In this case, you should set correct CMAKE_SYSROOT, PKG_CONFIG_PATH, and ..., |
ubuntu18.04,是否需要交叉编译freetype和HARFBUZZ这两个库 |
Because you didn't answer about not all of your environment, I don't know However, this is question that how to cross compile, NOT an OpenCV bug. |
我也遇到了这个问题 make sh ./configure \
CC=aarch64-linux-gnu-gcc \
--host=arm-linux \
--prefix=${pwd}/_install \
--enable-shared \
--enable-static \
--with-zlib=no \
--enable-freetype-config \
--with-png=n
make -j$(nproc) && make install
environment > aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/9/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --without-target-system-zlib --enable-libpth-m2 --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
> uname -a
Linux xxxxx #85~20.04.1-Ubuntu SMP Mon Jul 17 09:42:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
Hello.
|
This is appendix. kmtr@kmtr-VMware-Virtual-Platform:~/work/opencv_contrib$ git diff -c
diff --git a/modules/freetype/CMakeLists.txt b/modules/freetype/CMakeLists.txt
index 6dd4aaf9..c4ed8233 100644
--- a/modules/freetype/CMakeLists.txt
+++ b/modules/freetype/CMakeLists.txt
@@ -3,8 +3,8 @@ if(APPLE_FRAMEWORK)
ocv_module_disable(freetype)
endif()
-ocv_check_modules(FREETYPE freetype2)
-ocv_check_modules(HARFBUZZ harfbuzz)
+# ocv_check_modules(FREETYPE freetype2)
+# ocv_check_modules(HARFBUZZ harfbuzz)
if(OPENCV_INITIAL_PASS)
if(NOT FREETYPE_FOUND) cmake -S opencv -B build4-arm64_3 -GNinja \
-DCMAKE_TOOLCHAIN_FILE=/home/kmtr/work/opencv/platforms/linux/aarch64-gnu.toolchain.cmake \
-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules \
-DFREETYPE_FOUND=ON \
-DFREETYPE_LIBRARIES=/lib/aarch64-linux-gnu/libfreetype.so \
-DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/ \
-DHARFBUZZ_FOUND=ON \
-DHARFBUZZ_LIBRARIES=/lib/aarch64-linux-gnu/libharfbuzz.so \
-DHARFBUZZ_INCLUDE_DIRS=/usr/include/harfbuzz/
kmtr@kmtr-VMware-Virtual-Platform:~/work/build4-arm64_3$ LANG=C file lib/libopencv_freetype.so.4.8.0
lib/libopencv_freetype.so.4.8.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=XXXX, not stripped |
BTW, Ubuntu supports multiarch.
If you can set correct environment parameters, cmake with pkg-config works well. So OpenCV 4.8.0 can be cross-compiled even if freetype wrapper is enabled . If any problems, there are your environment specific problems, it is not OpenCV bug. So I think this issue can/should be closed. PKG_CONFIG_PATH=/lib/aarch64-linux-gnu/pkgconfig \
PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu \
PKG_CONFIG_SYSROOT_DIR=/ \
cmake -S opencv -B build4-arm64_4 -GNinja \
-DCMAKE_TOOLCHAIN_FILE=/home/kmtr/work/opencv/platforms/linux/aarch64-gnu.toolchain.cmake \
-DOPENCV_EXTRA_MODULES_PATH=opencv_contrib/modules |
Thank you |
I think this issue can be closed with opencv/opencv#24629 in now. |
当我修改了freetype下的CMakeLists.list文件发现其能找到版本了,但是交叉编译链接时还是报错了。
这是我修改的文件内容
The text was updated successfully, but these errors were encountered: