Skip to content
Merged
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
66 changes: 66 additions & 0 deletions I/IpoptMKL/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using BinaryBuilder

name = "IpoptMKL"
version = v"3.13.2"

sources = [
ArchiveSource("https://github.com/coin-or/Ipopt/archive/releases/$(version).tar.gz",
"891ab9e9c7db29fc8ac5c779ccec6313301098de7bbf735ca230cd5544c49496"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
cd Ipopt-releases-*

# Remove misleading libtool files
rm -f ${prefix}/lib/*.la
rm -f /opt/${target}/${target}/lib*/*.la

LIBASL=(-L${libdir} -lasl)
if [[ "${target}" == *-linux-* ]]; then
LIBASL+=(-lrt)
fi

libmkl=(-lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl)
if [[ ${target} == *mingw* ]]; then
libmkl=(${libdir}/mkl_rt.dll ${libdir}/mkl_intel_thread.dll ${libdir}/libiomp5md.dll ${libdir}/libwinpthread-1.dll)
fi

./configure --enable-shared \
--prefix=${prefix} \
--with-lapack="${libmkl[*]}" \
--with-asl-cflags="-I${prefix}/include" \
--with-asl-lflags="${LIBASL[*]}" \
--host=${target}

# parallel build fails
make
make install
"""

# disable Windows
# https://stackoverflow.com/questions/16623407/build-error-bad-reloc-address
platforms = [
Linux(:x86_64, libc=:glibc),
MacOS(:x86_64),
# Windows(:i686),
# Windows(:x86_64),
]
platforms = expand_gfortran_versions(expand_cxxstring_abis(platforms))

# The products that we will ensure are always built
products = [
LibraryProduct("libipopt", :libipopt),
ExecutableProduct("ipopt", :amplexe),
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("ASL_jll"),
Dependency("MKL_jll"),
Dependency("CompilerSupportLibraries_jll"),
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)