Skip to content

Commit

Permalink
Fix pymomentum link error on macOS (#115)
Browse files Browse the repository at this point in the history
Summary:
Fix pymomentum link error by replacing `Python::Python` to `Python::Module`

## Checklist:

- [x] Adheres to the [style guidelines](https://facebookincubator.github.io/momentum/docs/developer_guide/style_guide)
- [x] Codebase formatted by running `pixi run lint`

Pull Request resolved: #115

Test Plan:
```
pixi r test
pixi r test_pymomentum
```

Reviewed By: yutingye

Differential Revision: D64991401

Pulled By: jeongseok-meta

fbshipit-source-id: be5026543e8df71622f36105c4260626c9403ba3
  • Loading branch information
jeongseok-meta authored and facebook-github-bot committed Oct 25, 2024
1 parent d8d9481 commit fdc25fe
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 34 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,19 @@ jobs:
pixi run cmake --build momentum/examples/hello_world/build
pymomentum:
name: pymomentum-${{ matrix.platform }}
name: pymomentum-${{ matrix.os == 'macos-latest-large' && 'mac-x86_64' || 'mac-arm64' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: mac-arm
- os: macos-latest-large
platform: mac-intel
os: [macos-latest, macos-latest-large]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
cache: true
- name: Build PyMomentum
# TODO: Change to test_pymomentum once segfault on import is fixed
- name: Build and test PyMomentum
run: |
pixi run build_pymomentum
pixi run test_pymomentum
4 changes: 0 additions & 4 deletions .github/workflows/ci_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ jobs:
environments: ${{ matrix.pixi_env }}
cache: true

- name: Check pixi environments
run: |
pixi info
- name: Build PyMomentum
run: |
pixi run -e ${{ matrix.pixi_env }} test_pymomentum
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# python
*.egg-info/
*.cpython-*.so
*.pyc

# build artifacts
build/
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,10 @@ pixi add momentum

```
conda install -c conda-forge momentum-cpp
conda install -c conda-forge pymomentum # Linux only
conda install -c conda-forge pymomentum # Windows is not supported yet
conda install -c conda-forge momentum
```

#### Micromamba

```
micromamba install -c conda-forge momentum-cpp
micromamba install -c conda-forge pymomentum # Linux only
micromamba install -c conda-forge momentum
```

### Building Momentum from Source

#### Prerequisite
Expand Down
10 changes: 1 addition & 9 deletions momentum/website/docs/02_user_guide/01_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@ pixi add momentum

```
conda install -c conda-forge momentum-cpp
conda install -c conda-forge pymomentum # Linux only
conda install -c conda-forge pymomentum # Windows is not supported yet
conda install -c conda-forge momentum
```

### Micromamba

```
micromamba install -c conda-forge momentum-cpp
micromamba install -c conda-forge pymomentum # Linux only
micromamba install -c conda-forge momentum
```

## Building Momentum from Source

### Prerequisite
Expand Down
24 changes: 22 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,17 @@ pytorch = ">=2.4.0"
[target.osx.tasks]
build = { cmd = "cmake --build build -j --target all", depends_on = ["config"] }
build_pymomentum = { cmd = "pip install -e ." }
# TODO: Add test_pymomentum once segfault on import is fixed
test_pymomentum = { cmd = """
pytest \
pymomentum/test/test_closest_points.py \
pymomentum/test/test_fbx.py \
pymomentum/test/test_parameter_transform.py \
pymomentum/test/test_quaternion.py \
pymomentum/test/test_skel_state.py \
pymomentum/test/test_skeleton.py
""", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends_on = [
"build_pymomentum",
] }

#============
# osx-arm64
Expand All @@ -125,7 +135,17 @@ pytorch = ">=2.4.0"
[target.osx-arm64.tasks]
build = { cmd = "cmake --build build -j --target all", depends_on = ["config"] }
build_pymomentum = { cmd = "pip install -e ." }
# TODO: Add test_pymomentum once segfault on import is fixed
test_pymomentum = { cmd = """
pytest \
pymomentum/test/test_closest_points.py \
pymomentum/test/test_fbx.py \
pymomentum/test/test_parameter_transform.py \
pymomentum/test/test_quaternion.py \
pymomentum/test/test_skel_state.py \
pymomentum/test/test_skeleton.py
""", env = { MOMENTUM_MODELS_PATH = "momentum/" }, depends_on = [
"build_pymomentum",
] }

#=========
# win-64
Expand Down
2 changes: 1 addition & 1 deletion pymomentum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mt_library(
momentum
nlohmann_json::nlohmann_json
pybind11::pybind11
Python3::Python
Python3::Module
EXCLUDE_FROM_INSTALL
)

Expand Down

0 comments on commit fdc25fe

Please sign in to comment.