diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/vtk/package.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 834a96b7ab..d7a7126830 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -265,11 +265,10 @@ class Vtk(CMakePackage): '-DVTK_USE_X:BOOL=ON', '-DVTK_USE_COCOA:BOOL=OFF']) + compile_flags = [] + if spec.satisfies('@:6.1.0'): - cmake_args.extend([ - '-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY', - '-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY' - ]) + compile_flags.append('-DGLX_GLXEXT_LEGACY') # VTK 6.1.0 (and possibly earlier) does not use # NETCDF_CXX_ROOT to detect NetCDF C++ bindings, so @@ -298,4 +297,16 @@ class Vtk(CMakePackage): cmake_args.append( '-DVTK_MODULE_ENABLE_VTK_IOMotionFX:BOOL=OFF') + # -no-ipo prevents an internal compiler error from multi-file + # optimization (https://github.com/spack/spack/issues/20471) + if '%intel' in spec: + compile_flags.append('-no-ipo') + + if compile_flags: + compile_flags = ' '.join(compile_flags) + cmake_args.extend([ + '-DCMAKE_C_FLAGS={0}'.format(compile_flags), + '-DCMAKE_CXX_FLAGS={0}'.format(compile_flags) + ]) + return cmake_args |