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

Suggestions about the building process #1786

Closed
mitkof6 opened this issue Jun 21, 2017 · 6 comments
Closed

Suggestions about the building process #1786

mitkof6 opened this issue Jun 21, 2017 · 6 comments

Comments

@mitkof6
Copy link
Contributor

mitkof6 commented Jun 21, 2017

It happens that I build OpenSim both for Debug and Release. This is because many libraries do not come up with a RelWithDebInfo (e.g. Qt). While docopts seems cool, it installs a Debug and Release version with the same name (e.g. it does not configure its docopt-targets-debug/release.cmake file correctly), thus this can cause problems. I suggest to make a PR (I will see if I have time) or maybe consider a header only library that can be integrated directly into OpenSim cxxopts.

The OpenSimConfig.cmake produced by the installer includes a line at the end which finds Simbody by default. This is cool since it renders the user from manually finding Simbody. Unfortunately, someone may be interested to link against its own Simbody build. In this case there is an error in the CMake configure:

CMake Error at C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/dependencies/simbody/cmake/SimbodyConfig.cmake:104 (add_library):
  add_library cannot create imported target "blas" because another target
  with the same name already exists.
Call Stack (most recent call first):
  C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/cmake/OpenSimConfig.cmake:109 (find_package)
  CMakeLists.txt:123 (find_package)


CMake Error at C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/dependencies/simbody/cmake/SimbodyConfig.cmake:110 (add_library):
  add_library cannot create imported target "lapack" because another target
  with the same name already exists.
Call Stack (most recent call first):
  C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/cmake/OpenSimConfig.cmake:109 (find_package)
  CMakeLists.txt:123 (find_package)


CMake Error at C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/dependencies/simbody/cmake/SimbodyConfig.cmake:125 (add_library):
  add_library cannot create imported target "pthread" because another target
  with the same name already exists.
Call Stack (most recent call first):
  C:/Users/mitkof6/Google Drive/libs/opensim-core/install/v4.0.0_beta/win10-vs15-x86/cmake/OpenSimConfig.cmake:109 (find_package)
  CMakeLists.txt:123 (find_package)

Personally I commented these two lines. I think it would be nice to have a variable (on by default) which will choose whether to link by default or require the user to provide its own find.

If python bindings are on and you are building in debug mode, while python's debug libraries are missing there is an error which prevents the construction of the cmake folder and its content in the install dir. The rest of the files (.h, dlls, lib) are copied into the install folder. Someone may mistakenly think that the library has been built correctly, since the building process builds most of its targets but the cmake folder is missing.

@chrisdembia
Copy link
Member

Thanks for this.

I suggest to make a PR (I will see if I have time) or maybe consider a header only library that can be integrated directly into OpenSim cxxopts.

We initially copied docopt.cpp directly into the repo, but @klshrinidhi preferred to keep it separate. It would be great if debug builds worked smoothly with docopt. Perhaps you could consider submitting a PR to docopt. Switching out the library for something else might be quite a bit of work and could introduce bugs.

I think it would be nice to have a variable (on by default) which will choose whether to link by default or require the user to provide its own find.

When configuring opensim-core, set OPENSIM_COPY_DEPENDENCIES=off. This allows you to use your own Simbody through how you set CMAKE_PREFIX_PATH. Is this sufficient?

If python bindings are on and you are building in debug mode, while python's debug libraries are missing there is an error which prevents the construction of the cmake folder and its content in the install dir.

I have not yet tried building the python bindings in debug; we have not attempted to support this. We could do something like this when building the PythonBindings target if PYTHON_LIBRARIES_DEBUG is undefined. A PR to address this somehow would be great :)

@chrisdembia
Copy link
Member

To add onto "Perhaps you could consider submitting a PR to docopt.": it might be as simple as having docopt.cpp define set(CMAKE_DEBUG_POSTFIX "_d").

@mitkof6
Copy link
Contributor Author

mitkof6 commented Jun 23, 2017

PR

@jenhicks jenhicks added this to the User Requests and Bugs milestone Aug 16, 2017
@mitkof6
Copy link
Contributor Author

mitkof6 commented Jan 3, 2018

I noticed that docopt has not merged my PR and OpenSim points to different tag, so this still causes problems when building different building systems.

@chrisdembia
Copy link
Member

I think we could also add -DCMAKE_DEBUG_POSTFIX:STRING="_d" to dependencies/CMakLists.txt in this repo.

@jenhicks
Copy link
Member

Closing given age, but please feel free to re-open if it is high priority.

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

No branches or pull requests

3 participants