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

Add libosqp #13587

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions recipes/libosqp/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:: Copy qdldl files to the submodule directory
xcopy /E qdldl osqp\lin_sys\direct\qdldl\qdldl_sources\

cd osqp
mkdir build
cd build

cmake ^
-G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DBUILD_SHARED_LIBS=ON ^
..
if errorlevel 1 exit 1

:: Build.
cmake --build . --config Release
if errorlevel 1 exit 1

:: Install.
cmake --build . --config Release --target install
if errorlevel 1 exit 1
18 changes: 18 additions & 0 deletions recipes/libosqp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Copy qdldl files to the submodule directory
cp -r qdldl/. osqp/lin_sys/direct/qdldl/qdldl_sources

cd osqp

mkdir build && cd build

cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
..

make -j${CPU_COUNT}
make install
56 changes: 56 additions & 0 deletions recipes/libosqp/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set name = "libosqp" %}
{% set version = "0.6.0" %}

package:
name: {{ name }}
version: {{ version }}

source:
- folder: osqp
url: https://github.com/oxfordcontrol/osqp/archive/v{{ version }}.tar.gz
sha256: 6e00d11d1f88c1e32a4419324b7539b89e8f9cbb1c50afe69f375347c989ba2b

# Manually download repos that are used via git submodules
# Note: make sure that the version used here is compatible with the one used in osqp
- folder: qdldl
url: https://github.com/oxfordcontrol/qdldl/archive/70596afefe1c8a58ddd491ff9b55d976c296a64b.zip
sha256: f48129c5c2f0879866bff8b82f6c0dd35d7c256ef86887905ebc337798a6aabf

build:
number: 0
run_exports:
# No ABI policy is documented, let's be conservative
- {{ pin_subpackage(name, max_pin='x.x.x') }}

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- make # [not win]
- cmake


test:
commands:
- test -f ${PREFIX}/include/osqp/osqp.h # [not win]
- test -f ${PREFIX}/lib/libosqp.so # [linux]
- test -f ${PREFIX}/lib/libosqp.dylib # [osx]
- test -f ${PREFIX}/lib/cmake/osqp/osqp-config.cmake # [not win]
- if exist %PREFIX%\\Library\\include\\osqp\\osqp.h (exit 0) else (exit 1) # [win]
- if exist $PREFIX$\\Library\\lib\\osqp.lib (exit 0) else (exit 1) # [win]
- if exist $PREFIX$\\Library\\bin\\osqp.dll (exit 0) else (exit 1) # [win]
- if exist %PREFIX%\\Library\\lib\\cmake\\osqp\\osqp-config.cmake (exit 0) else (exit 1) # [win]

about:
home: https://github.com/oxfordcontrol/osqp
license: Apache-2.0
summary: The Operator Splitting QP Solver.
license_file:
- osqp/LICENSE
- qdldl/LICENSE
- osqp/lin_sys/direct/qdldl/amd/LICENSE

extra:
recipe-maintainers:
- traversaro
- h-vetinari