Last active
November 18, 2020 14:55
-
-
Save ueliwechsler/25a8c4397089166324991661a2250c0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BinaryBuilder | |
name = "Ipopt_Spral" | |
version = v"0.1.0" | |
## Sources | |
sources = [ | |
GitSource("https://github.com/coin-or-tools/ThirdParty-Metis.git", "48d89108b173dcf74cc7a27d0beff0eb5eedadd5"), # master | |
GitSource("https://github.com/lanl-ansi/spral.git", "3842fffd5b16f0bf85be6f4b2832816ac4405763"), # master | |
GitSource("https://github.com/lanl-ansi/Ipopt.git", "78a05e2b9138074682a057297b61524f7cb32b53"), # master | |
] | |
script = raw""" | |
cd ${WORKSPACE}/srcdir | |
# Compile METIS | |
cd ThirdParty-Metis && ./get.Metis | |
mkdir build | |
cd build | |
../configure --prefix=${PWD} | |
make && make install | |
export METISDIR=${PWD} | |
# Install Dependenices | |
# TODO: FIX | |
# sudo apt-get install hwloc libhwloc-dev | |
# sudo apt install libopenblas-dev | |
if [[ "${nbits}" == 64 ]] && [[ "${target}" != aarch64* ]]; then | |
OPENBLAS="${libdir}/libopenblas64_.${dlext}" | |
else | |
OPENBLAS="${libdir}/libopenblas.${dlext}" | |
fi | |
# ===== BUILD SPRAL ===== | |
# Follow the instruction: https://github.com/lanl-ansi/spral/blob/master/COMPILE.md | |
cd ${WORKSPACE}/srcdir | |
cd spral | |
mkdir build | |
# ./autogen.sh # If compiling from scratch. | |
#CFLAGS=-fPIC CPPFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC \ | |
# FCFLAGS=-fPIC ./configure --prefix=${PWD}/build \ | |
# --with-blas="-lopenblas" --with-lapack="-llapack" \ | |
# --with-metis="-L${METISDIR}/lib -lcoinmetis" \ | |
# --with-metis-inc-dir="-I${METISDIR}/include/coin-or/metis" | |
./autogen.sh # If compiling from scratch. | |
CFLAGS=-fPIC CPPFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC \ | |
FCFLAGS=-fPIC ./configure --prefix=${PWD}/build \ | |
--with-blas="${OPENBLAS}" --with-lapack="${OPENBLAS}" \ | |
--with-metis="-L${METISDIR}/lib -lcoinmetis" \ | |
--with-metis-inc-dir="-I${METISDIR}/include/coin-or/metis" | |
make && make install | |
# USAGE | |
export SPRALDIR=${PWD}/build | |
export OMP_CANCELLATION=TRUE | |
export OMP_NESTED=TRUE | |
export OMP_PROC_BIND=TRUE | |
# ===== BUILD IPOPT ===== | |
# Follow the instruction: https://github.com/lanl-ansi/Ipopt/blob/master/COMPILE.md | |
cd ${WORKSPACE}/srcdir/Ipopt | |
mkdir build | |
cd build | |
../configure --prefix=${PWD} --with-spral="-L${SPRALDIR}/lib -L${METISDIR}/lib \ | |
-lspral -lgfortran -lhwloc -lm -lcoinmetis "${OPENBLAS}" -lstdc++ -fopenmp" \ | |
--with-lapack-lflags="-llapack -lopenblas" | |
make && make install | |
""" | |
platforms = [ | |
# Linux(:i686, libc=:glibc), | |
Linux(:x86_64, libc=:glibc), | |
# Linux(:aarch64, libc=:glibc), | |
# Linux(:armv7l, libc=:glibc, call_abi=:eabihf), | |
# Linux(:powerpc64le, libc=:glibc), | |
# Linux(:i686, libc=:musl), | |
# Linux(:x86_64, libc=:musl), | |
# Linux(:aarch64, libc=:musl), | |
# Linux(:armv7l, libc=:musl, call_abi=:eabihf), | |
# MacOS(:x86_64), | |
# FreeBSD(:x86_64), | |
# Windows(:i686), | |
# Windows(:x86_64) | |
] | |
# The products that we will ensure are always built | |
products = Product[ | |
# LibraryProduct("libipopt", :libipopt), | |
# LibraryProduct("spral_ssids", :spral_ssids) | |
] | |
# Dependencies that must be installed before this package can be built | |
dependencies = [ | |
Dependency("OpenBLAS_jll"), | |
Dependency("Hwloc_jll"), | |
# Dependency("CompilerSupportLibraries_jll") | |
] | |
# Build the tarballs, and possibly a `build.jl` as well. | |
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Progress so far:
OPENBLAS
Even though in
/workspace/destdir/lib/
there seems to be alibopenblas64_.so
.