soumith / torch-android

Torch-7 for Android
BSD 3-Clause "New" or "Revised" License
275 stars 83 forks source link

compile failed for soname #90

Open peizhao opened 7 years ago

peizhao commented 7 years ago

follow the step to compile and meet the error:

  1. git submodule update --init --recursive
  2. modify WITH_CUDA=OFF in build.sh
  3. build.sh Then got the error below

[ 51%] Linking C shared module ../../../../install/libs/armeabi-v7a/libsundown.so cd /home/leon/temp/Torch/torch-android/torch-android/build/distro/pkg/sundown && /usr/bin/cmake -E cmake_link_script CMakeFiles/sundown.dir/link.txt --verbose=1 /home/leon/opt/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -fPIC -Wno-psabi --sysroot=/home/leon/opt/android-sdk-linux/ndk-bundle/plat forms/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/libsundown.so CMakeFiles/sundown.dir/src/autolink.c.o CMakeFiles/sundown.dir/src/buffer.c.o CMakeFiles/sundown.dir/src/markdown.c.o CMakeFiles/sundown.dir/src/stack.c.o CMakeFiles/sundown.dir/html/houdini_href_e.c.o CMakeFiles/sundown.dir/html/houdini_html_e.c.o CMakeFiles/sundown.dir/html/html.c.o CMakeFiles/sundown.dir/html/html_smartypants.c.o -L/home/leon/temp/Torch/torch-android/torch-android/install/libs/armeabi-v7a -lluajit "/home/leon/opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a"/home/leon/opt/android-sdk-linux/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 argumentcollect2: error: ld returned 1 exit status distro/pkg/sundown/CMakeFiles/sundown.dir/build.make:280: recipe for target '../install/libs/armeabi-v7a/libsundown.so' failed make[2]: [../install/libs/armeabi-v7a/libsundown.so] Error 1 make[2]: Leaving directory '/home/leon/temp/Torch/torch-android/torch-android/build' CMakeFiles/Makefile2:323: recipe for target 'distro/pkg/sundown/CMakeFiles/sundown.dir/all' failed make[1]: [distro/pkg/sundown/CMakeFiles/sundown.dir/all] Error 2

BrianOn99 commented 7 years ago

I met this problem before. It seems to be caused by breaking changes of cmake. Please try using cmake3.0.2

beodeulsoft commented 7 years ago

I met same error. I successfully compiled after changed as cmake 3.2.2.

wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz tar -xvf cmake-3.2.2.tar.gz cd cmake-3.2.2 ./bootstrap make make install