Skip to content

Commit

Permalink
Merge pull request #125 from conda-forge-admin/conda_forge_admin_124
Browse files Browse the repository at this point in the history
Update package version to 3.14.17 and switch to upstream autools build system on Windows
  • Loading branch information
traversaro authored Dec 16, 2024
2 parents 28b9bc0 + 65cbdc5 commit 4d78a5a
Show file tree
Hide file tree
Showing 38 changed files with 61 additions and 4,893 deletions.
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

0 comments on commit 4d78a5a

Please sign in to comment.