Fix for test cases/frameworks/17 mpi on Cygwin
Unusually, the cygwin package for openmpi installs headers into
/usr/include, rather than /usr/include/openmpi
Prevent pkg-config from suppressing that -I flag, so a gfortran INCLUDE can
find those files
@@ -495,7 +495,13 @@ class PkgConfigDependency(ExternalDependency):
return converted
def _set_cargs(self):
- ret, out = self._call_pkgbin(['--cflags', self.name])
+ env = None
+ if self.language == 'fortran':
+ # gfortran doesn't appear to look in system paths for INCLUDE files,
+ # so don't allow pkg-config to suppress -I flags for system paths
+ env = os.environ.copy()
+ env['PKG_CONFIG_ALLOW_SYSTEM_CFLAGS'] = '1'
+ ret, out = self._call_pkgbin(['--cflags', self.name], env=env)
if ret != 0:
raise DependencyException('Could not generate cargs for %s:\n\n%s' %
(self.name, out))
