Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package version to 3.14.17 and switch to upstream autools build system on Windows #125

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ channel_targets:
- conda-forge main
cxx_compiler:
- vs2019
fortran_compiler:
- flang
fortran_compiler_version:
- '5'
ipopt:
- 3.14.16
libblas:
Expand Down
30 changes: 2 additions & 28 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
setlocal EnableDelayedExpansion

:: Copy CMake files to the source directory
xcopy /E %RECIPE_DIR%\cmake %SRC_DIR%

cd %SRC_DIR%
mkdir build
cd build

:: Configure using the CMakeFiles
cmake -G "NMake Makefiles" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DIPOPT_BUILD_EXAMPLES=1 ^
-DIPOPT_HAS_BLAS=1 ^
-DIPOPT_HAS_LAPACK=1 ^
-DIPOPT_HAS_MUMPS=1 ^
-DIPOPT_HAS_RAND=1 ^
-DIPOPT_ENABLE_LINEARSOLVERLOADER=1 ^
-DCOIN_LINK_GFORTRAN=FALSE ^
-DCOIN_USE_SYSTEM_LAPACK=TRUE ^
-DCOIN_HAS_MUMPS_INCLUDE_PATH="%LIBRARY_INC%\mumps_seq" ^
-DCOIN_HAS_MUMPS_LIBRARY_PATH="%LIBRARY_BIN%" ^
..
if errorlevel 1 exit 1
cmake --build . --config Release --target install
if errorlevel 1 exit 1
call %BUILD_PREFIX%\Library\bin\run_autotools_clang_conda_build.bat
if %ERRORLEVEL% neq 0 exit 1
32 changes: 30 additions & 2 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
# Get an updated config.sub and config.guess
cp $BUILD_PREFIX/share/gnuconfig/config.* .

if [[ "$target_platform" != "win-64" ]]; then
cp $BUILD_PREFIX/share/gnuconfig/config.* .
fi

cd $SRC_DIR

Expand All @@ -11,6 +14,13 @@ if [ "$(uname)" == "Linux" ]; then
export SPRAL_OPTIONS="--with-spral --with-spral-cflags=-I${PREFIX}/include --with-spral-lflags=-lspral"
fi

if [[ "$target_platform" == "win-64" ]]; then
# On windows there are no dmumps_seq pkg-config, see https://github.com/conda-forge/mumps-feedstock/issues/129, so we manually specify how to link dmumps
export MUMPS_LFLAGS="-ldmumps"
else
export MUMPS_LFLAGS="$(pkg-config --libs dmumps_seq)"
fi

mkdir build
cd build

Expand All @@ -19,12 +29,15 @@ cd build
--disable-java \
--with-mumps \
--with-mumps-cflags="-I${PREFIX}/include/mumps_seq" \
--with-mumps-lflags="$(pkg-config --libs dmumps_seq)" \
--with-mumps-lflags="${MUMPS_LFLAGS}" \
--with-asl \
--with-asl-cflags="-I${PREFIX}/include/asl" \
--with-asl-lflags="-lasl" \
--prefix=${PREFIX} || cat config.log

# As documented in https://github.com/conda-forge/autotools_clang_conda-feedstock/blob/cb241060f5d8adcd105f3b2e8454a8ad4d70f08f/recipe/meta.yaml#L58C1-L58C60
[[ "$target_platform" == "win-64" ]] && patch_libtool

make -j${CPU_COUNT}
if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR}" != "" ]]; then
# Environment variables needed by spral
Expand All @@ -38,3 +51,18 @@ make install
# for backward compatibility
install -d ${PREFIX}/include/coin
install -m644 ${PREFIX}/include/coin-or/* ${PREFIX}/include/coin

if [[ "$target_platform" == "win-64" ]]; then
# In conda-forge import library are called .lib, not .dll.lib,
# and also pkg-config expects that. The main ipopt.dll.lib library
# is renamed by the run_autotools_clang_conda_build, but here we also
# install and, that we manually rename here ipoptamplinterface.dll.lib
# sipopt.dll.lib
mv "${PREFIX}/lib/ipoptamplinterface.dll.lib" "${PREFIX}/lib/ipoptamplinterface.lib"
mv "${PREFIX}/lib/sipopt.dll.lib" "${PREFIX}/lib/sipopt.lib"
# While the ipopt.dll.lib library is renamed to ipopt.lib by run_autotools_clang_conda_build, for backward
# compatibility (see https://github.com/conda-forge/ipopt-feedstock/pull/125#issuecomment-2544745043)
# we also want to install ipopt-3.lib that was the import library name used by the Windows package of ipopt in conda-forge < 3.14.17
du -h "${PREFIX}/lib/ipopt.dll.lib"
cp "${PREFIX}/lib/ipopt.dll.lib" "${PREFIX}/lib/ipopt-3.lib"
fi
Loading