From 3c1f87099b53b586d582c4a683ad4c934cd48a30 Mon Sep 17 00:00:00 2001 From: Felix Liu <90607304+felliu@users.noreply.github.com> Date: Mon, 21 Mar 2022 17:01:13 +0100 Subject: [PATCH] Updated configure flags in newer versions of ipopt (#29445) --- .../repos/builtin/packages/ipopt/package.py | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/var/spack/repos/builtin/packages/ipopt/package.py b/var/spack/repos/builtin/packages/ipopt/package.py index 84d2a648d1..8ef7cc6280 100644 --- a/var/spack/repos/builtin/packages/ipopt/package.py +++ b/var/spack/repos/builtin/packages/ipopt/package.py @@ -77,7 +77,7 @@ def configure_args(self): "coin_skip_warn_cxxflags=yes", ] - if spec.satisfies('@:3.12.10'): + if spec.satisfies('@:3.12.13'): args.extend([ "--with-lapack-lib={0}".format(lapack_lib), "--with-lapack-incdir={0}".format(lapack_dir.include), @@ -90,24 +90,35 @@ def configure_args(self): ]) if '+mumps' in spec: - # Add directory with fake MPI headers in sequential MUMPS - # install to header search path mumps_dir = spec['mumps'].prefix mumps_flags = "-ldmumps -lmumps_common -lpord -lmpiseq" mumps_libcmd = "-L%s " % mumps_dir.lib + mumps_flags - args.extend([ - "--with-mumps-incdir=%s" % mumps_dir.include, - "--with-mumps-lib=%s" % mumps_libcmd]) + if spec.satisfies('@:3.12.13'): + args.extend([ + "--with-mumps-incdir=%s" % mumps_dir.include, + "--with-mumps-lib=%s" % mumps_libcmd]) + else: + args.extend([ + "--with-mumps", + "--with-mumps-lflags=%s" % mumps_libcmd, + "--with-mumps-cflags=%s" % mumps_dir.include]) if 'coinhsl' in spec: - args.extend([ - '--with-hsl-lib=%s' % spec['coinhsl'].libs.ld_flags, - '--with-hsl-incdir=%s' % spec['coinhsl'].prefix.include]) + if spec.satisfies('@:3.12.13'): + args.extend([ + '--with-hsl-lib=%s' % spec['coinhsl'].libs.ld_flags, + '--with-hsl-incdir=%s' % spec['coinhsl'].prefix.include]) + else: + args.extend([ + "--with-hsl", + "--with-hsl-lflags=%s" % spec['coinhsl'].libs.ld_flags, + "--with-hsl-cflags=%s" % spec['coinhsl'].prefix.include]) if 'metis' in spec: - args.extend([ - '--with-metis-lib=%s' % spec['metis'].libs.ld_flags, - '--with-metis-incdir=%s' % spec['metis'].prefix.include]) + if spec.satisfies('@:3.12.13'): + args.extend([ + '--with-metis-lib=%s' % spec['metis'].libs.ld_flags, + '--with-metis-incdir=%s' % spec['metis'].prefix.include]) # The IPOPT configure file states that '--enable-debug' implies # '--disable-shared', but adding '--enable-shared' overrides