Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce OPENSIM_PYTHON_CONDA #2989

Merged
merged 21 commits into from
Feb 17, 2022
Merged

Introduce OPENSIM_PYTHON_CONDA #2989

merged 21 commits into from
Feb 17, 2022

Conversation

aymanhab
Copy link
Member

@aymanhab aymanhab commented Apr 15, 2021

Fixes issue #0

Brief summary of changes

Testing I've completed

Looking for feedback on...

CHANGELOG.md (choose one)

  • no need to update because...
  • updated.

This change is Reviewable

Copy link
Member Author

@aymanhab aymanhab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion


OpenSim/Simulation/Model/Frame.h, line 325 at r1 (raw file):

    /** Accessor for Rotation matrix of the Frame in Ground. */
    SimTK::Rotation getRotationInGround(const SimTK::State& state) const {

@carmichaelong Here's the template expansion that was missed by SWIG

@aymanhab
Copy link
Member Author

aymanhab commented Feb 17, 2022

This PR practically moves us to a more recent CMake so that we can use Python3 constructs and NOT specify numpy externally which has been a nightmare for us and doesn't play well with conda-build.
Python2 support is dropped as a result. The only other material change is adding a variable to indicate building for CONDA as runtime libraries are handled differently then (not copied to installation).

@aymanhab
Copy link
Member Author

@carmichaelong or @nickbianco for quick review

Copy link
Member

@nickbianco nickbianco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straight-forward. I just had one quick question about how NumPy is handled now.

Reviewed 1 of 4 files at r1, 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @aymanhab and @carmichaelong)


CMakeLists.txt, line 552 at r4 (raw file):

if(${BUILD_PYTHON_WRAPPING})
    set(required_python_version 3)
    find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter Development NumPy)

Not blocking, just curious: how does including NumPy as a required component change building the bindings? It seems like you still need to provide the NumPy include dirs, it would be nice if it found them automatically.

Copy link
Member Author

@aymanhab aymanhab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @carmichaelong and @nickbianco)


CMakeLists.txt, line 552 at r4 (raw file):

Previously, nickbianco (Nicholas Bianco) wrote…

Not blocking, just curious: how does including NumPy as a required component change building the bindings? It seems like you still need to provide the NumPy include dirs, it would be nice if it found them automatically.

You do not need to specify Numpy directory on your own, instead it is auto-populated by CMake find mechanism which guarantees that the Numpy is found within the same Python3 installation (as echoed by the messages I added below)

Copy link
Member

@nickbianco nickbianco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @aymanhab and @carmichaelong)


CMakeLists.txt, line 552 at r4 (raw file):

Previously, aymanhab (Ayman Habib) wrote…

You do not need to specify Numpy directory on your own, instead it is auto-populated by CMake find mechanism which guarantees that the Numpy is found within the same Python3 installation (as echoed by the messages I added below)

That's great! Thanks for clarifying.

@aymanhab
Copy link
Member Author

Awesome, thanks for the review @nickbianco 👍

@aymanhab aymanhab merged commit 73530a8 into master Feb 17, 2022
@aymanhab aymanhab deleted the support_conda_build branch February 17, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants