diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ampl-asl | |
Diffstat (limited to 'vcpkg/ports/ampl-asl')
| -rw-r--r-- | vcpkg/ports/ampl-asl/0006-disable-generate-arith-h.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/ampl-asl/portfile.cmake | 31 | ||||
| -rw-r--r-- | vcpkg/ports/ampl-asl/vcpkg.json | 18 | ||||
| -rw-r--r-- | vcpkg/ports/ampl-asl/workaround-msvc-optimizer-ice.patch | 60 |
4 files changed, 122 insertions, 0 deletions
diff --git a/vcpkg/ports/ampl-asl/0006-disable-generate-arith-h.diff b/vcpkg/ports/ampl-asl/0006-disable-generate-arith-h.diff new file mode 100644 index 0000000..0c82023 --- /dev/null +++ b/vcpkg/ports/ampl-asl/0006-disable-generate-arith-h.diff @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1d4b65e..21b32ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,7 +104,7 @@ file(WRITE ${GENERATED_INCLUDE_DIR}/details.c "${DETAILS}") + configure_file(${SRCDIR}/solvers/stdio1.h0 ${GENERATED_INCLUDE_DIR}/stdio1.h + COPYONLY) + +-if(CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "^x86") ++if(0) + include(CheckTypeSize) + check_type_size(double DOUBLE_SIZE) + check_type_size(long LONG_SIZE) diff --git a/vcpkg/ports/ampl-asl/portfile.cmake b/vcpkg/ports/ampl-asl/portfile.cmake new file mode 100644 index 0000000..36c9c02 --- /dev/null +++ b/vcpkg/ports/ampl-asl/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ampl/asl + REF ae937db9bd1169ec2c4cb8d75196f67cdcb8041b + SHA512 7d0b2decb71397daa88ce328c23e782dab43b32fd6a51f031db8d4eed94abc6261892553faa990236a705a521de45c418261bbeba43f31bbee426c2c177af0cd + HEAD_REF master + PATCHES + workaround-msvc-optimizer-ice.patch + 0006-disable-generate-arith-h.diff +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_MCMODELLARGE=OFF + -DBUILD_DYNRT_LIBS=OFF # CRT linkage uses C/CXX FLAGS in vcpkg + -DBUILD_MT_LIBS=OFF # CRT linkage uses C/CXX FLAGS in vcpkg + -DBUILD_CPP=ON +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/ampl-asl/vcpkg.json b/vcpkg/ports/ampl-asl/vcpkg.json new file mode 100644 index 0000000..f9bc1bb --- /dev/null +++ b/vcpkg/ports/ampl-asl/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "ampl-asl", + "version": "1.0.1", + "description": "AMPL Solver Library", + "homepage": "https://github.com/ampl/asl", + "license": "BSD-3-Clause", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/vcpkg/ports/ampl-asl/workaround-msvc-optimizer-ice.patch b/vcpkg/ports/ampl-asl/workaround-msvc-optimizer-ice.patch new file mode 100644 index 0000000..7ae6259 --- /dev/null +++ b/vcpkg/ports/ampl-asl/workaround-msvc-optimizer-ice.patch @@ -0,0 +1,60 @@ +diff --git a/src/solvers/avltree.c b/src/solvers/avltree.c +index 7a9adab..a75da90 100644 +--- a/src/solvers/avltree.c ++++ b/src/solvers/avltree.c +@@ -54,6 +54,10 @@ AVL_Tree { + void (*Free)(void*); + }; + ++#if defined(_MSC_VER) && _MSC_VER < 1917 ++#pragma optimize("", off) ++#endif ++ + AVL_Tree* + AVL_Tree_alloc2(void *v, AVL_Elcomp cmp, void *(*Malloc)(size_t), void (*Free)(void*)) + { +diff --git a/src/solvers/sphes.c b/src/solvers/sphes.c +index a50065f..6e6eedc 100644 +--- a/src/solvers/sphes.c ++++ b/src/solvers/sphes.c +@@ -461,6 +461,10 @@ compar(const void *a, const void *b) + #undef del_mblk + #define del_mblk(b,c) Del_mblk_ASL(a,b,(Char*)(c)) + ++#if defined(_MSC_VER) && _MSC_VER < 1917 ++#pragma optimize("", off) ++#endif ++ + static void + new_Hesoprod(ASL_pfgh *asl, ograd *L, ograd *R, real coef) + { +diff --git a/src/solvers2/avltree.c b/src/solvers2/avltree.c +index 7a9adab..a75da90 100644 +--- a/src/solvers2/avltree.c ++++ b/src/solvers2/avltree.c +@@ -54,6 +54,10 @@ AVL_Tree { + void (*Free)(void*); + }; + ++#if defined(_MSC_VER) && _MSC_VER < 1917 ++#pragma optimize("", off) ++#endif ++ + AVL_Tree* + AVL_Tree_alloc2(void *v, AVL_Elcomp cmp, void *(*Malloc)(size_t), void (*Free)(void*)) + { +diff --git a/src/solvers2/sphes.c b/src/solvers2/sphes.c +index dd2edff..ebdd3af 100644 +--- a/src/solvers2/sphes.c ++++ b/src/solvers2/sphes.c +@@ -855,6 +855,10 @@ compar(const void *a, const void *b) + #undef del_mblk + #define del_mblk(c) Del_mblk_ASL(a,(Char*)(c)) + ++#if defined(_MSC_VER) && _MSC_VER < 1917 ++#pragma optimize("", off) ++#endif ++ + static void + new_Hesoprod(EvalWorkspace *ew, int nov, int *ov, real *oc, int nR, int *Rov, real *Roc, real coef) + { |