-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
osqp 0.6.2 and 0.6.3 with Ninja generator + osqp build options #23539
Open
tkhyn
wants to merge
7
commits into
conan-io:master
Choose a base branch
from
tkhyn:osqp-fix-16821
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9fcd6ce
osqp: fix building with ninja
tkhyn 1f6ef1b
osqp: add build options
tkhyn ca70ce0
osqp: use BUILD_SHARED_LIBS to select between static and shared libra…
tkhyn 938a149
osqp: remove coverage and mkl_paradiso options
tkhyn 7c57274
osqp: rename ctrlc option to interrupt
tkhyn a73cb57
osqp: add options_description
tkhyn 6271304
osqp: do not validate shared lib build on winodws
tkhyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,8 @@ | |
"0.6.2": | ||
url: "https://github.com/osqp/osqp/releases/download/v0.6.2/complete_sources.tar.gz" | ||
sha256: "0a7ade2fa19f13e13bc12f6ea0046ef764049023efb4997a4e72a76534f623ec" | ||
patches: | ||
'0.6.2': | ||
- patch_file: patches/0.6.2-add-build-shared-libs-condition.patch | ||
Check warning on line 10 in recipes/osqp/all/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
'0.6.3': | ||
- patch_file: patches/0.6.3-add-build-shared-libs-condition.patch | ||
Check warning on line 12 in recipes/osqp/all/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
recipes/osqp/all/patches/0.6.2-add-build-shared-libs-condition.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 64671fc6..b82ede28 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -262,6 +262,7 @@ endif (R_LANG) | ||
# Add linear system solvers cumulative library | ||
add_subdirectory(lin_sys) | ||
|
||
+if (NOT BUILD_SHARED_LIBS) | ||
# Static library | ||
add_library (osqpstatic STATIC ${osqp_src} ${osqp_headers} ${linsys_solvers}) | ||
# Give same name to static library output | ||
@@ -285,7 +286,7 @@ install(TARGETS osqpstatic | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
- | ||
+endif() | ||
|
||
# Install Headers | ||
# ---------------------------------------------- | ||
@@ -294,14 +295,14 @@ install(FILES ${osqp_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/osqp") | ||
|
||
|
||
|
||
-if (MATLAB) | ||
+if (MATLAB AND NOT BUILD_SHARED_LIBS) | ||
target_link_libraries (osqpstatic ${Matlab_LIBRARIES}) | ||
-endif (MATLAB) | ||
+endif (MATLAB AND NOT BUILD_SHARED_LIBS) | ||
|
||
# If we are building Python/Matlab/R interface: | ||
# - do not build shared library | ||
# - do not build demo | ||
-if (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
+if (BUILD_SHARED_LIBS AND NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
# Create osqp shared library | ||
# NB: Add all the linear system solvers here | ||
add_library (osqp SHARED ${osqp_src} ${osqp_headers} ${linsys_solvers}) | ||
@@ -321,11 +322,9 @@ if (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
- # Create demo executable (linked to static library) | ||
- add_executable (osqp_demo ${PROJECT_SOURCE_DIR}/examples/osqp_demo.c) | ||
- target_link_libraries (osqp_demo osqpstatic) | ||
+ set(UNITTESTS OFF) | ||
|
||
-endif (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
+endif (BUILD_SHARED_LIBS AND NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
|
||
# Create CMake packages for the build directory | ||
# ---------------------------------------------- | ||
diff --git a/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt b/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
index 06c3d9c..426a7d2 100644 | ||
--- a/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
+++ b/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
@@ -99,6 +99,7 @@ target_include_directories(qdldlobject PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
# Create Static Library | ||
# ---------------------------------------------- | ||
|
||
+if (NOT BUILD_SHARED_LIBS) | ||
include(GNUInstallDirs) | ||
|
||
# Static library | ||
@@ -120,6 +121,7 @@ install(TARGETS qdldlstatic | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
+endif() | ||
|
||
# Install Headers | ||
# ---------------------------------------------- | ||
@@ -128,6 +130,7 @@ install(FILES ${qdldl_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qdldl") | ||
|
||
# Install Shared Library | ||
# ---------------------------------------------- | ||
+if (BUILD_SHARED_LIBS) | ||
# Create qdldl shared library | ||
add_library (qdldl SHARED ${qdldl_src} ${qdldl_headers}) | ||
|
||
@@ -143,10 +146,9 @@ install(TARGETS qdldl | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
-# Create demo executable (linked to static library) | ||
-add_executable (qdldl_example ${PROJECT_SOURCE_DIR}/examples/example.c) | ||
-target_link_libraries (qdldl_example qdldlstatic) | ||
+set(UNITTESTS OFF) | ||
|
||
+endif() | ||
|
||
# Create CMake packages for the build directory | ||
# ---------------------------------------------- |
94 changes: 94 additions & 0 deletions
94
recipes/osqp/all/patches/0.6.3-add-build-shared-libs-condition.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index afd7bb94..b918420d 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -271,6 +271,7 @@ endif (R_LANG) | ||
# Add linear system solvers cumulative library | ||
add_subdirectory(lin_sys) | ||
|
||
+if (NOT BUILD_SHARED_LIBS) | ||
# Static library | ||
add_library (osqpstatic STATIC ${osqp_src} ${osqp_headers} ${linsys_solvers}) | ||
# Give same name to static library output | ||
@@ -294,7 +295,7 @@ install(TARGETS osqpstatic | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
- | ||
+endif() | ||
|
||
# Install Headers | ||
# ---------------------------------------------- | ||
@@ -303,14 +304,14 @@ install(FILES ${osqp_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/osqp") | ||
|
||
|
||
|
||
-if (MATLAB) | ||
+if (MATLAB AND NOT BUILD_SHARED_LIBS) | ||
target_link_libraries (osqpstatic ${Matlab_LIBRARIES}) | ||
-endif (MATLAB) | ||
+endif (MATLAB AND NOT BUILD_SHARED_LIBS) | ||
|
||
# If we are building Python/Matlab/R interface: | ||
# - do not build shared library | ||
# - do not build demo | ||
-if (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
+if (BUILD_SHARED_LIBS AND NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
# Create osqp shared library | ||
# NB: Add all the linear system solvers here | ||
add_library (osqp SHARED ${osqp_src} ${osqp_headers} ${linsys_solvers}) | ||
@@ -330,11 +331,9 @@ if (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
- # Create demo executable (linked to static library) | ||
- add_executable (osqp_demo ${PROJECT_SOURCE_DIR}/examples/osqp_demo.c) | ||
- target_link_libraries (osqp_demo osqpstatic) | ||
+ set(UNITTESTS OFF) | ||
|
||
-endif (NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
+endif (BUILD_SHARED_LIBS AND NOT PYTHON AND NOT MATLAB AND NOT R_LANG AND NOT EMBEDDED) | ||
|
||
# Create CMake packages for the build directory | ||
# ---------------------------------------------- | ||
diff --git a/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt b/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
index 06c3d9c..426a7d2 100644 | ||
--- a/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
+++ b/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt | ||
@@ -99,6 +99,7 @@ target_include_directories(qdldlobject PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
# Create Static Library | ||
# ---------------------------------------------- | ||
|
||
+if (NOT BUILD_SHARED_LIBS) | ||
include(GNUInstallDirs) | ||
|
||
# Static library | ||
@@ -120,6 +121,7 @@ install(TARGETS qdldlstatic | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
+endif() | ||
|
||
# Install Headers | ||
# ---------------------------------------------- | ||
@@ -128,6 +130,7 @@ install(FILES ${qdldl_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/qdldl") | ||
|
||
# Install Shared Library | ||
# ---------------------------------------------- | ||
+if (BUILD_SHARED_LIBS) | ||
# Create qdldl shared library | ||
add_library (qdldl SHARED ${qdldl_src} ${qdldl_headers}) | ||
|
||
@@ -143,10 +146,9 @@ install(TARGETS qdldl | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
|
||
-# Create demo executable (linked to static library) | ||
-add_executable (qdldl_example ${PROJECT_SOURCE_DIR}/examples/example.c) | ||
-target_link_libraries (qdldl_example qdldlstatic) | ||
+set(UNITTESTS OFF) | ||
|
||
+endif() | ||
|
||
# Create CMake packages for the build directory | ||
# ---------------------------------------------- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An
options_description = {...}
field would be nice, since the meaning of the options isn't super obvious.