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

Default to shared libraries also on Windows, fix installation of shared libraries on Windows and bump minimum required version of CMake to 3.16 #418

Merged
merged 7 commits into from
Sep 30, 2024

Conversation

traversaro
Copy link
Member

For consistency with Linux and macOS.

@traversaro
Copy link
Member Author

Windows failure:

 cmake-package-check: FAILURE.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\runneradmin\micromamba\envs\human-dynamics-estimation\Lib\site-packages\wearables\__init__.py", line 7
    os.add_dll_directory(library_dll_path)$
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\runneradmin\micromamba\envs\human-dynamics-estimation\Lib\site-packages\hde\__init__.py", line 7
    os.add_dll_directory(library_dll_path)$
                                          ^
SyntaxError: invalid syntax

@traversaro traversaro changed the title Default to shared libraries also on Windows Default to shared libraries also on Windows and test standalone build of bindings Sep 29, 2024
@traversaro
Copy link
Member Author

This is failing with:

-- Found Python3: C:/Users/runneradmin/micromamba/envs/human-dynamics-estimation/python.exe (found suitable version "3.12.6", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
-- Found pybind11: C:/Users/runneradmin/micromamba/envs/human-dynamics-estimation/Library/include (found version "2.13.6")
-- Added files for bindings named MsgsBindings in HumanDynamicsEstimationBindings.
-- Added files for bindings named MsgsBindings in HumanDynamicsEstimationBindings.
-- Configuring done (2.4s)
CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target
  "HumanDynamicsEstimation::HumanStateMsg" configuration "Release".

ninja: error: loading 'build.ninja': The system cannot find the file specified.

That is the same error we are experiencing in conda-forge/staged-recipes#27723 .

@traversaro
Copy link
Member Author

This is failing with:

-- Found Python3: C:/Users/runneradmin/micromamba/envs/human-dynamics-estimation/python.exe (found suitable version "3.12.6", minimum required is "3.6") found components: Interpreter Development Development.Module Development.Embed
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
-- Found pybind11: C:/Users/runneradmin/micromamba/envs/human-dynamics-estimation/Library/include (found version "2.13.6")
-- Added files for bindings named MsgsBindings in HumanDynamicsEstimationBindings.
-- Added files for bindings named MsgsBindings in HumanDynamicsEstimationBindings.
-- Configuring done (2.4s)
CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target
  "HumanDynamicsEstimation::HumanStateMsg" configuration "Release".

ninja: error: loading 'build.ninja': The system cannot find the file specified.

That is the same error we are experiencing in conda-forge/staged-recipes#27723 .

The problem is that the install(TARGETS ...) commands were missing the ARCHIVE DESTINATION, so static libraries or import libraries were not installed. To remove the problem, instead of adding ARCHIVE DESTINATION I removed RUNTIME DESTINATION and LIBRARY DESTINATION, as anyhow we were just setting them to the default values (see https://cmake.org/cmake/help/v3.16/command/install.html#installing-targets, setting the values explicitly is a leftover from older CMake versions in which there were no defaults).

@traversaro traversaro changed the title Default to shared libraries also on Windows and test standalone build of bindings Default to shared libraries also on Windows, fix installation of shared libraries on Windows test standalone build of bindings Sep 30, 2024
@traversaro traversaro changed the title Default to shared libraries also on Windows, fix installation of shared libraries on Windows test standalone build of bindings Default to shared libraries also on Windows, fix installation of shared libraries on Windows and bump minimum required version of CMake to 3.16 Sep 30, 2024
@traversaro
Copy link
Member Author

The problem is that the install(TARGETS ...) commands were missing the ARCHIVE DESTINATION, so static libraries or import libraries were not installed. To remove the problem, instead of adding ARCHIVE DESTINATION I removed RUNTIME DESTINATION and LIBRARY DESTINATION, as anyhow we were just setting them to the default values (see https://cmake.org/cmake/help/v3.16/command/install.html#installing-targets, setting the values explicitly is a leftover from older CMake versions in which there were no defaults).

To do so, I bumped the CMake version to 3.16 as 3.5 is quite old and does not have the default destination for install(TARGETS ...), and anyhow CMake 3.16 is the version available by default on Ubuntu 20.04 : https://repology.org/project/cmake/versions .

@traversaro traversaro merged commit 4901096 into master Sep 30, 2024
6 checks passed
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