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

Export the ezc3d target. #116

Merged
merged 3 commits into from
Mar 29, 2020
Merged

Export the ezc3d target. #116

merged 3 commits into from
Mar 29, 2020

Conversation

chrisdembia
Copy link
Contributor

This PR supports PR opensim-org/opensim-core#2695 by creating an ezc3dTargets.cmake file in the ezc3d installation.

Without this PR, ezc3dConfig.cmake.in has some remnants of what goes in a Findezc3d.cmake file. With a Config file, there is no need to "find" the library; a Config file knows where it is because it's part of the library's installation.

I also made the ezc3d installation relocatable by using the PATH_VARS argument to configure_package_config_file().

@chrisdembia
Copy link
Contributor Author

@aymanhab @carmichaelong @nickbianco I thought you might be curious about these CMake changes.

@pariterre
Copy link
Member

pariterre commented Mar 29, 2020

Nice! Thanks about that! @chrisdembia

@aymanhab
Copy link

@chrisdembia Thanks for doing this. Would it be possible to write a recipe for importing libraries into the OpenSim build/ecosystem? and to put that in on github or confluence? More libraries will need to be integrated moving forward (e.g. with moco) and having such a template would be extremely helpful and time saving.
Ideally we'd be able to tell if there's an issue, whether it's on the library side or the OpenSim side.

Comment on lines +64 to +66
set(${PROJECT_NAME}_LIB_FOLDER lib/${PROJECT_NAME})
set(${PROJECT_NAME}_BIN_FOLDER lib/${PROJECT_NAME})
set(${PROJECT_NAME}_INCLUDE_FOLDER include/${PROJECT_NAME})
Copy link
Member

Choose a reason for hiding this comment

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

RPath is no longer set properly for the Python interface if ${CMAKE_INSTALL_PREFIX} is not present. On my computer I get
Set runtime path of "/home/pariterre/Programmation/miniconda3/envs/ezc3d-dev/lib/python3.8/site-packages/ezc3d/_ezc3d.so" to "lib/ezc3d"
which is not the right path (unless you change the LD_LIBRARY_PATH which I don't want to do).

Any suggestions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two possibilities for the RPATH for python bindings:

A. If the python bindings are expected to be used from their installed location, then you can use a relative RPATH, because you know the relative location of the ezc3d library.

B. If the python bindings are expected to be installed into your python distribution, then you need to use an absolute RPATH to the ezc3d library.

Which do you prefer? I think OpenSim has a CMake flag to toggle between A and B. We have spent a lot of time getting RPATH to work well for OpenSim, so we can refer to what OpenSim does.

Copy link
Member

Choose a reason for hiding this comment

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

I think I prefer the case B since I install the python binding in the Python site-package folder.
Unless it makes it incompatible with OpenSim, lets keep it as B :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I pushed a change that fixed the RPATH to be absolute again.

@chrisdembia
Copy link
Contributor Author

@pariterre I've pushed some fixes to the bindings. I have not yet fixed the RPATH, as this requires some discussion about the desired RPATH.

Comment on lines +374 to +376
newParam.set(
std::vector<double>(data.begin(), data.end()),
dimension);
Copy link
Member

Choose a reason for hiding this comment

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

Thx! I did not update the Matlab interface yet with the new changes :)

@chrisdembia
Copy link
Contributor Author

Ready for review again.

@codecov
Copy link

codecov bot commented Mar 29, 2020

Codecov Report

Merging #116 into dev will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #116   +/-   ##
=======================================
  Coverage   97.78%   97.78%           
=======================================
  Files          31       31           
  Lines        3703     3703           
=======================================
  Hits         3621     3621           
  Misses         82       82           
Impacted Files Coverage Δ
include/Vector3d.h 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c222e07...950a20a. Read the comment docs.

@pariterre pariterre merged commit da23fe6 into pyomeca:dev Mar 29, 2020
@chrisdembia
Copy link
Contributor Author

Yay! Thank you for the quick turnaround. Let me know if there are other problems I caused by accident.

@chrisdembia chrisdembia deleted the cmake_targets branch March 29, 2020 23:40
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.

3 participants