VTK: add -no-ipo for builds using intel compiler (#20480)

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
andymwood 2021-01-05 21:11:29 +00:00 committed by GitHub
parent 61c1b71d38
commit 35d81a9006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,11 +265,10 @@ def cmake_args(self):
'-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 @@ def cmake_args(self):
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