summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjunkudo <junkudo18@gmail.com>2018-01-18 10:39:08 -0800
committerscheibelp <scheibel1@llnl.gov>2018-01-18 10:39:08 -0800
commit9704369f171b421add4d9bc89ea3031225b3ab78 (patch)
tree88981aeda3d5d4032ba54eb1c30e7e9ea9661505
parent4dd6ee25d609f87864cef71abfcb8ebe25516131 (diff)
downloadspack-9704369f171b421add4d9bc89ea3031225b3ab78.tar.gz
spack-9704369f171b421add4d9bc89ea3031225b3ab78.tar.bz2
spack-9704369f171b421add4d9bc89ea3031225b3ab78.tar.xz
spack-9704369f171b421add4d9bc89ea3031225b3ab78.zip
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.
-rw-r--r--var/spack/repos/builtin/packages/ipopt/package.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/ipopt/package.py b/var/spack/repos/builtin/packages/ipopt/package.py
index caa37c3104..d96f3564fa 100644
--- a/var/spack/repos/builtin/packages/ipopt/package.py
+++ b/var/spack/repos/builtin/packages/ipopt/package.py
@@ -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 @@ class Ipopt(Package):
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 @@ class Ipopt(Package):
]
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