|
| 1 | +using BinaryBuilder |
| 2 | + |
| 3 | +name = "Ipopt" |
| 4 | +version = v"3.13.2" |
| 5 | + |
| 6 | +sources = [ |
| 7 | + ArchiveSource("https://github.com/coin-or/Ipopt/archive/releases/$(version).tar.gz", |
| 8 | + "891ab9e9c7db29fc8ac5c779ccec6313301098de7bbf735ca230cd5544c49496"), |
| 9 | +] |
| 10 | + |
| 11 | +# Bash recipe for building across all platforms |
| 12 | +script = raw""" |
| 13 | +cd $WORKSPACE/srcdir |
| 14 | +cd Ipopt-releases-* |
| 15 | +
|
| 16 | +# Remove misleading libtool files |
| 17 | +rm -f ${prefix}/lib/*.la |
| 18 | +rm -f /opt/${target}/${target}/lib*/*.la |
| 19 | +
|
| 20 | +LIBASL=(-L${libdir} -lasl) |
| 21 | +if [[ "${target}" == *-linux-* ]]; then |
| 22 | + LIBASL+=(-lrt) |
| 23 | +fi |
| 24 | +
|
| 25 | +./configure --enable-shared \ |
| 26 | + --prefix=${prefix} \ |
| 27 | + --with-blas="-lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl" \ |
| 28 | + --with-asl-cflags="-I${prefix}/include" \ |
| 29 | + --with-asl-lflags="${LIBASL[*]}" \ |
| 30 | + --host=${target} |
| 31 | +
|
| 32 | +# parallel build fails |
| 33 | +make |
| 34 | +make install |
| 35 | +""" |
| 36 | + |
| 37 | +platforms = [ |
| 38 | + Linux(:x86_64, libc=:glibc), |
| 39 | + MacOS(:x86_64), |
| 40 | + Windows(:i686), |
| 41 | + Windows(:x86_64), |
| 42 | +] |
| 43 | +platforms = expand_gfortran_versions(expand_cxxstring_abis(platforms)) |
| 44 | + |
| 45 | +# The products that we will ensure are always built |
| 46 | +products = [ |
| 47 | + LibraryProduct("libipopt", :libipopt), |
| 48 | + ExecutableProduct("ipopt", :amplexe), |
| 49 | +] |
| 50 | + |
| 51 | +# Dependencies that must be installed before this package can be built |
| 52 | +dependencies = [ |
| 53 | + Dependency("ASL_jll"), |
| 54 | + Dependency("MKL_jll"), |
| 55 | + Dependency("CompilerSupportLibraries_jll"), |
| 56 | +] |
| 57 | + |
| 58 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 59 | +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) |
0 commit comments