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

Test/Update build for latest Crystax #18

Open
JeroMiya opened this issue Jan 13, 2016 · 3 comments
Open

Test/Update build for latest Crystax #18

JeroMiya opened this issue Jan 13, 2016 · 3 comments

Comments

@JeroMiya
Copy link
Contributor

We have reports that OSVR-Android-Build doesn't build successfully in CrystaX 10.3.1. Test the build in the latest CrystaX and fix build issues as needed.

@mebalzer
Copy link

This error occurred when trying to use the latest Crystax 10.3, I get further with 10.1.

E:/OSVR-Android-Build/src/libfunctionality/vendor/gtest-1.7.0/src/gtest-death-test.cc: In function 'pid_t testing::internal::ExecDeathTestSpawnChild(char* const*, int)':
E:/OSVR-Android-Build/src/libfunctionality/vendor/gtest-1.7.0/src/gtest-death-test.cc:1074:73: error: 'clone' was not declared in this scope
child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);

@JeroMiya
Copy link
Contributor Author

Yep, here is the error I'm getting:

9>------ Build started: Project: osvr_json_to_c_host, Configuration: Debug x64 ------
9>  Building Custom Rule C:/Users/Jeremy/JeroMiya/OSVR-Android-Build/src/CMakeLists.txt
9>  CMake does not need to re-run because C:\Users\Jeremy\JeroMiya\OSVR-Android-Build-build\src\CMakeFiles\generate.stamp is up-to-date.
9>  Creating directories for 'osvr_json_to_c_host'
9>  No download step for 'osvr_json_to_c_host'
9>  No update step for 'osvr_json_to_c_host'
9>  No patch step for 'osvr_json_to_c_host'
9>  Performing configure step for 'osvr_json_to_c_host'
5>  Scanning dependencies of target gtest
5>  [ 29%] Building CXX object vendor/gtest-1.7.0/CMakeFiles/gtest.dir/src/gtest-all.cc.o
5>  In file included from C:\Users\Jeremy\JeroMiya\OSVR-Android-Build\src\libfunctionality\vendor\gtest-1.7.0\src\gtest-all.cc:43:0:
5>  C:\Users\Jeremy\JeroMiya\OSVR-Android-Build\src\libfunctionality\vendor\gtest-1.7.0/src/gtest-death-test.cc: In function 'pid_t testing::internal::ExecDeathTestSpawnChild(char* const*, int)':
5>  C:\Users\Jeremy\JeroMiya\OSVR-Android-Build\src\libfunctionality\vendor\gtest-1.7.0/src/gtest-death-test.cc:1074:73: error: 'clone' was not declared in this scope
5>       child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
5>                                                                           ^
9>  -- The C compiler identification is MSVC 18.0.40629.0
5>  make.exe[2]: *** [vendor/gtest-1.7.0/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
5>  make.exe[1]: *** [vendor/gtest-1.7.0/CMakeFiles/gtest.dir/all] Error 2
5>  make.exe: *** [all] Error 2
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 2.

OSVR-Core also fails to build for me:

10>------ Build started: Project: OSVR-Core, Configuration: Debug x64 ------
10>  Building Custom Rule C:/Users/Jeremy/JeroMiya/OSVR-Android-Build/src/CMakeLists.txt
10>  CMake does not need to re-run because C:\Users\Jeremy\JeroMiya\OSVR-Android-Build-build\src\CMakeFiles\generate.stamp is up-to-date.
10>  Creating directories for 'OSVR-Core'
10>  No download step for 'OSVR-Core'
10>  No update step for 'OSVR-Core'
10>  No patch step for 'OSVR-Core'
10>  Performing configure step for 'OSVR-Core'
10>  -- Could not get revision information from Git! Calling this just version 0.6!
10>  -- Could NOT find OpenGL (missing:  OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) 
10>  -- Could NOT find SDL2 (missing:  SDL2_LIBRARY SDL2_INCLUDE_DIR SDL2_SDLMAIN_LIBRARY) 
10>  -- Looking for include file pthread.h
10>  -- Looking for include file pthread.h - found
10>  -- Looking for pthread_create
10>  -- Looking for pthread_create - found
10>  -- Found Threads: TRUE  
10>  -- Found JsonCpp: C:/Users/Jeremy/JeroMiya/OSVR-Android-Build-build/install/lib/cmake/jsoncpp  
10>  -- Performing Test COMPILER_SUPPORTS_CXX11
10>  -- Performing Test COMPILER_SUPPORTS_CXX11 - Success
10>  -- Performing Test COMPILER_SUPPORTS_CXX0X
10>  -- Performing Test COMPILER_SUPPORTS_CXX0X - Success
10>  -- Performing Test OSVR_HAVE_STD_SHARED_PTR
10>  -- Performing Test OSVR_HAVE_STD_SHARED_PTR - Success
10>  -- Performing Test OSVR_HAVE_STD_UNIQUE_PTR
10>  -- Performing Test OSVR_HAVE_STD_UNIQUE_PTR - Success
10>  CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.3/Modules/FindBoost.cmake:1245 (message):
10>    Unable to find the requested Boost libraries.
10>  
10>    Boost version: 1.59.0
10>  
10>    Boost include path:
10>    C:/Users/Jeremy/Downloads/crystax-ndk-10.3.1/sources/boost/1.59.0/include
10>  
10>    Could not find the following static Boost libraries:
10>  
10>            boost_thread
10>            boost_system
10>            boost_date_time
10>            boost_chrono
10>            boost_program_options
10>            boost_filesystem
10>  
10>    No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
10>    directory containing Boost libraries or BOOST_ROOT to the location of
10>    Boost.
10>  Call Stack (most recent call first):
10>    cmake-local/BoostTargets.cmake:25 (find_package)
10>    CMakeLists.txt:295 (include)
10>  
10>  
10>  -- Found PythonInterp: C:/Users/Jeremy/Downloads/crystax-ndk-10.3.1/prebuilt/windows-x86_64/bin/python.exe (found version "2.7.5") 
10>  -- Configuring the VRPN suite version 07.34 using the CMake-based build system
10>  
10>  -- Found Libusb1: C:/Users/Jeremy/JeroMiya/OSVR-Android-Build-build/install/lib/libusb1.0.so  
10>  -- Found Java: C:/Program Files/Java/jdk1.8.0_60/bin/java.exe (found version "1.8.0.60") 
10>  -- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY) 
10>  CMake Error at C:/Users/Jeremy/JeroMiya/OSVR-Android-Build/android-cmake/android.toolchain.cmake:461 (message):
10>    Could not find neither Android NDK nor Android standalone toolchain.
10>  
10>        You should either set an environment variable:
10>          export ANDROID_NDK=~/my-android-ndk
10>        or
10>          export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
10>        or put the toolchain or NDK in the default path:
10>          sudo ln -s ~/my-android-ndk C:/Program Files (x86)/android-ndk
10>          sudo ln -s ~/my-android-toolchain /opt/android-toolchain
10>  Call Stack (most recent call first):
10>    C:/Users/Jeremy/JeroMiya/OSVR-Android-Build-build/src/OSVR-Core-prefix/src/OSVR-Core-build/CMakeFiles/3.3.0/CMakeSystem.cmake:6 (include)
10>    CMakeLists.txt:3 (project)
10>  
10>  
10>CUSTOMBUILD : CMake error : CMAKE_C_COMPILER not set, after EnableLanguage
10>CUSTOMBUILD : CMake error : Internal CMake error, TryCompile configure of cmake failed
10>  -- Configuring incomplete, errors occurred!
10>  See also "C:/Users/Jeremy/JeroMiya/OSVR-Android-Build-build/src/OSVR-Core-prefix/src/OSVR-Core-build/CMakeFiles/CMakeOutput.log".

@araujobsd
Copy link

araujobsd commented Jun 17, 2016

For the clone() function error, it is a regression on NDK 10.3.1, there is a commit[1] upstream that solved the issue.

What you can do for now is edit your local copy of mangled-sched.h and added the following code:

+   53 #if defined(__CRYSTAX__)
+   54 #define __USE_GNU 1
+   55 #endif
     56 
     57 #if defined(__USE_GNU)
     58 
     59 extern int clone(int (*)(void*), void*, int, void*, ...);

As you will see there are lots of mangled-sched.h in different directories, if you are not sure which one you should change, you can change all. First change one and overwrite all the other files as they are the same.

root@OSVR:/osvr/android/crystax-ndk-10.3.1# for i infind . -name mangled-sched.h | grep bionic; do cp ./platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/mangled-sched.h $i; done

However after that it will fail in a different stage that I'm checking now:

Scanning dependencies of target DummyPlugin
[ 52%] Building CXX object tests/cplusplus/CMakeFiles/DummyPlugin.dir/DummyPlugin.cpp.o
[ 58%] Linking CXX shared module ../../lib/DummyPlugin.so
/osvr/android/crystax-ndk-10.3.1/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: fatal error: -soname: must take a non-empty argument
collect2: error: ld returned 1 exit status
tests/cplusplus/CMakeFiles/DummyPlugin.dir/build.make:94: recipe for target 'lib/DummyPlugin.so' failed
make[5]: *** [lib/DummyPlugin.so] Error 1
CMakeFiles/Makefile2:1154: recipe for target 'tests/cplusplus/CMakeFiles/DummyPlugin.dir/all' failed
make[4]: *** [tests/cplusplus/CMakeFiles/DummyPlugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make[3]: *** [all] Error 2
src/CMakeFiles/libfunctionality.dir/build.make:110: recipe for target 'src/libfunctionality-prefix/src/libfunctionality-stamp/libfunctionality-build' failed
make[2]: *** [src/libfunctionality-prefix/src/libfunctionality-stamp/libfunctionality-build] Error 2
CMakeFiles/Makefile2:352: recipe for target 'src/CMakeFiles/libfunctionality.dir/all' failed
make[1]: *** [src/CMakeFiles/libfunctionality.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

[1] crystax/android-platform-bionic@9041d6a

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