Skip to content
Snippets Groups Projects
Commit 9704369f authored by junkudo's avatar junkudo Committed by scheibelp
Browse files

ipopt package: set compiler flags in configure (#6714)

This makes use of the new flag_handler logic from 28d8784a to set
compiler flags for ipopt by passing them as arguments to the build
system rather than injecting them into the compiler wrappers. This
avoids conflicts between flags that are chosen by the build system
and flags that are set by the user.
parent 4dd6ee25
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
from spack import *
class Ipopt(Package):
class Ipopt(AutotoolsPackage):
"""Ipopt (Interior Point OPTimizer, pronounced eye-pea-Opt) is a
software package for large-scale nonlinear optimization."""
homepage = "https://projects.coin-or.org/Ipopt"
......@@ -55,7 +55,14 @@ class Ipopt(Package):
patch('ipopt_ppc_build.patch', when='arch=ppc64le')
def install(self, spec, prefix):
flag_handler = AutotoolsPackage.build_system_flags
build_directory = 'spack-build'
# IPOPT does not build correctly in parallel on OS X
parallel = False
def configure_args(self):
spec = self.spec
# Dependency directories
blas_dir = spec['blas'].prefix
lapack_dir = spec['lapack'].prefix
......@@ -69,7 +76,7 @@ def install(self, spec, prefix):
blas_lib = spec['blas'].libs.ld_flags
lapack_lib = spec['lapack'].libs.ld_flags
configure_args = [
args = [
"--prefix=%s" % prefix,
"--with-mumps-incdir=%s" % mumps_dir.include,
"--with-mumps-lib=%s" % mumps_libcmd,
......@@ -82,18 +89,13 @@ def install(self, spec, prefix):
]
if 'coinhsl' in spec:
configure_args.extend([
args.extend([
'--with-hsl-lib=%s' % spec['coinhsl'].libs.ld_flags,
'--with-hsl-incdir=%s' % spec['coinhsl'].prefix.include])
if 'metis' in spec:
configure_args.extend([
args.extend([
'--with-metis-lib=%s' % spec['metis'].libs.ld_flags,
'--with-metis-incdir=%s' % spec['metis'].prefix.include])
configure(*configure_args)
# IPOPT does not build correctly in parallel on OS X
make(parallel=False)
make("test", parallel=False)
make("install", parallel=False)
return args
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment