diff options
Diffstat (limited to 'numpy/distutils/fcompiler')
| -rw-r--r-- | numpy/distutils/fcompiler/environment.py | 15 | ||||
| -rw-r--r-- | numpy/distutils/fcompiler/pg.py | 6 |
2 files changed, 18 insertions, 3 deletions
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py index 489784580..4238f35cb 100644 --- a/numpy/distutils/fcompiler/environment.py +++ b/numpy/distutils/fcompiler/environment.py @@ -1,6 +1,7 @@ from __future__ import division, absolute_import, print_function import os +import warnings from distutils.dist import Distribution __metaclass__ = type @@ -54,8 +55,18 @@ class EnvironmentConfig(object): if envvar is not None: envvar_contents = os.environ.get(envvar) if envvar_contents is not None: - if var and append and os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1': - var = var + [envvar_contents] + if var and append: + if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1': + var = var + [envvar_contents] + else: + var = envvar_contents + if 'NPY_DISTUTILS_APPEND_FLAGS' not in os.environ.keys(): + msg = "{} is used as is, not appended ".format(envvar) + \ + "to flags already defined " + \ + "by numpy.distutils! Use NPY_DISTUTILS_APPEND_FLAGS=1 " + \ + "to obtain appending behavior instead (this " + \ + "behavior will become default in a future release)." + warnings.warn(msg, UserWarning, stacklevel=3) else: var = envvar_contents if confvar is not None and self._conf: diff --git a/numpy/distutils/fcompiler/pg.py b/numpy/distutils/fcompiler/pg.py index 99071800a..cdba0e39a 100644 --- a/numpy/distutils/fcompiler/pg.py +++ b/numpy/distutils/fcompiler/pg.py @@ -33,7 +33,7 @@ class PGroupFCompiler(FCompiler): 'compiler_f77': ["pgfortran"], 'compiler_fix': ["pgfortran", "-Mfixed"], 'compiler_f90': ["pgfortran"], - 'linker_so': ["pgfortran", "-shared", "-fpic"], + 'linker_so': ["pgfortran"], 'archiver': ["ar", "-cr"], 'ranlib': ["ranlib"] } @@ -56,6 +56,10 @@ class PGroupFCompiler(FCompiler): def get_flags_linker_so(self): return ["-dynamic", '-undefined', 'dynamic_lookup'] + else: + def get_flags_linker_so(self): + return ["-shared", '-fpic'] + def runtime_library_dir_option(self, dir): return '-R"%s"' % dir |
