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

Compilation failed with Android ndk r13b and cmake 3.5.2 #89

Open
wonjeon opened this issue Jan 30, 2017 · 4 comments
Open

Compilation failed with Android ndk r13b and cmake 3.5.2 #89

wonjeon opened this issue Jan 30, 2017 · 4 comments

Comments

@wonjeon
Copy link

wonjeon commented Jan 30, 2017

I tried to pull the source code and update the submodule, but it failed:

$ git submodule update --init --recursive
error: no such remote ref 6bd801e73eb5319f0d263a99bc5a15ce6e5ec16f
Fetched in submodule path 'distro/pkg/torch', but it did not contain 6bd801e73eb5319f0d263a99bc5a15ce6e5ec16f. Direct fetching of that commit failed.
Failed to recurse into submodule path 'distro'

Could you let me know how to resolve this issue? Thanks.

@borisfom
Copy link
Collaborator

If you are updating existing local tree, you may need to do git sync first.

@borisfom
Copy link
Collaborator

In fact, torch module commit was indeed not pushed; please try again.

@wonjeon
Copy link
Author

wonjeon commented Jan 31, 2017

Thanks for your response. It passed updating submodules with 'WITH_CUDA=OFF'. However, during compilation with 'build.sh', another errors occurred. I'm using cmake 3.5.2.
...
[ 48%] Linking C shared module ../../../../install/libs/armeabi-v7a/libpaths.so
cd /<...>/torch-android/build/distro/pkg/paths && /usr/bin/cmake -E cmake_link_script CMakeFiles/paths.dir/link.txt --verbose=1
/<...>/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -fPIC -Wno-psabi --sysroot=/<...>/Sdk/ndk-bundle/platforms/android-21/arch-arm -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -DDISABLE_POSIX_MEMALIGN -mthumb -fomit-frame-pointer -fno-strict-aliasing -O3 -DNDEBUG -Wl,--no-undefined -Wl,-allow-shlib-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname, -o ../../../../install/libs/armeabi-v7a/libpaths.so CMakeFiles/paths.dir/paths.c.o -L/<...>/torch-android/install/libs/armeabi-v7a -L/<...>/torch-android/install/lib -lluajit "/<...>/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a"
/<...>/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: fatal error: -soname: must take a non-empty argument
collect2: error: ld returned 1 exit status
distro/pkg/paths/CMakeFiles/paths.dir/build.make:98: recipe for target '../install/libs/armeabi-v7a/libpaths.so' failed
make[2]: *** [../install/libs/armeabi-v7a/libpaths.so] Error 1
make[2]: Leaving directory '/<...>/torch-android/build'
CMakeFiles/Makefile2:396: recipe for target 'distro/pkg/paths/CMakeFiles/paths.dir/all' failed
make[1]: *** [distro/pkg/paths/CMakeFiles/paths.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...

Which version of cmake have you tested? Thanks.

@wonjeon wonjeon changed the title git submodule update --init --recursive failed Compilation failed with Android ndk r13b and cmake 3.5.2 Feb 1, 2017
@peizhao
Copy link

peizhao commented Feb 9, 2017

I meet the same issue when using the cmake 3.5.1 and Android NDK.
You can change the target library from MODULE to SHARED to fix the issue of "soname: must take a non-empty argument", but after fix this , the compile also failed.

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

3 participants