From d5cf6a9a272336036fb0547b235a8ceed2b6c693 Mon Sep 17 00:00:00 2001 From: Joris Gillis Date: Wed, 23 Oct 2024 06:41:00 +0000 Subject: [PATCH] [casadi] first step (no dependencies) (#41649) --- ports/casadi/portfile.cmake | 41 +++++++++++++++++++++++++++++++++++++ ports/casadi/usage | 5 +++++ ports/casadi/vcpkg.json | 17 +++++++++++++++ scripts/ci.baseline.txt | 9 ++++++++ versions/baseline.json | 4 ++++ versions/c-/casadi.json | 9 ++++++++ 6 files changed, 85 insertions(+) create mode 100644 ports/casadi/portfile.cmake create mode 100644 ports/casadi/usage create mode 100644 ports/casadi/vcpkg.json create mode 100644 versions/c-/casadi.json diff --git a/ports/casadi/portfile.cmake b/ports/casadi/portfile.cmake new file mode 100644 index 0000000000..70a497e318 --- /dev/null +++ b/ports/casadi/portfile.cmake @@ -0,0 +1,41 @@ +# Currently no upstream support for static libraries +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO casadi/casadi + REF "${VERSION}" + SHA512 2c95368281f0bda385c6c451e361c168589f13aa66af6bc6fadf01f899bcd6c785ea7da3dee0fb5835559e58982e499182a4d244af3ea208ac05f672ea99cfd1 + HEAD_REF main +) + +# Pending upstream fix https://github.com/casadi/casadi/issues/3896 +set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DWITH_SELFCONTAINED=OFF + -DWITH_TINYXML=OFF + -DWITH_BUILD_TINYXML=OFF + -DWITH_QPOASES=OFF + -DWITH_SUNDIALS=OFF + -DWITH_CSPARSE=OFF + -DLIB_PREFIX:PATH=lib + -DBIN_PREFIX:PATH=bin + -DINCLUDE_PREFIX:PATH=include + -DCMAKE_PREFIX:PATH=share/${PORT} +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") + +vcpkg_fixup_pkgconfig() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_copy_tools(TOOL_NAMES casadi-cli AUTO_CLEAN) diff --git a/ports/casadi/usage b/ports/casadi/usage new file mode 100644 index 0000000000..cbec5b01f5 --- /dev/null +++ b/ports/casadi/usage @@ -0,0 +1,5 @@ +casadi provides CMake targets: + + find_package(casadi CONFIG REQUIRED) + target_link_libraries(main PRIVATE $) + \ No newline at end of file diff --git a/ports/casadi/vcpkg.json b/ports/casadi/vcpkg.json new file mode 100644 index 0000000000..683ce0fe94 --- /dev/null +++ b/ports/casadi/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "casadi", + "version": "3.6.7", + "description": "CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.", + "homepage": "http://casadi.org", + "license": "LGPL-3.0-only", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index ec0ad45d4c..cc14caa9da 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -180,6 +180,15 @@ c-dbg-macro:x64-osx=skip c-dbg-macro:arm64-osx=skip c-dbg-macro:x64-linux=skip +# Needs work +casadi:arm64-android=skip +casadi:x64-android=skip +casadi:arm-neon-android=skip +casadi:x64-windows-static=skip +casadi:x64-windows-static-md=skip +casadi:x64-uwp=skip +casadi:arm64-uwp=skip + casclib:arm64-uwp=fail casclib:x64-uwp=fail catch-classic:arm-neon-android=skip diff --git a/versions/baseline.json b/versions/baseline.json index 10e582131b..0239daddb3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1516,6 +1516,10 @@ "baseline": "1.0.0", "port-version": 6 }, + "casadi": { + "baseline": "3.6.7", + "port-version": 0 + }, "casclib": { "baseline": "2024-06-05", "port-version": 0 diff --git a/versions/c-/casadi.json b/versions/c-/casadi.json new file mode 100644 index 0000000000..0cadc0a69d --- /dev/null +++ b/versions/c-/casadi.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "1adbc7383777c7c21ca1dea604f4a4c75780fe6e", + "version": "3.6.7", + "port-version": 0 + } + ] +}