Building Newton with the Android NDK

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Building Newton with the Android NDK

Postby Julio Jerez » Fri Mar 27, 2020 11:03 am

Slick wrote:No I'm developing on Windows for Android (starting to again).

https://developer.android.com/ndk/downloads


I download this: android-ndk-r21-windows-x86_64.zip

but I do not really undertand how this works. ther is no install and I do no find any doc anywhere.
I see a Cmake thing but hwo do I use that?
I do not get it.
I find the google style of software engineering atrocious. all their tool are quite horrible.

anyway if you can point me at to how to get this. I see that visual studio has and arm configuration setting I wee if I can investigate how to set that up. but as if stand now I can't get anythong to compile, not even a vanilla function.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building Newton with the Android NDK

Postby Julio Jerez » Fri Mar 27, 2020 12:52 pm

I now have the visual studio arm configuration compiling.
-It only build the core libraries, because some of the thsi party library do really compile for arm.
-the plugins do not compile because they are x86 simd specific. I need to make a Neon specific plugin but that is trivial
-the dgVector for now resolve to the scalar version. the next step is to implement the neo version using the code provided by execomrt.
I will try over the weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building Newton with the Android NDK

Postby Dave Gravel » Fri Mar 27, 2020 5:11 pm

Hi Julio,
Do you have install the Java android extention in visual studio ?
If I remember good I think you need it for compile android sdk projects.

Exemple:
https://sites.google.com/site/orionx3d/a1.jpg
https://sites.google.com/site/orionx3d/a2.jpg
https://sites.google.com/site/orionx3d/a3.jpg
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Building Newton with the Android NDK

Postby Slick » Sun Mar 29, 2020 5:10 am

Julio Jerez wrote:
Slick wrote:No I'm developing on Windows for Android (starting to again).

https://developer.android.com/ndk/downloads


I download this: android-ndk-r21-windows-x86_64.zip

but I do not really undertand how this works. ther is no install and I do no find any doc anywhere.
I see a Cmake thing but hwo do I use that?
I do not get it.
I find the google style of software engineering atrocious. all their tool are quite horrible.

anyway if you can point me at to how to get this. I see that visual studio has and arm configuration setting I wee if I can investigate how to set that up. but as if stand now I can't get anythong to compile, not even a vanilla function.


After you download the zip file just extract it to where you want it to be or extract and copy. For example mine is at S:\NDK-r21. There is no installer because it runs from a command prompt. The ndk-build command starts the build. There are docs on the ndk that you read to understand. You bascically need an android.mk and an application.mk which tells the build what source files to use; where the headers are; etc.

You need a few environment variables:
ANDROID_NDK S:\NDK-r21
NDK_PROJECT_PATH S:\And2020\Ogre (the project you are trying to build. Beneath this folder create a folder called jni and put the android.mk and application.mk files in there.)

You run the ndk-build from the folder above the jni folder so S:\And2020\Ogre in my example. You have to set the environment variables before opening the command prompt.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Building Newton with the Android NDK

Postby Slick » Sun Mar 29, 2020 5:12 am

Some documentation is here. Just dig around.

https://developer.android.com/ndk/guides/ndk-build
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Building Newton with the Android NDK

Postby Slick » Mon Apr 27, 2020 10:07 am

Just for fun (and I'm having some linking problems) I tried CMake again. Still no joy for an Android build.

I tried Cmake and set the generator to ninja (for cross compiling).

Code: Select all
[7/222] Building CXX object sdk/dgCore/CMakeFiles/dgCore.dir/dgGeneralMatrix.cpp.o
FAILED: sdk/dgCore/CMakeFiles/dgCore.dir/dgGeneralMatrix.cpp.o
S:\NDK-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi16 --gcc-toolchain=S:/NDK-r21/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=S:/NDK-r21/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -D_CRT_SECURE_NO_WARNINGS -D_POSIX_VER -I../sdk/dModel -I../sdk/dVehicle -I../sdk/dgMeshUtil -I../sdk/dCustomJoints -I../sdk/dVehicle/dPlayerController -I../sdk/dVehicle/dVehicleMultiBody -I../sdk/dgCore/. -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Oz -DNDEBUG  -fPIC   -fPIC -fpermissive -std=c++11 -MD -MT sdk/dgCore/CMakeFiles/dgCore.dir/dgGeneralMatrix.cpp.o -MF sdk\dgCore\CMakeFiles\dgCore.dir\dgGeneralMatrix.cpp.o.d -o sdk/dgCore/CMakeFiles/dgCore.dir/dgGeneralMatrix.cpp.o -c ../sdk/dgCore/dgGeneralMatrix.cpp
In file included from ../sdk/dgCore/dgGeneralMatrix.cpp:23:
In file included from ../sdk/dgCore/./dgGeneralMatrix.h:28:
In file included from ../sdk/dgCore/./dgVector.h:33:
../sdk/dgCore/./dgVectorScalar.h:414:10: error: invalid use of incomplete type 'dgBigVector'
                return dgBigVector (m_w, m_x, m_y, m_z);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sdk/dgCore/./dgTypes.h:297:7: note: forward declaration of 'dgBigVector'
class dgBigVector;
      ^
1 error generated.
[8/222] Building CXX object sdk/dgCore/CMakeFiles/dgCore.dir/dgConvexHull4d.cpp.o
FAILED: sdk/dgCore/CMakeFiles/dgCore.dir/dgConvexHull4d.cpp.o
S:\NDK-r21\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi16 --gcc-toolchain=S:/NDK-r21/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=S:/NDK-r21/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -D_CRT_SECURE_NO_WARNINGS -D_POSIX_VER -I../sdk/dModel -I../sdk/dVehicle -I../sdk/dgMeshUtil -I../sdk/dCustomJoints -I../sdk/dVehicle/dPlayerController -I../sdk/dVehicle/dVehicleMultiBody -I../sdk/dgCore/. -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Oz -DNDEBUG  -fPIC   -fPIC -fpermissive -std=c++11 -MD -MT sdk/dgCore/CMakeFiles/dgCore.dir/dgConvexHull4d.cpp.o -MF sdk\dgCore\CMakeFiles\dgCore.dir\dgConvexHull4d.cpp.o.d -o sdk/dgCore/CMakeFiles/dgCore.dir/dgConvexHull4d.cpp.o -c ../sdk/dgCore/dgConvexHull4d.cpp
In file included from ../sdk/dgCore/dgConvexHull4d.cpp:27:
In file included from ../sdk/dgCore/./dgGoogol.h:29:
In file included from ../sdk/dgCore/./dgVector.h:33:
../sdk/dgCore/./dgVectorScalar.h:414:10: error: invalid use of incomplete type 'dgBigVector'
                return dgBigVector (m_w, m_x, m_y, m_z);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sdk/dgCore/./dgTypes.h:297:7: note: forward declaration of 'dgBigVector'
class dgBigVector;
      ^
1 error generated.
ninja: build stopped: subcommand failed.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests

cron