aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuri <yuri@FreeBSD.org>2018-11-19 05:08:40 +0800
committeryuri <yuri@FreeBSD.org>2018-11-19 05:08:40 +0800
commit20e6c2e776b3a2beefd6293bc4751facea8a8df8 (patch)
tree13adc38bfa18e6c69831504d954cb886f432918f
parenta41e1ba3096d11d4789707ea8ad4c85cbd385907 (diff)
downloadfreebsd-ports-gnome-20e6c2e776b3a2beefd6293bc4751facea8a8df8.tar.gz
freebsd-ports-gnome-20e6c2e776b3a2beefd6293bc4751facea8a8df8.tar.zst
freebsd-ports-gnome-20e6c2e776b3a2beefd6293bc4751facea8a8df8.zip
New port: math/osqp: Operator Splitting QP Solver
-rw-r--r--math/Makefile1
-rw-r--r--math/osqp/Makefile22
-rw-r--r--math/osqp/distinfo5
-rw-r--r--math/osqp/files/patch-CMakeLists.txt71
-rw-r--r--math/osqp/files/patch-lin__sys_direct_qdldl_qdldl__sources_CMakeLists.txt66
-rw-r--r--math/osqp/pkg-descr9
-rw-r--r--math/osqp/pkg-plist25
7 files changed, 199 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile
index 026193ac8e73..092ee5e5cd83 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -481,6 +481,7 @@
SUBDIR += openmesh
SUBDIR += opensolaris-libm
SUBDIR += orpie
+ SUBDIR += osqp
SUBDIR += p5-AI-DecisionTree
SUBDIR += p5-AI-Genetic
SUBDIR += p5-AI-NeuralNet-BackProp
diff --git a/math/osqp/Makefile b/math/osqp/Makefile
new file mode 100644
index 000000000000..844d8e91c131
--- /dev/null
+++ b/math/osqp/Makefile
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+PORTNAME= osqp
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.4.1
+CATEGORIES= math
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Operator Splitting QP Solver
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= cmake:outsource
+USE_GITHUB= yes
+GH_ACCOUNT= oxfordcontrol
+GH_TUPLE= oxfordcontrol:qdldl:7ab0fca:q/lin_sys/direct/qdldl/qdldl_sources
+USE_LDCONFIG= yes
+
+CMAKE_OFF= BUILD_STATIC_LIBS BUILD_EXAMPLES UNITTESTS
+
+.include <bsd.port.mk>
diff --git a/math/osqp/distinfo b/math/osqp/distinfo
new file mode 100644
index 000000000000..f8ee5c431cac
--- /dev/null
+++ b/math/osqp/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1542574334
+SHA256 (oxfordcontrol-osqp-v0.4.1_GH0.tar.gz) = 0429d9580a9cdcce7c4ca61a9a97ccf4f24c7cab64f8dc44b3b9df73042cbac0
+SIZE (oxfordcontrol-osqp-v0.4.1_GH0.tar.gz) = 927482
+SHA256 (oxfordcontrol-qdldl-7ab0fca_GH0.tar.gz) = 9d02ed1a10ad2e8df4de3eb70469be4f9b896a8f93a9323065af625b08cd3645
+SIZE (oxfordcontrol-qdldl-7ab0fca_GH0.tar.gz) = 22930
diff --git a/math/osqp/files/patch-CMakeLists.txt b/math/osqp/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..2e8e818ee246
--- /dev/null
+++ b/math/osqp/files/patch-CMakeLists.txt
@@ -0,0 +1,71 @@
+--- CMakeLists.txt.orig 2018-09-26 17:51:55 UTC
++++ CMakeLists.txt
+@@ -296,28 +296,32 @@ endif (R_LANG)
+ add_subdirectory(lin_sys)
+
+ # Static library
+-add_library (osqpstatic STATIC ${osqp_src} ${osqp_headers} ${linsys_solvers})
+-# Give same name to static library output
+-set_target_properties(osqpstatic PROPERTIES OUTPUT_NAME osqp)
++if (BUILD_STATIC_LIBS)
++ add_library (osqpstatic STATIC ${osqp_src} ${osqp_headers} ${linsys_solvers})
++ # Give same name to static library output
++ set_target_properties(osqpstatic PROPERTIES OUTPUT_NAME osqp)
+
+-# Include directories for linear system solvers
+-target_include_directories(osqpstatic PRIVATE ${linsys_solvers_includes})
++ # Include directories for linear system solvers
++ target_include_directories(osqpstatic PRIVATE ${linsys_solvers_includes})
+
+-# Declare include directories for the cmake exported target
+-target_include_directories(osqpstatic
+- PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
+- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/osqp>")
++ # Declare include directories for the cmake exported target
++ target_include_directories(osqpstatic
++ PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
++ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/osqp>")
++endif()
+
+ # Install Static Library
+ # ----------------------------------------------
+
+ include(GNUInstallDirs)
+
+-install(TARGETS osqpstatic
+- EXPORT ${PROJECT_NAME}
+- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
++if (BUILD_STATIC_LIBS)
++ install(TARGETS osqpstatic
++ EXPORT ${PROJECT_NAME}
++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
++endif()
+
+
+ # Install Headers
+@@ -355,8 +359,10 @@ if (NOT PYTHON AND NOT MATLAB AND NOT R_
+ 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)
++ if (BUILD_EXAMPLES)
++ add_executable (osqp_demo ${PROJECT_SOURCE_DIR}/examples/osqp_demo.c)
++ target_link_libraries (osqp_demo osqp)
++ endif()
+
+ endif (NOT PYTHON AND NOT MATLAB AND NOT R_LANG)
+
+@@ -449,7 +455,7 @@ if (UNITTESTS)
+ ${PROJECT_SOURCE_DIR}/tests/minunit.h
+ ${test_headers}
+ ${codegen_test_headers})
+- target_link_libraries (osqp_tester osqpstatic)
++ target_link_libraries (osqp_tester osqp)
+
+ # Add testing
+ include(CTest)
diff --git a/math/osqp/files/patch-lin__sys_direct_qdldl_qdldl__sources_CMakeLists.txt b/math/osqp/files/patch-lin__sys_direct_qdldl_qdldl__sources_CMakeLists.txt
new file mode 100644
index 000000000000..e512f9aa57d3
--- /dev/null
+++ b/math/osqp/files/patch-lin__sys_direct_qdldl_qdldl__sources_CMakeLists.txt
@@ -0,0 +1,66 @@
+--- lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt.orig 2018-11-18 21:01:04 UTC
++++ lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt
+@@ -98,25 +98,29 @@ target_include_directories(qdldlobject P
+ # ----------------------------------------------
+
+ # Static library
+-add_library (qdldlstatic STATIC ${qdldl_src} ${qdldl_headers})
+-# Give same name to static library output
+-set_target_properties(qdldlstatic PROPERTIES OUTPUT_NAME qdldl)
++if (BUILD_STATIC_LIBS)
++ add_library (qdldlstatic STATIC ${qdldl_src} ${qdldl_headers})
++ # Give same name to static library output
++ set_target_properties(qdldlstatic PROPERTIES OUTPUT_NAME qdldl)
+
+-# Declare include directories for the cmake exported target
+-target_include_directories(qdldlstatic
+- PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
+- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/qdldl>")
++ # Declare include directories for the cmake exported target
++ target_include_directories(qdldlstatic
++ PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
++ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/qdldl>")
++endif()
+
+ # Install Static Library
+ # ----------------------------------------------
+
+ include(GNUInstallDirs)
+
+-install(TARGETS qdldlstatic
+- EXPORT ${PROJECT_NAME}
+- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
++if (BUILD_STATIC_LIBS)
++ install(TARGETS qdldlstatic
++ EXPORT ${PROJECT_NAME}
++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
++endif()
+
+
+ # Install Headers
+@@ -142,8 +146,10 @@ install(TARGETS qdldl
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+
+ # Create demo executable (linked to static library)
+-add_executable (qdldl_example ${PROJECT_SOURCE_DIR}/examples/c/example.c)
+-target_link_libraries (qdldl_example qdldlstatic)
++if (BUILD_ECAMPLES)
++ add_executable (qdldl_example ${PROJECT_SOURCE_DIR}/examples/c/example.c)
++ target_link_libraries (qdldl_example qdldl)
++endif()
+
+
+ # Create CMake packages for the build directory
+@@ -200,7 +206,7 @@ if (UNITTESTS)
+ add_executable(qdldl_tester
+ ${PROJECT_SOURCE_DIR}/tests/qdldl_tester.c ${PROJECT_SOURCE_DIR}/tests/minunit.h
+ ${test_headers})
+- target_link_libraries (qdldl_tester qdldlstatic)
++ target_link_libraries (qdldl_tester qdldl)
+
+ # Add testing
+ include(CTest)
diff --git a/math/osqp/pkg-descr b/math/osqp/pkg-descr
new file mode 100644
index 000000000000..b40dd44558a8
--- /dev/null
+++ b/math/osqp/pkg-descr
@@ -0,0 +1,9 @@
+OSQP uses a specialized ADMM-based first-order method with custom sparse linear
+algebra routines that exploit structure in problem data.
+
+The algorithm is absolutely division free after the setup and it requires no
+assumptions on problem data (the problem only needs to be convex).
+
+OSQP is self-contained and requires no external library to run.
+
+WWW: https://osqp.org/
diff --git a/math/osqp/pkg-plist b/math/osqp/pkg-plist
new file mode 100644
index 000000000000..f421b7df1d7c
--- /dev/null
+++ b/math/osqp/pkg-plist
@@ -0,0 +1,25 @@
+include/osqp/auxil.h
+include/osqp/constants.h
+include/osqp/cs.h
+include/osqp/ctrlc.h
+include/osqp/glob_opts.h
+include/osqp/kkt.h
+include/osqp/lin_alg.h
+include/osqp/lin_sys.h
+include/osqp/osqp.h
+include/osqp/osqp_configure.h
+include/osqp/polish.h
+include/osqp/proj.h
+include/osqp/scaling.h
+include/osqp/types.h
+include/osqp/util.h
+include/qdldl/qdldl.h
+include/qdldl/qdldl_types.h
+lib/cmake/osqp/osqp-config.cmake
+lib/cmake/osqp/osqp-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/osqp/osqp-targets.cmake
+lib/cmake/qdldl/qdldl-config.cmake
+lib/cmake/qdldl/qdldl-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/qdldl/qdldl-targets.cmake
+lib/libosqp.so
+lib/libqdldl.so