opensim-core
opensim-core copied to clipboard
[WIP] fix issues with dependencies build with Macs with arm64
FYI @aymanhab @nickbianco
Related to #3168
Brief summary of changes
- Update superbuild option for a Mac with arm64 architecture
- Add mechanism for using a pre-installed IPOPT
Testing I've completed
Works locally, though will fail often when using many cores (e.g., make -j8
) and sporadically with fewer (e.g., make -j4
). There seems to be a race somewhere for making directories during superbuild. Runners don't seem to be available for GitHub actions yet.
This version passes all OpenSim tests.
Looking for feedback on...
- Is this more surgical approach OK, or should we switch to this for all Mac builds?
- Is adding the option to use a pre-installed IPOPT overkill? I mainly used it for quicker testing locally when trying to isolate dependencies build issues.
- Not necessarily looking to merge right now (hence [WIP] tag), though this branch will be helpful to make sure I don't break other builds.
CHANGELOG.md (choose one)
TODO
@carmichaelong Just wanted to make sure I'm following your steps exactly:
-
I merged your branch onto 4.4
-
on dependencies build turn-off superbuild_ipopt, turn on use_ipopt_install based on the conversation above
-
is there an assumed separate "brew install ipopt" ? I guess I'm confused because you're not superbuilding ipopt but applying a patch, does it mean ipopt has to be built manually after the patch or are this taken care of by the make files?
-
Did you investigate using superbuild with a different hash(es) that support arm64 out of the box, or is that an overkill?
@aymanhab sorry, it was probably pretty unclear which instructions to use because it was a long discussion. I did make it work with the superbuild option, after trying a bunch of different ways to get metis, mumps, and ipopt. See the instructions below:
brew install cmake swig gcc pkgconfig autoconf libtool automake wget doxygen metis
git clone https://github.com/opensim-org/opensim-core.git
cd opensim-core
git switch dependencies-mac-arm64
cd ..
mkdir opensim_dependencies_build
cd opensim_dependencies_build
cmake ../opensim-core/dependencies \
-DCMAKE_INSTALL_PREFIX="../opensim_dependencies_install" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSUPERBUILD_ezc3d=ON \
-DOPENSIM_WITH_CASADI=ON \
-DOPENSIM_WITH_TROPTER=ON
make -j4
cd ..
mkdir opensim_build
cd opensim_build
cmake ../opensim-core \
-DCMAKE_INSTALL_PREFIX="../opensim_install" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_PYTHON_WRAPPING=OFF \
-DBUILD_JAVA_WRAPPING=OFF \
-DOPENSIM_DEPENDENCIES_DIR="../opensim_dependencies_install"
make -j8
ctest -j8
The use_ipopt_install
was a flag I was using often when trying different IPOPT installs. If we keep it, it would stay as advanced, but I'm not sure if we should keep it or not.
Also some responses to questions above to be clearer:
is there an assumed separate "brew install ipopt" ? I guess I'm confused because you're not superbuilding ipopt but applying a patch, does it mean ipopt has to be built manually after the patch or are this taken care of by the make files?
The last version I had adjusted the superbuild to work by pulling in and building a specific version of IPOPT, and then doing a small patch, and the superbuild should do this all for you.
Did you investigate using superbuild with a different hash(es) that support arm64 out of the box, or is that an overkill?
Buried in the issue discussion linked has some discussion on the different combinations of mumps, metis, and ipopt versions I've tried. Some of them build, some of them build but fail tests, and some of them build and pass tests (and one of these combinations should be the current superbuild settings here). I'm not sure maybe about what hash(es) you are referring to, so please point out what that might mean and maybe I can remember some info that might be useful there!