Hi all, has anyone successfully compiled Pulse on the latest AppleSilicon Xcode16? I’m following the tutorial in the documentation and I don’t know the exact steps to follow.
I am using a command from the command line that generates a number of files, including an XcodeProject project file. I opened this project file and selected the target as ALL_BUILD and started compiling with Xcode and it reported some errors, but I don’t understand why. Where can I find a more detailed tutorial on compiling?
I used this command:
cmake …/engine/ -G Xcode -DCMAKE_TOOLCHAIN_FILE=/Volumes/HiWill_Work/Pulse/engine/cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE
The error info like blow:
I suggest you use the CMake GUI
Per the instructions, you need to enable and disable and set several options
You do not have all the necessary options specified in your command
My full build logMy ios.toolchaine.cmake fileHi there, hello and thank you very much for your reply! I was told by someone that this is caused by the fact that protobuf depends on absl and absl doesn’t provide a cmake build file for ios. My computer chip is Apple M2 Max, Xcode version number is 16.2.
My project project directory is “/Volumes/HiWillWork/Pulse/engine”, and my builds directory is “/Volumes/HiWillWork/Pulse/builds”.
First, I need to change ios.toolchain.cmake, and I’ve added four lines to it:
set(Pulse_NATIVE_BUILD_DIR “/Volumes/HiWill_Work/Pulse/builds/” CACHE FILEPATH “Pulse_NATIVE_BUILD_DIR path.”)
set(Pulse_C_AS_STATIC ON)
set(Pulse_JAVA_API OFF)
set(Pulse_PYTHON_API OFF)
Then I executed a command in the builds directory:
cmake /Volumes/HiWill_Work/Pulse/engine/ -G Xcode -DCMAKE_TOOLCHAIN_FILE=/Volumes/HiWill_Work/Pulse/engine/cmake/ios.toolchain. cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE
The above command can be executed successfully. But the next command immediately after it fails:
cmake --build . --config Release
My ios.toolchain.cmake is here , and the full build log is here, can you help me with that? I really need your help, I’ve been working on compiling iOS related work for the last few days, but this failure is making me very anxious and stressed.
Gotcha
I believe I remember seeing this too
Note, the instructions provided are for building the PulseC interface library that is required by Unity
This assumes you are building this to drop into your Unity project using Pulse
So the quickest thing you can do, is switch the protobuf version drop down to the last version without the ABSL dependency
I also build this iOS binary using an Intel based macos, which works just fine with abls
There are quite a bit of oddities with a silicon based macos that I run into (including this) that I will have to dig into, but not being an experienced macos person, will take a while, but I am going to try to build this and see what happens.
Per your log, it seems that absl built and installed just fine… it installed everything to /Volumes/HiWill_Work/Pulse/builds/install/lib/cmake/absl/
But it seems that protobuf was unable to find it…
It looks like you are trying to build the stable branch, which uses protobuf-27.3
Can you try building the integration branch, it is using protobuf-29.0-rc1
and I believe I also might have resolved some dependency ordering between absl and protobuf that might also be part of your problem.
Let me know what you try and how it goes, we’ll get you building, don’t worry!
Thank you very much for your reply and reassurance! After some attempts, such as manually adding ‘abs_DIR’ to ios.toolchain.cmake, I’m now able to compile protobuf, but it reports another error if I continue, and it feels like I’m going to crash! The error is something like the following:
-- Autogenerated code root : /Volumes/HiWill_Work/Pulse/builds/Innerbuild/src
-- !! NOT generating bindings !!!
-- Copying binding directory from /Volumes/HiWill_Work/Pulse/builds/Innerbuild/src/cpp/pulse
-- to /Volumes/HiWill_Work/Pulse/builds/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
-- Configuring PulseTests
-- Configuring PulseC
-- Looking for zip shas
-- Found Git: /Applications/Xcode.app/Contents/Developer/usr/bin/git (found version "2.39.5 (Apple Git-154)")
-- Configuring done (7.5s)
CMake Error at cmake/utilities/AddLibrary.cmake:78 (add_library):
Cannot find source file:
/Volumes/HiWill_Work/Pulse/builds/Innerbuild/src/cpp/pulse/cdm/bind/Actions.pb.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/cpp/CMakeLists.txt:10 (add_library_ex)
CMake Error at cmake/utilities/AddLibrary.cmake:78 (add_library):
No SOURCES given to target: Pulse
Call Stack (most recent call first):
src/cpp/CMakeLists.txt:10 (add_library_ex)
CMake Generate step failed. Build files cannot be regenerated correctly.
Command PhaseScriptExecution failed with a nonzero exit code
I’ve had a look and no files exist under “/Volumes/HiWill_Work/Pulse/builds/Innerbuild/src/cpp/pulse/”.
Here is the full log, check it out if you want!
It feels like some progress from before, thank you very much for your help.
This is from an issue from step 1 in the the iOS build instructions
Did you build Pulse on your system already?
It looks like you set the Pulse_NATIVE_BUILD_DIR
to the same directory you are building for iOS?
You need to build Pulse locally (not a cross compile build) before building for iOS in xcode
Then set Pulse_NATIVE_BUILD_DIR
to that native local build directory, then run cmake to build xcode / iOS to a different build directory
It looks like its trying to copy files from:
Copying binding directory from /Volumes/HiWill_Work/Pulse/builds/Innerbuild/src/cpp/pulse
– to /Volumes/HiWill_Work/Pulse/builds/Innerbuild/src/cpp
Oh, I kinda get it, I need to compile Pulse on a Mac platform (say under Pulse/mbuilds), and after that, I specify Pulse_NATIVE_BUILD_DIR as Pulse/mbuilds just now, right?
Thank you very much for your reply, I would like to ask if there is a more detailed tutorial on iOS compilation here? Or are there any tutorials on how to do it, like on youtube or something?
Hi, thank you very much, after some painful struggles and efforts now it seems to compile successfully, but some of the compiled files can’t be corresponded with the officially provided files, and there is a big gap between the file sizes, I don’t know if there is still a problem somewhere, anyway, there is some progress, thank you very much for your reply and support.
Here are all the compiled files, they are located under /builds/install/lib/, are these all the static libraries I need for the iOS platform? I found some files missing, such as CommonDataModel.a, DataModelBindings.a. Where can I find the documentation that explains exactly what libraries are needed for iOS platforms, right now I seem to be able to only compare against the official /Plugins/iOS files and come to some conclusions!