1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 AUTOTOOLS_IN_SOURCE_BUILD=yes
9 inherit eutils autotools-utils multilib toolchain-funcs fortran-2
14 DESCRIPTION="Interior-Point Optimizer for large-scale nonlinear optimization"
15 HOMEPAGE="https://projects.coin-or.org/Ipopt/"
16 SRC_URI="http://www.coin-or.org/download/source/${MYPN}/${MYP}.tgz"
18 LICENSE="EPL-1.0 hsl? ( HSL )"
20 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
21 IUSE="doc examples hsl lapack mpi mumps static-libs test"
25 hsl? ( sci-libs/coinhsl:0= )
26 lapack? ( virtual/lapack )
27 mumps? ( sci-libs/mumps:0=[mpi=] )"
30 doc? ( app-doc/doxygen[dot] )
31 test? ( sci-libs/coinor-sample sci-libs/mumps )"
33 S="${WORKDIR}/${MYPN}-${PV}/${MYPN}"
36 if use mumps && ! use mpi; then
37 ln -s "${EPREFIX}"/usr/include/mpiseq/mpi.h \
38 src/Algorithm/LinearSolvers/
40 export CXX=mpicxx FC=mpif77 F77=mpif77 CC=mpicc
43 -e "s:lib/pkgconfig:$(get_libdir)/pkgconfig:g" \
45 autotools-utils_src_prepare
49 # needed for the --with-coin-instdir
52 --enable-dependency-linking
53 --with-blas-lib="$($(tc-getPKG_CONFIG) --libs blas)"
54 --with-coin-instdir="${ED}"/usr
59 myeconfargs+=( --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)" )
61 myeconfargs+=( --without-lapack )
65 --with-mumps-incdir="${EPREFIX}"/usr/include
66 --with-mumps-lib="-lmumps_common -ldmumps -lzmumps -lsmumps -lcmumps" )
68 myeconfargs+=( --without-mumps )
72 --with-hsl-incdir="${EPREFIX}"/usr/include
73 --with-hsl-lib="$($(tc-getPKG_CONFIG) --libs coinhsl)" )
75 myeconfargs+=( --without-hsl )
77 autotools-utils_src_configure
81 autotools-utils_src_compile all $(use doc && echo doxydoc)
85 autotools-utils_src_test test
89 use doc && HTML_DOC=("${AUTOTOOLS_BUILD_DIR}/doxydocs/html/")
90 autotools-utils_src_install
92 rm "${ED}"/usr/share/coin/doc/${MYPN}/{README,AUTHORS,LICENSE} || die
94 insinto /usr/share/doc/${PF}