summaryrefslogtreecommitdiff
path: root/proxsuite.spec
blob: fbcf32733f0bfeda0941ad28067eb940aaca980d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ProxSuite is a CMake project (header-only C++ core + nanobind Python bindings).
# Upstream also ships a pyproject.toml using the cmeel build backend, which is a
# pip/conda-only packaging shim for the very same CMake build. openEuler builds
# the project with its native CMake build system (same as the ROS buildfarm,
# see package.xml <build_type>cmake</build_type>), so no cmeel/cmeel-eigen/
# cmeel-simde RPMs are needed.
#
# Source layout (ground truth, verified with `tar tzf`):
#   topdir: proxsuite-0.7.3
# The tarball is generated from the upstream git checkout (tag v0.7.3) with the
# two mandatory submodules already populated: cmake-module (jrl-cmakemodules),
# bindings/python/external/nanobind and external/cereal. VCS metadata (.git) is
# not shipped, hence PROJECT_VERSION is passed explicitly to CMake below.

%global pypi_name proxsuite

Name:           python-%{pypi_name}
Version:        0.7.3
Release:        1%{?dist}
Summary:        The Advanced Proximal Optimization Toolbox (QP/LP solvers)
License:        BSD-2-Clause
URL:            https://github.com/Simple-Robotics/proxsuite
Source0:        https://github.com/Simple-Robotics/proxsuite/archive/refs/tags/v%{version}/%{pypi_name}-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  make
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  pkgconfig
BuildRequires:  eigen3-devel
BuildRequires:  simde-devel
BuildRequires:  python3-devel

%description
ProxSuite is a collection of open-source, numerically robust, precise and
efficient numerical solvers (LP, QP, ...) rooted in revisited primal-dual
proximal algorithms. It offers a header-only C++14/17/20 library together with
Python bindings, and supports dense, sparse and matrix-free problem structures.

This package provides the Python bindings of ProxSuite.

%package -n python3-%{pypi_name}
Summary:        Python bindings for ProxSuite
Requires:       python3-numpy
Requires:       python3-scipy
Provides:       python-%{pypi_name} = %{version}-%{release}
Provides:       python3dist(proxsuite) = %{version}

%description -n python3-%{pypi_name}
ProxSuite is a collection of open-source, numerically robust, precise and
efficient numerical solvers (LP, QP, ...) rooted in revisited primal-dual
proximal algorithms.

This package provides the ProxSuite Python module (proxsuite), including the
ProxQP dense/sparse solvers and the proxsuite.torch helpers.

%package -n %{pypi_name}-devel
Summary:        C++ headers and CMake configuration for ProxSuite
Requires:       eigen3-devel
Requires:       simde-devel
Provides:       %{pypi_name}-static = %{version}-%{release}

%description -n %{pypi_name}-devel
ProxSuite is a collection of open-source, numerically robust, precise and
efficient numerical solvers (LP, QP, ...) rooted in revisited primal-dual
proximal algorithms.

This package provides the header-only C++ library, the CMake package
configuration (proxsuiteConfig.cmake) and the pkg-config file.

%prep
%autosetup -n %{pypi_name}-%{version}

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
mkdir -p %{_target_platform}
cd %{_target_platform}
cmake .. \
  -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  -DCMAKE_INSTALL_LIBDIR=%{_lib} \
  -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
  -DCMAKE_INSTALL_BINDIR=%{_bindir} \
  -DCMAKE_BUILD_TYPE=Release \
  -DPROJECT_VERSION=%{version} \
  -DPYTHON_SITELIB=%{python3_sitearch} \
  -DPython_EXECUTABLE=%{__python3} \
  -DBUILD_TESTING=OFF \
  -DBUILD_DOCUMENTATION=OFF \
  -DINSTALL_DOCUMENTATION=OFF \
  -DBUILD_BENCHMARK=OFF \
  -DBUILD_PYTHON_INTERFACE=ON \
  -DBUILD_WITH_OPENMP_SUPPORT=OFF \
  -DBUILD_WITH_VECTORIZATION_SUPPORT=ON
make %{?_smp_mflags}

%install
cd %{_target_platform}
make install DESTDIR=%{buildroot}

%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{python3_sitearch}/%{pypi_name}/

%files -n %{pypi_name}-devel
%license LICENSE
%{_includedir}/%{pypi_name}/
%{_libdir}/cmake/%{pypi_name}/
%{_libdir}/pkgconfig/%{pypi_name}.pc

%changelog
* Mon Sep 21 2026 Python_Bot <Python_Bot@openeuler.org> - 0.7.3-1
- Initial package