Pulse for Mobile

Hello,

I see plenty of documentation around building Pulse for Android when using it in Unity or Unreal projects, but I was curious if there was anything regarding native Android/iOS?

My assumption is that achieving this would require cross compiling a .so and then including it in the Android project structure.

Any guidance that saves me some headache would be greatly appreciated! Thank you!

Cross compiling instructions for android and ios

These instructions will build the targeted native .so files (we just drop them in Unity and Unity knows what to do with them) but they should also work in other application builds

Thank you that is very helpful.

Following that section for Android I run in to the following error:

./armv8a cmake -DPulse_JAVA_API:BOOL=OFF -B./android-build -H./engine -GNinja


– Setting install dir inside build dir /work/android-build
– Setting build type to ‘Release’ as none was specified.
– The C compiler identification is Clang 19.0.0
– The CXX compiler identification is Clang 19.0.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/aarch64-linux-android/bin/clang - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/aarch64-linux-android/bin/clang++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Development Development.Module Development.Embed) (found version “3.11.2”)
CMake Warning at CMakeLists.txt:218 (message):
The Pulse run utility uses python, which could not be found

CMake Warning at CMakeLists.txt:219 (message):
To use the run utility, setup python in this environment and reconfigure
cmake

– We are using protobuf
CMake Error at CMakeLists.txt:250 (message):
Unable to support Python API, cannot find Python3

Should I have to do something to the docker to enable Python?

Are you building integration or stable?

stable

We provide xcomplie.bat/.sh scripts that call the dockcross containers for you

But if you want to call it all yourself, just follow what is done in xcompile.cmake and dockcross.cmake, which does turn python off

I am even having problems with xcompile.sh. Looks like the manylinux build is working fine, but the android-arm64 is failing at this step:


[28/32] Performing configure step for ‘Pulse’
loading initial cache file /work/dockcross-builds/android-arm64/cmake/external/Pulse-prefix/tmp/Pulse-cache-Release.cmake
– Using preset install directory /work/dockcross-builds/android-arm64/install
– The C compiler identification is Clang 19.0.0
– The CXX compiler identification is Clang 19.0.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/aarch64-linux-android/bin/clang - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/aarch64-linux-android/bin/clang++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Checking native bind directory…
– Looking for Java in :
– Found Java: /usr/bin/java (found version “1.8.0.232”) found components: Development
– Using Java executable : /usr/bin/java
– Found JNI: /usr/aarch64-linux-android/sysroot/usr/include
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - not found
– Check if compiler accepts -pthread
– Check if compiler accepts -pthread - yes
– Found Threads: TRUE
CMake Warning (dev) at /usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:441 (message):
The package name passed to find_package_handle_standard_args (Protobuf)
does not match the name of the calling package (protobuf).  This can lead
to problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
/work/dockcross-builds/android-arm64/install/lib/cmake/protobuf/protobuf-module.cmake:162 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
/work/dockcross-builds/android-arm64/install/lib/cmake/protobuf/protobuf-config.cmake:21 (include)
CMakeLists.txt:338 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

– Could NOT find Protobuf (missing: Protobuf_PROTOC_EXECUTABLE) (found version “29.2.0”)
– Autogenerated code root : /work/dockcross-builds/android-arm64/Innerbuild/src
– !! NOT generating bindings !!!
– Copying binding directory from /work/dockcross-builds/manylinux2014-x64/Innerbuild/src/cpp/pulse
–  to /work/dockcross-builds/android-arm64/Innerbuild/src/cpp
– Configuring Pulse
– Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
– Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
– Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
– Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
– Performing Test COMPILER_HAS_DEPRECATED_ATTR
– Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
– Setting special ANDROID link options
– Configuring PulseTests
– Configuring CircuitOptimizationEngine
– Not installing CircuitOptimizationEngine
– Configuring HydrocephalusEngine
– Not installing HydrocephalusEngine
– Configuring MultiplexVentilationEngine
– Not installing MultiplexVentilationEngine
– Configuring PatientVariabilityEngine
– Not installing PatientVariabilityEngine
– Configuring SensitivityAnalysisEngine
– Not installing SensitivityAnalysisEngine
– Configuring PulseC
– Configuring PulseJNI
– Looking for zip shas
– Found Git: /usr/local/bin/git (found version “2.48.1”)
– Configuring done (25.5s)
– Generating done (18.1s)
– Build files have been written to: /work/dockcross-builds/android-arm64/Innerbuild
[29/32] Performing build step for ‘Pulse’
ninja: error: ‘src/java/com/kitware/pulse/cdm/bind/Actions.java’, needed by ‘src/java/CMakeFiles/PulseJava.dir/java_compiled_PulseJava’, missing and no known rule to make it
FAILED: cmake/external/Pulse-prefix/src/Pulse-stamp/Pulse-build /work/dockcross-builds/android-arm64/cmake/external/Pulse-prefix/src/Pulse-stamp/Pulse-build
cd /work/dockcross-builds/android-arm64/Innerbuild && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /work/dockcross-builds/android-arm64/cmake/external/Pulse-prefix/src/Pulse-stamp/Pulse-build
ninja: build stopped: subcommand failed.

Hmm… it should not be doing anything with Java…

Looks like I need to have $BUILD_JAVA rather than %BUILD_JAVA% in the xcompile.sh

See if changing that helps