NVIDIAGameWorks / PhysX-3.4

NVIDIA PhysX SDK 3.4
https://www.nvidia.com/
2.35k stars 274 forks source link

How build under android? #19

Closed galek closed 5 years ago

galek commented 7 years ago

Hi

I'm trying building in target for android under windows, using tegra-toolkit. how build it?

ndk-build returned "Could not find application project directory"

galek commented 7 years ago

I'm installed msys(using mingw-get), but i got what include files not found (string.h)

galek commented 7 years ago

Similiar problem: https://devtalk.nvidia.com/default/topic/785331/building-physx-3-3-2-for-android/

AlesBorovicka commented 7 years ago

Hi, there is a readme - how to build android in: https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PhysX_3.4/readme_android.html You need to copy required stuff into externals and then setup needed env variables in order to use compilation scripts in the Tools/android-dev.

galek commented 7 years ago

Borous, thanks for reply. All 3dparty-libs alredy copied. (+variant with fixed makefile for latest TDK)

Using Helpers result:

Nick@Nick-ПК /d/projects/ngtech/Development/Externals/physx/Tools/android-dev
$ physx-make
/d/projects/ngtech/Development/Externals/physx/Source/compiler/android16 /d/proj
ects/ngtech/Development/Externals/physx/Tools/android-dev
Need a Config!
/d/projects/ngtech/Development/Externals/physx/Tools/android-dev
Nick@Nick-ПК /d/projects/ngtech/Development/Externals/physx/Tools/android-dev
$

if directrly call from compiler directory:

Nick@Nick-ПК /d/projects/ngtech/Development/Externals/physx/Source/compiler/andr
oid16
$ make $config -j4
PhysXCommon: compiling checked ./../../foundation/src/PsAllocator.cpp...
PhysXCommon: compiling checked ./../../foundation/src/PsAssert.cpp...
PhysXCommon: compiling checked ./../../foundation/src/PsErrorHandler.cpp...
PhysXCommon: compiling checked ./../../foundation/src/PsFastIPC.cpp...
In file included from ./../../../Include/foundation/PxAssert.h:20:0,
                 from ./../../foundation/src/PsAssert.cpp:13:
./../../../Include/foundation/Px.h:25:20: fatal error: string.h: No such file or
 directory
 #include <string.h>
                    ^
compilation terminated.
In file included from ./../../../Include/foundation/PxErrors.h:20:0,
                 from ./../../foundation/src/PsErrorHandler.cpp:13:
./../../../Include/foundation/Px.h:25:20: fatal error: string.h: No such file or
 directory
 #include <string.h>
                    ^
commake: p*** [build/PhysXCommon_checked/foundation/src/PsAssert.cpp.o] Error 1i
lmake: a*** Waiting for unfinished jobs....ti
on terminated.
In file included from ./../../../Include/foundation/PxAllocatorCallback.h:21:0,
                 from ./../../foundation/include/PsAllocator.h:17,
                 from ./../../foundation/src/PsAllocator.cpp:14:
./../../../Include/foundation/Px.h:25:20: fatal error: string.h: No such file or
 directory
 #include <string.h>
                    ^
make: c*** [build/PhysXCommon_checked/foundation/src/PsErrorHandler.cpp.o] Error
 1o
pilation terminated.
./../../foundation/src/PsFastIPC.cpp:13:19: fatal error: stdio.h: No such file o
r directory
 #include <stdio.h>
                   ^
compilation terminated.
make: *** [build/PhysXCommon_checked/foundation/src/PsAllocator.cpp.o] Error 1
make: *** [build/PhysXCommon_checked/foundation/src/PsFastIPC.cpp.o] Error 1

Nick@Nick-ПК /d/projects/ngtech/Development/Externals/physx/Source/compiler/andr
oid16
$

Env-varibles:

export ANDROID_CONFIG=android16; export MAKE_THREADS=4; export JAVA_HOME=$PWD/../../externals/jdk

AlesBorovicka commented 7 years ago

You need to call it with config for example: physx-make debug

galek commented 7 years ago

Borous, already.(physx-make release). Result is similiar: not found

AlesBorovicka commented 7 years ago

The stdio.h is expected to be in: \Externals\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.8\include-fixed\stdio.h

galek commented 7 years ago

Borous, yep, it's file exist

AlesBorovicka commented 7 years ago

Then you might have something locally defined that is breaking your build. Please check: https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PhysX_3.4/Source/compiler/android16/Makefile https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PhysX_3.4/Source/compiler/android16/Makefile.PxFoundation.mk

galek commented 7 years ago

Don't know. Installed: Latest tegra-toolkit Visual studio android kit Mingw32 with msys

in any case thanks for reply

AlesBorovicka commented 7 years ago

You can try to compile it under linux by changing the NDK binary to linux: NDK_BIN_DIR = ../../../../Externals/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/bin

galek commented 7 years ago

For linux build(not android) - is successfuly. but this makefile designed for windows

I will try