opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
800 stars 323 forks source link

Clean up CI script, add Mac arm64 and Ubuntu 22 builds #3946

Closed nickbianco closed 4 weeks ago

nickbianco commented 1 month ago

Fixes issue #3944

Brief summary of changes

Testing I've completed

Ran the CI, and ran both the Windows and Mac performance analysis workflows.

Looking for feedback on...

CHANGELOG.md (choose one)

Performance analysis

Platform: Mac, GitHub Actions runner

Test Name lhs [secs] stderr [secs] rhs [secs] stderr [secs] Speedup
Arm26 0.35 0.72 0.36 0.78 0.97
ToyDropLanding_function_based_paths 3.57 0.00 3.59 0.00 0.99
passive_dynamic_noanalysis 1.12 0.00 1.13 0.00 0.99
ToyDropLanding 3.92 0.00 3.93 0.00 1.00
Gait2354 0.21 0.00 0.21 0.00 1.00
ToyDropLanding_fbp_stepwisereg 3.63 0.00 3.63 0.00 1.00
passive_dynamic 1.71 0.00 1.71 0.00 1.00
MocoSquatToStand 3.45 0.00 3.46 0.00 1.00
ToyDropLanding_nomuscles 0.20 0.00 0.20 0.00 1.00
ellipsoid_wrap_function_based_paths 1.09 0.00 1.08 0.00 1.00
ellipsoid_wrap 1.28 0.00 1.28 0.00 1.00
MocoSlidingMass 0.57 0.00 0.57 0.00 1.00
RajagopalModel 3.14 0.00 3.14 0.00 1.00

This change is Reviewable

aymanhab commented 1 month ago

@nickbianco For the record the LD_LIBRARY_PATH changes appear to have been lost before the python tests are run on ubuntu. If everything else passes though then feel free to merge and I will take it on.

nickbianco commented 4 weeks ago

@aymanhab, gotcha. As discussed, we can come back around to this later to resolve the Python testing issues on Ubuntu.

nickbianco commented 4 weeks ago

Installing the Mac Arm64 build into a local conda environment fails. @aymanhab, thoughts? Looks like the rpaths are not being set correctly?

Python 3.10.15 (main, Oct  3 2024, 02:24:49) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import opensim as osim
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/__init__.py", line 18, in <module>
    from .simbody import *
  File "/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/simbody.py", line 10, in <module>
    from . import _simbody
ImportError: dlopen(/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/_simbody.so, 0x0002): Library not loaded: @rpath/libosimExampleComponents.dylib
  Referenced from: <35EB33C3-F08F-3BC8-A249-794230C5E39D> /Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/_simbody.so
  Reason: tried: '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/../../../sdk/lib/libosimExampleComponents.dylib' (no such file), '/Users/runner/work/opensim-core/opensim-core-install/sdk/lib/libosimExampleComponents.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/opensim-core/opensim-core-install/sdk/lib/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/../../../sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/Users/runner/work/opensim-core/opensim-core-install/sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/opensim-core/opensim-core-install/sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/../../../sdk/lib/libosimExampleComponents.dylib' (no such file), '/Users/runner/work/opensim-core/opensim-core-install/sdk/lib/libosimExampleComponents.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/opensim-core/opensim-core-install/sdk/lib/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/lib/python3.10/site-packages/opensim/../../../sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/Users/runner/work/opensim-core/opensim-core-install/sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/opensim-core/opensim-core-install/sdk/Simbody/lib/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/bin/../lib/libosimExampleComponents.dylib' (no such file), '/Users/nbianco/miniconda3/envs/zmp/bin/../lib/libosimExampleComponents.dylib' (no such file)
aymanhab commented 4 weeks ago

@nickbianco Conda makes some assumptions about layout. When we build conda package, the conda build system modifies rpaths accordingly. I'd test installing in non conda environment using setup.py etc. but not sure conda would work out of the box. I'd also test java/matlab Just let me know what you want me to try/test to get this over the finish line

nickbianco commented 4 weeks ago

Yeah, it looks like python -m pip install . doesn't install the .dylibs anywhere in the conda environment. I'll try a different install approach and see what I get.

nickbianco commented 4 weeks ago

Using a Python venv fails too: nothing is copied into the /lib folder of the venv.

nickbianco commented 4 weeks ago

@aymanhab, this is ready for review. I didn't test the "Build GUI" workflow; let me know if you'd like that tested as well.

aymanhab commented 4 weeks ago

Would be good to test just for completeness though it has no dependencies on ci scripts.

nickbianco commented 4 weeks ago

@aymanhab, the GUI build job fails, I think because a personal access token needs to be added or updated. It's up to you if you consider that blocking here.

aymanhab commented 4 weeks ago

Thanks for trying it out @nickbianco Definitely not blocking, will review accordingly.

nickbianco commented 4 weeks ago

As discussed, the Ubuntu 22 failure is unrelated and the GUI build job will be resolved in a future PR.

Thanks @aymanhab!