Skip to content

Commit

Permalink
Add libosqp
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Jan 2, 2021
1 parent 92386ba commit 0cc967d
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
20 changes: 20 additions & 0 deletions recipes/libosqp/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 ^
%SRC_DIR%
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
13 changes: 13 additions & 0 deletions recipes/libosqp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

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 \
$SRC_DIR

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

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

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

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
license_file: LICENSE
summary: The Operator Splitting QP Solver.

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

0 comments on commit 0cc967d

Please sign in to comment.