[ampl-mp] Update version, separate port ampl-asl and fix arm build (#14518)

* [ampl-asl] Separate port ampl-mp module asl to ampl-asl

* [ampl-mp] Update version, separate port ampl-asl and fix arm build

* update baseline

* [VMSS] Pre-install ampl-mp:x86-windows

* Update ports/ampl-asl/portfile.cmake
This commit is contained in:
Jack·Boos·Yu 2020-11-12 12:55:11 -08:00 committed by GitHub
parent fe4aedef4d
commit bf482a9b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 397 additions and 102 deletions

5
ports/ampl-asl/CONTROL Normal file
View File

@ -0,0 +1,5 @@
Source: ampl-asl
Version: 2020-11-11
Homepage: https://github.com/ampl/asl
Description: AMPL Solver Library
Supports: !uwp

59
ports/ampl-asl/copyright Normal file
View File

@ -0,0 +1,59 @@
Licenses
========
Copyright (C) 1990 - 2001 Lucent Technologies
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of Lucent or any of its entities
not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
----------------------------------------------------------------------
Copyright (C) 2007 David M. Gay
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation.
The author disclaims all warranties with regard to this software,
including all implied warranties of merchantability and fitness.
In no event shall the author be liable for any special, indirect or
consequential damages or any damages whatsoever resulting from loss of
use, data or profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection with the use or
performance of this software.
----------------------------------------------------------------------
Copyright (C) 2002 - 2014 AMPL Optimization LLC
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation.
The author and AMPL Optimization LLC disclaim all warranties with
regard to this software, including all implied warranties of
merchantability and fitness. In no event shall the author be liable
for any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an
action of contract, negligence or other tortious action, arising out
of or in connection with the use or performance of this software.

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 976af78..35d248d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -256,7 +256,7 @@ macro(createSingleASL name sourcedir sources)
endif()
if(MSVC)
target_compile_options(${name} PRIVATE
- /wd4013 /wd4018 /wd4101 /wd4244 /wd4273 /wd4267 /wd4996 /MT$<$<CONFIG:Debug>:d>)
+ /wd4013 /wd4018 /wd4101 /wd4244 /wd4273 /wd4267 /wd4996)
else()
target_compile_options(${name} PRIVATE -Wno-unused-result -Wno-parentheses)
endif()

View File

@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35d248d..8a85aa7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,6 +317,7 @@ if(BUILD_CPP)
endif()
install(FILES ${ASL_HEADERS} ${ASL_SOURCE_DIR}/opcode.hd ${ASL_SOURCE_DIR}/r_opn.hd
+ ${GENERATED_INCLUDE_DIR}/stdio1.h ${GENERATED_INCLUDE_DIR}/arith.h
DESTINATION include/asl COMPONENT asl)
install(FILES ${ASL2_HEADERS} ${ASL2_SOURCE_DIR}/opcode.hd ${ASL2_SOURCE_DIR}/r_opn.hd
DESTINATION include/asl2 COMPONENT asl)

View File

@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a85aa7..c0619bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -247,8 +247,8 @@ endif()
macro(createSingleASL name sourcedir sources)
add_library(${name} STATIC ${${sources}} ${GENERATED_INCLUDE_DIR}/arith.h)
- target_include_directories(${name} PUBLIC ${GENERATED_INCLUDE_DIR}
- ${sourcedir})
+ target_include_directories(${name} PUBLIC $<BUILD_INTERFACE:${GENERATED_INCLUDE_DIR}>
+ $<BUILD_INTERFACE:${sourcedir}> $<INSTALL_INTERFACE:include>)
target_compile_definitions(${name} PRIVATE ${ASL_COMPILE_DEFINITIONS})
target_link_libraries(${name} PUBLIC ${CMAKE_DL_LIBS})
if(NOT WIN32)
@@ -322,14 +322,16 @@ install(FILES ${ASL_HEADERS} ${ASL_SOURCE_DIR}/opcode.hd ${ASL_SOURCE_DIR}/r_opn
install(FILES ${ASL2_HEADERS} ${ASL2_SOURCE_DIR}/opcode.hd ${ASL2_SOURCE_DIR}/r_opn.hd
DESTINATION include/asl2 COMPONENT asl)
-install(TARGETS asl asl2 DESTINATION lib COMPONENT asl)
+install(TARGETS asl asl2 EXPORT unofficial-asl-config DESTINATION lib COMPONENT asl)
if(BUILD_MT_LIBS)
- install(TARGETS asl-mt asl2-mt DESTINATION lib COMPONENT asl)
+ install(TARGETS asl-mt asl2-mt EXPORT unofficial-asl-config DESTINATION lib COMPONENT asl)
endif()
if(MSVC AND BUILD_DYNRT_LIBS)
- install(TARGETS asl-dynrt asl2-dynrt DESTINATION lib COMPONENT asl)
+ install(TARGETS asl-dynrt asl2-dynrt EXPORT unofficial-asl-config DESTINATION lib COMPONENT asl)
endif()
if(TARGET aslcpp)
install(FILES ${ASL_CPP_HEADERS} DESTINATION include/aslcpp COMPONENT asl)
- install(TARGETS aslcpp DESTINATION lib COMPONENT asl)
-endif()
\ No newline at end of file
+ install(TARGETS aslcpp EXPORT unofficial-asl-config DESTINATION lib COMPONENT asl)
+endif()
+
+install(EXPORT unofficial-asl-config DESTINATION share/unofficial-asl)
\ No newline at end of file

View File

@ -0,0 +1,37 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_fail_port_install(ON_TARGET "UWP")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ampl/asl
REF 934d34719c8a620fcf16ae5a3c00c326eb22e748
SHA512 b6fcb3dcb53a53d975666db1643d7ea518246e8fb6745621ce4b63de4393f7767844e9241baa6fdf1a45c241a9aa0866844c47deec0020313278128cccff6869
HEAD_REF master
PATCHES
workaround-msvc-optimizer-ice.patch
fix-crt-linkage.patch # CRT linkage uses C/CXX FLAGS in vcpkg
install-extra-headers.patch
install-targets.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
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_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-asl TARGET_PATH share/unofficial-asl)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# from ampl-mp license
file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

View File

@ -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)
{

View File

@ -1,4 +1,6 @@
Source: ampl-mp
Version: 2019-03-21-1
Version: 2020-11-11
Homepage: https://github.com/ampl/mp
Description: An open-source library for mathematical programming
Build-Depends: ampl-asl
Supports: !uwp

View File

@ -1,11 +1,13 @@
--- a/src/asl/CMakeLists.txt 2019-02-08 16:42:50.793071700 -0600
+++ b/src/asl/CMakeLists.txt 2019-02-08 16:44:04.960894500 -0600
@@ -266,7 +266,7 @@ endif ()
diff --git a/src/asl/CMakeLists.txt b/src/asl/CMakeLists.txt
index b7d7ecf..c31a032 100644
--- a/src/asl/CMakeLists.txt
+++ b/src/asl/CMakeLists.txt
@@ -59,7 +59,7 @@ endif ()
target_link_libraries(asl ${CMAKE_DL_LIBS})
target_link_libraries(aslmp ${CMAKE_DL_LIBS})
-find_package(MATLAB)
+set(MATLAB_FOUND)
if (MATLAB_FOUND)
if (MATLAB_FOUND AND MATLAB_BUILD)
set(matlab_asl asl)
if (MSVC)

View File

@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92089a3..d4c6762 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,9 +257,15 @@ if (CMAKE_CROSSCOMPILING)
COMMAND ${CMAKE_COMMAND} -E echo
"warning: cannot re-generate ${MP_EXPR_INFO_FILE}")
else ()
+ if (ARITHCHK_EXEC)
+ add_custom_command(OUTPUT ${MP_EXPR_INFO_FILE}
+ COMMAND ${WINE} ${ARITHCHK_EXEC} ${MP_EXPR_INFO_FILE}
+ DEPENDS gen-expr-info)
+ else()
add_custom_command(OUTPUT ${MP_EXPR_INFO_FILE}
COMMAND ${WINE} $<TARGET_FILE:gen-expr-info> ${MP_EXPR_INFO_FILE}
DEPENDS gen-expr-info)
+ endif()
endif ()
add_prefix(MP_HEADERS include/mp/
@@ -359,3 +365,4 @@ endif()
install(DIRECTORY include/mp DESTINATION include)
install(TARGETS mp DESTINATION lib RUNTIME DESTINATION bin)
install(FILES LICENSE.rst DESTINATION share/mp)
+install(TARGETS gen-expr-info RUNTIME DESTINATION bin)
\ No newline at end of file
diff --git a/src/amplsig/CMakeLists.txt b/src/amplsig/CMakeLists.txt
index 81312e9..f44c847 100644
--- a/src/amplsig/CMakeLists.txt
+++ b/src/amplsig/CMakeLists.txt
@@ -14,6 +14,6 @@ find_library(WS2_32_LIBRARY Ws2_32
PATHS ${WIN_LIBRARY_DIR} NO_DEFAULT_PATH)
if (WS2_32_LIBRARY)
add_ampl_library(amplsig amplsig.cc)
- message(WS2_32_LIBRARY ${WS2_32_LIBRARY})
- target_link_libraries(amplsig mp ${WS2_32_LIBRARY})
+ message(WS2_32_LIBRARY ws2_32)
+ target_link_libraries(amplsig mp ws2_32)
endif ()

View File

@ -0,0 +1,42 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 904cfb1..13f11cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,8 @@ set_cache(BUILD "" STRING
if (BUILD)
if (BUILD STREQUAL all)
set(MP_MODULES all)
+ elseif (BUILD STREQUAL no)
+ set(MP_MODULES)
else ()
string(REGEX MATCHALL "[^,]+" MP_MODULES "${BUILD}")
endif ()
@@ -200,7 +202,7 @@ function (add_mp_library name)
add_dependencies(${name} ${add_mp_library_DEPENDS})
endif ()
# Add library linked with dynamic runtime.
- if (MSVC)
+ if (0)
add_library(${name}-dynrt ${libtype} EXCLUDE_FROM_ALL
${add_mp_library_UNPARSED_ARGUMENTS} ${dynrt-objects})
target_compile_options(${name}-dynrt PUBLIC /MD$<$<CONFIG:Debug>:d>)
@@ -308,16 +310,17 @@ if (RT_LIBRARY)
target_link_libraries(mp ${RT_LIBRARY})
endif ()
+if (MP_VARIADIC_TEMPLATES)
# Check if variadic templates are working and not affected by GCC bug 39653:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653
check_cxx_source_compiles("
template <class T, class ...Types>
struct S { typedef typename S<Types...>::type type; };
int main() {}" MP_VARIADIC_TEMPLATES)
-
-if (MP_VARIADIC_TEMPLATES)
+ if (MP_VARIADIC_TEMPLATES)
add_executable(nl-example src/nl-example.cc)
target_link_libraries(nl-example mp)
+ endif()
endif ()
add_subdirectory(doc)

View File

@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13f11cb..92089a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -323,9 +323,9 @@ check_cxx_source_compiles("
endif()
endif ()
+find_package(unofficial-asl CONFIG REQUIRED)
add_subdirectory(doc)
add_subdirectory(src/amplsig)
-add_subdirectory(src/asl)
add_subdirectory(src/cp)
add_subdirectory(solvers)
diff --git a/src/cp/cp.cc b/src/cp/cp.cc
index d4adc35..ca8f35b 100644
--- a/src/cp/cp.cc
+++ b/src/cp/cp.cc
@@ -24,7 +24,7 @@
#include <cstring>
#include <limits>
#include "mp/format.h"
-#include "funcadd.h"
+#include <asl/funcadd.h>
namespace {
void error(arglist *al, const char *message) {

View File

@ -1,44 +1,23 @@
--- a/CMakeLists.txt 2019-02-09 04:38:25.756325900 -0600
+++ b/CMakeLists.txt 2019-02-09 04:39:55.299417600 -0600
@@ -289,6 +289,8 @@ add_prefix(MP_SOURCES src/
add_mp_library(mp ${MP_HEADERS} ${MP_SOURCES} ${MP_EXPR_INFO_FILE}
COMPILE_DEFINITIONS MP_DATE=${MP_DATE} MP_SYSINFO="${MP_SYSINFO}"
INCLUDE_DIRECTORIES src OBJECT_LIBRARIES format)
+set_property(TARGET mp PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include>)
set_target_properties(mp PROPERTIES
VERSION ${MP_VERSION} SOVERSION ${MP_VERSION_MAJOR})
@@ -385,5 +387,10 @@ if(BUILD_TESTING)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4c6762..c7b15b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -197,7 +197,7 @@ function (add_mp_library name)
target_compile_definitions(${name}
PUBLIC ${add_mp_library_COMPILE_DEFINITIONS})
target_include_directories(${name}
- PUBLIC ${add_mp_library_INCLUDE_DIRECTORIES})
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/${add_mp_library_INCLUDE_DIRECTORIES}> $<INSTALL_INTERFACE:include>)
if (add_mp_library_DEPENDS)
add_dependencies(${name} ${add_mp_library_DEPENDS})
endif ()
@@ -363,6 +363,7 @@ if(BUILD_TESTING)
endif()
install(DIRECTORY include/mp DESTINATION include)
-install(TARGETS mp DESTINATION lib RUNTIME DESTINATION bin)
+install(TARGETS mp EXPORT unofficial-mp-targets
+ DESTINATION lib RUNTIME DESTINATION bin)
+install(TARGETS mp EXPORT unofficial-mp-config DESTINATION lib RUNTIME DESTINATION bin)
install(FILES LICENSE.rst DESTINATION share/mp)
+install(EXPORT unofficial-mp-targets
+ FILE unofficial-mp-config.cmake
+ NAMESPACE unofficial::mp::
+ DESTINATION share/unofficial-mp)
--- a/src/asl/CMakeLists.txt 2019-02-09 04:38:27.196322600 -0600
+++ b/src/asl/CMakeLists.txt 2019-02-09 04:39:32.119889500 -0600
@@ -235,6 +235,10 @@ add_mp_library(asl-extra OBJECT ${ASL_SO
add_mp_library(asl STATIC OBJECT_LIBRARIES asl-core asl-extra
LIBRARIES mp INCLUDE_DIRECTORIES ${ASL_INCLUDE_DIRS})
+set_property(TARGET asl PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${PROJECT_SOURCE_DIR}/src/asl/solvers>
+ $<INSTALL_INTERFACE:include>)
if (NOT WIN32)
target_link_libraries(asl m)
@@ -353,4 +357,6 @@ endif ()
install(FILES ${ASL_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/arith.h
solvers/opcode.hd solvers/r_opn.hd
DESTINATION include/asl)
-install(TARGETS asl tableproxy DESTINATION lib RUNTIME DESTINATION bin)
+install(TARGETS tableproxy DESTINATION lib RUNTIME DESTINATION bin)
+install(TARGETS asl EXPORT unofficial-mp-targets
+ DESTINATION lib RUNTIME DESTINATION bin)
+install(EXPORT unofficial-mp-config DESTINATION share/unofficial-mp)
install(TARGETS gen-expr-info RUNTIME DESTINATION bin)
\ No newline at end of file

View File

@ -1,44 +1,53 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "Cross-compiling is not supported")
endif()
vcpkg_fail_port_install(ON_TARGET "UWP")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ampl/mp
REF 67875b71ef68511277ec2dc8224f613487cefce9
SHA512 fad2496c10b843ddad7c4dba1eea1b4cd22e90be12dec2ad598fbd1ed5e1c492d92c5130490c7045ea608bc9ea2af191661c39b3bee3bc5159663f306ce50950
REF bb7d616605dd23e4a453a834b0fc8c0a2a71b5aa
SHA512 558321f700a2ffe9d13f29f7c034825f5644a49c55da8490160d7ee8303484de5f9a636783387cc108bd238cdc3d2afa6b28cafecce73ee7893d792f5293712a
HEAD_REF master
PATCHES
disable-matlab-mex.patch
workaround-msvc-optimizer-ice.patch
install-targets.patch
disable-matlab-mex.patch
fix-build.patch
fix-dependency-asl.patch
fix-arm-build.patch # https://github.com/ampl/mp/issues/115
install-targets.patch
)
if (VCPKG_TARGET_IS_WINDOWS AND (TRIPLET_SYSTEM_ARCH STREQUAL "arm" OR TRIPLET_SYSTEM_ARCH STREQUAL "arm64"))
set(EXPECTED_EXE ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/${PORT}/gen-expr-info.exe)
if (NOT EXISTS ${EXPECTED_EXE})
message(FATAL_ERROR "Please install ${PORT}:x86-windows first.")
endif()
set(ARITHCHK_EXEC ${EXPECTED_EXE})
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD=asl
-DBUILD_TESTING=OFF
-DBUILD=no
-DBUILD_TESTING=OFF
-DMP_VARIADIC_TEMPLATES=OFF
-DARITHCHK_EXEC=${ARITHCHK_EXEC}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(
CONFIG_PATH share/unofficial-mp
TARGET_PATH share/unofficial-mp
)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/share/mp)
configure_file(${SOURCE_PATH}/LICENSE.rst
${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
vcpkg_copy_pdbs()
vcpkg_copy_tools(TOOL_NAMES gen-expr-info AUTO_CLEAN)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-mp TARGET_PATH share/unofficial-mp)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
# remove amplsig.dll and cp.dll, see https://github.com/ampl/mp/issues/130
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/bin
)
configure_file(${SOURCE_PATH}/LICENSE.rst ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)

View File

@ -1,28 +0,0 @@
diff --git a/src/asl/solvers/avltree.c b/src/asl/solvers/avltree.c
index 7a9adaba..4dd97054 100644
--- a/src/asl/solvers/avltree.c
+++ b/src/asl/solvers/avltree.c
@@ -54,6 +54,9 @@ 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/asl/solvers/sphes.c b/src/asl/solvers/sphes.c
index 326d997f..ae8952ed 100644
--- a/src/asl/solvers/sphes.c
+++ b/src/asl/solvers/sphes.c
@@ -452,6 +452,9 @@ 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)
{

View File

@ -108,7 +108,7 @@ $skipList = . "$PSScriptRoot/generate-skip-list.ps1" `
# WORKAROUND: the x86-windows flavors of these are needed for all cross-compilation, but they are not auto-installed.
# Install them so the CI succeeds:
if ($Triplet -in @('x64-uwp', 'arm64-windows', 'arm-uwp')) {
.\vcpkg.exe install protobuf:x86-windows boost-build:x86-windows sqlite3:x86-windows yasm-tool:x86-windows @commonArgs
.\vcpkg.exe install protobuf:x86-windows boost-build:x86-windows sqlite3:x86-windows yasm-tool:x86-windows ampl-mp:x86-windows @commonArgs
} elseif ($Triplet -in @('x64-windows', 'x64-windows-static')) {
.\vcpkg.exe install yasm-tool:x86-windows @commonArgs
}

View File

@ -42,9 +42,6 @@ alac:arm-uwp=fail
alac:x64-uwp=fail
aliyun-oss-c-sdk:x64-linux=fail
aliyun-oss-c-sdk:x64-osx=fail
ampl-mp:arm64-windows=fail
ampl-mp:arm-uwp=fail
ampl-mp:x64-uwp=fail
amqpcpp:arm-uwp=fail
amqpcpp:x64-uwp=fail
angelscript:arm64-windows=fail