VTK: add -no-ipo for builds using intel compiler (#20480)
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
61c1b71d38
commit
35d81a9006
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user