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

Some cross compile question about Halide #4641

Closed
YutRetr0 opened this issue Feb 25, 2020 · 2 comments
Closed

Some cross compile question about Halide #4641

YutRetr0 opened this issue Feb 25, 2020 · 2 comments
Labels
build Issues related to building Halide and with CI

Comments

@YutRetr0
Copy link

YutRetr0 commented Feb 25, 2020

Hi, I use cmake and ninja (android-ndk-r20) to compile my project with halide.so. Some libraries can't be found:

E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libz.so.1, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libdl.so.2, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libpthread.so.0, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libstdc++.so.6, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libm.so.6, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libgcc_s.so.1, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: libc.so.6, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)
E:/buildtools/android-ndk-r20/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: warning: ld-linux-aarch64.so.1, needed by D:/projects/simple_MF_fused/build/../dep/halide/bin/libHalide.so, not found (try using -rpath or -rpath-link)

CMakeLists.txt

cmake_minimum_required(VERSION 3.5)
project(halide_test)

set(CAMKE_CXX_STANDARD 14)

set (CURRENT_PATH ${CMAKE_CURRENT_LIST_DIR}/../)
set (HALIDE_DISTRIB_DIR ${CURRENT_PATH}/dep/halide)
include(${HALIDE_DISTRIB_DIR}/halide.cmake)
set (DEP_LIB_PATH ${CURRENT_PATH}/dep)
set (SRC_PATH ${CURRENT_PATH}/src)
set (LIB_PATH ${CURRENT_PATH}/include)
set (LLVM_PATH ./)
set (HALIDE_INC ${CURRENT_PATH}/dep/halide/include)
set (HALIDE_LIB ${CURRENT_PATH}/dep/halide/lib/libHalide.a)
set (HALIDE_TOOLS ${CURRENT_PATH}/dep/halide/tools)
set (HALIDE_DYNAMIC ${CURRENT_PATH}/dep/halide/bin/libHalide.so)


include_directories (${HALIDE_INC}
                    ${HALIDE_TOOLS}
                    ${LIB_PATH})


add_executable (halide_test ${SRC_PATH}/main.cpp)


target_link_libraries (halide_test ${HALIDE_DYNAMIC} )
@alexreinking alexreinking added the build Issues related to building Halide and with CI label Feb 26, 2020
@alexreinking
Copy link
Member

alexreinking commented Feb 26, 2020

Halide's CMake support is about to be overhauled. See #4644

Hopefully this will simply be resolved when it lands. In the meantime, if you can share a whole project (ideally as a public git repo), along with a (possibly stubbed / dummy) source file that reproduces your issue, we can add it to our tests and make sure this works.

@YutRetr0
Copy link
Author

Hi, @alexreinking .

Your suggestion helps me a lot. At first, thank you so much. Then I got a question about using the android-ndk-toolchain to build a simple test project about generator on Windows10(I have been succeed on linux). Which halide's release version I should use? Or I must build the halide with android-ndk-toolchain? If it is necessary, I can push my simple project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to building Halide and with CI
Projects
None yet
Development

No branches or pull requests

2 participants