We made some changes to the source code and then compiled the library(PulseC.dylib). It runs well on other platforms, but there is an issue on the Mac platform. The error is shown in the image below. We have been looking into it for a while but couldn’t figure out the cause. Could it be a problem with the compilation process? The library runs fine on the iOS platform as well.
Hi @andy
Are you on an intel based mac or a silicon based mac?
What branch is your code based on?
The current stable branch now builds this binary named as libPulseC.dylib
You will need to build this binary on both a silicon and intel based mac and add them to the Pulse asset in the approprate folder
And ensure the metadata is taged so the editor/application knows what platform these binaries are to be used on
The macOSi folder contains a binary for use by an intel based mac
The macOSs folder contains a binary for use by a silicon based mac
Hi, I am also compiling a Mac platform binary that is not working, I don’t know what’s wrong, can you help?
My computer is a MacStudio with M2Max Apple Silicon CPU.
First of all I followed the tutorial and performed these actions to compile the Mac platform :
1:
mkdir mac_builds
2:
cd mac_builds
3:
cd mac_builds
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DPulse_JAVA_API:BOOL=OFF -DPulse_PYTHON_API:BOOL=OFF -DPulse_DOWNLOAD_BASELINES:Bool=OFF … /engine
4:
make -j4
After the operation I found a lot of libraries in this directory first, I copied all the libraries to Plugins/Native/macOSs in Unity, and then when I started it in the editor it gave me an error:
DllNotFoundException: PulseC assembly:<unknown assembly> type:<unknown type> member:(null)
Pulse.PulseEngine.BaseAllocate (System.Int32 model, System.String data_dir) (at <f8d304e62fb148c4a6e981c8b7ebe0a3>:0)
Pulse.PulseEngineBase..ctor (Pulse.eModelType m, System.String data_dir) (at <f8d304e62fb148c4a6e981c8b7ebe0a3>:0)
Pulse.PulseEngine..ctor (Pulse.eModelType m, System.String data_dir) (at <f8d304e62fb148c4a6e981c8b7ebe0a3>:0)
Pulse.Unity.PulseEngineDriver.Start () (at Assets/Scripts/PulseEngineDriver.cs:66)
Here’s a screenshot of a lot of libraries, but there are actually a lot more than this one.
The dylib file will be in your bin directory
Oh, thanks a lot, it works fine in the editor now. However, when I try to compile it into an Xcode project it reports an error again, this time it seems to be saying that the two PulseC.dylibs are duplicates or something like that, here’s the completion error log, do you have any idea what it is?
Plugin 'PulseC.dylib' is used from several locations:
Assets/PulsePhysiologyEngine/Plugins/Native/macOSs/PulseC.dylib would be copied to <PluginPath>/PulseC.dylib
Assets/PulsePhysiologyEngine/Plugins/Native/macOSi/PulseC.dylib would be copied to <PluginPath>/PulseC.dylib
Please fix plugin settings and try again.
Plugins colliding with each other.
Build completed with a result of 'Failed' in 4 seconds (3792 ms)
While Unity might support building a single executable for both intel and silicon based mac machines, I don’t know if it really supports building an app with 2 native binaries for each platform. Did you try setting the standalone plugin targets for the Pulse binaries?
If that does not work, you will need to dig into Unity docs and figure out if it really can do this…
Since Pulse is implemented in C++, a native binary is provided to Unity that is platform specific. The Pulse assest is also looking for a specifically named binary file, so you can’t really change the file name
The fall back is to just build two separate Mac builds for each target platform (intel and silicon)