-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fcc4aa
commit c221a0f
Showing
11 changed files
with
752 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# `osim.{a,lib}` | ||
|
||
> A hack to make using/building OpenSim easier. | ||
`osim` attempts to provide a build(system) for OpenSim where: | ||
|
||
- All of its dependencies *may* be built as static libraries from source | ||
using only Cmake and a C/C++ compiler, with the ability to choose where | ||
to source `libBLAS` and `libLACK` via cmake's `find_package`'s customization | ||
points. | ||
|
||
- Simbody and OpenSim are unified into a single `CMakeLists.txt` file | ||
that produces a single statically-linkable target: `osim.{a,lib}` | ||
|
||
- No compiler flags are performed by the build, so that downstream code | ||
can easily modify the build with the appropriate environment variables | ||
(e.g. `CXXFLAGS`) | ||
|
||
- The `CMakeLists.txt` file is compatible with downstream projects building | ||
it via `add_subdirectory` (+`target_link_libraries(... osim)`), which | ||
is useful for downstream developers that want to modify Simbody/OpenSim | ||
in-place while building their project. | ||
|
||
Secondarily, the longer-term goal of this project would be to provide simplified | ||
CPython bindings to OpenSim that are compatible with numpy, pandas, and matplotlib, | ||
because I know the researchers <3 that. | ||
|
||
# Differences from OpenSim | ||
|
||
- **Moco is not supported**. It pulls in a bunch of additional third-party code, | ||
which makes building OpenSim much more complicated than necessary. [OpenSim Creator](https://github.com/ComputationalBiomechanicsLab/opensim-creator) | ||
doesn't use Moco, so it was dropped entirely. | ||
|
||
- **The API must be manually initialized**. OpenSim's library initialization code now | ||
no longer automatically runs during static initialization. It is incompatible | ||
with static linking, which can muddle up static initialization order. Instead, | ||
downstream code should manually call the `RegisterTypes_` when the application | ||
starts. See `src/example_app.cpp` for an example of this. | ||
|
||
|
||
# Building | ||
|
||
```bash | ||
# get simbody, opensim, OpenBLAS (optional), and spdlog sources | ||
git submodule update --init --recursive | ||
|
||
# configure third-party dependencies build | ||
cmake -S third_party -B deps-build -DCMAKE_INSTALL_PREFIX=${PWD}/deps-install | ||
# optional: use `-DOSIMDEPS_GET_OPENBLAS=OFF` to skip OpenBLAS if you're | ||
# planning on using an OS-provided BLAS+LAPACK | ||
|
||
# build + install third-party dependencies | ||
cmake --build deps-build | ||
|
||
# configure osim (Simbody + OpenSim) build | ||
cmake -S . -B build -DCMAKE_PREFIX_PATH=${PWD}/deps-install | ||
|
||
# build osim | ||
cmake --build build | ||
|
||
# e.g.: this is why it's handy to build OpenBLAS /w static linking etc. | ||
lddtree build/example_app | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule opensim-core
updated
from 1e0d8b to 7bcfa2