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
Changes from 3 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
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
27 changes: 25 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

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

@@ -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
@@ -38,3 +51,13 @@ 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"
fi
Loading