Bill Ladwig 6 years ago
parent
commit
a96dbd353d
  1. 79
      chey_intel.py
  2. 46
      setup.py

79
chey_intel.py

@ -13,7 +13,8 @@ compilers = ['IntelFCompiler', 'IntelVisualFCompiler',
def intel_version_match(type): def intel_version_match(type):
# Match against the important stuff in the version string # Match against the important stuff in the version string
return simple_version_match(start=r'Intel.*?Fortran.*?(?:%s).*?Version' % (type,)) return simple_version_match(
start=r'Intel.*?Fortran.*?(?:%s).*?Version'.format(type,))
class BaseIntelFCompiler(FCompiler): class BaseIntelFCompiler(FCompiler):
@ -36,13 +37,13 @@ class IntelFCompiler(BaseIntelFCompiler):
possible_executables = ['ifort', 'ifc'] possible_executables = ['ifort', 'ifc']
executables = { executables = {
'version_cmd' : None, # set by update_executables 'version_cmd': None, # set by update_executables
'compiler_f77' : [None, "-72", "-w90", "-w95"], 'compiler_f77': [None, "-72", "-w90", "-w95"],
'compiler_f90' : [None], 'compiler_f90': [None],
'compiler_fix' : [None, "-FI"], 'compiler_fix': [None, "-FI"],
'linker_so' : ["<F90>", "-shared"], 'linker_so': ["<F90>", "-shared"],
'archiver' : ["ar", "-cr"], 'archiver': ["ar", "-cr"],
'ranlib' : ["ranlib"] 'ranlib': ["ranlib"]
} }
pic_flags = ['-fPIC'] pic_flags = ['-fPIC']
@ -89,13 +90,13 @@ class IntelItaniumFCompiler(IntelFCompiler):
possible_executables = ['ifort', 'efort', 'efc'] possible_executables = ['ifort', 'efort', 'efc']
executables = { executables = {
'version_cmd' : None, 'version_cmd': None,
'compiler_f77' : [None, "-FI", "-w90", "-w95"], 'compiler_f77': [None, "-FI", "-w90", "-w95"],
'compiler_fix' : [None, "-FI"], 'compiler_fix': [None, "-FI"],
'compiler_f90' : [None], 'compiler_f90': [None],
'linker_so' : ['<F90>', "-shared"], 'linker_so': ['<F90>', "-shared"],
'archiver' : ["ar", "-cr"], 'archiver': ["ar", "-cr"],
'ranlib' : ["ranlib"] 'ranlib': ["ranlib"]
} }
@ -104,18 +105,19 @@ class IntelEM64TFCompiler(IntelFCompiler):
compiler_aliases = () compiler_aliases = ()
description = 'Intel Fortran Compiler for 64-bit apps' description = 'Intel Fortran Compiler for 64-bit apps'
version_match = intel_version_match('EM64T-based|Intel\\(R\\) 64|64|IA-64|64-bit') version_match = intel_version_match(
'EM64T-based|Intel\\(R\\) 64|64|IA-64|64-bit')
possible_executables = ['ifort', 'efort', 'efc'] possible_executables = ['ifort', 'efort', 'efc']
executables = { executables = {
'version_cmd' : None, 'version_cmd': None,
'compiler_f77' : [None, "-FI"], 'compiler_f77': [None, "-FI"],
'compiler_fix' : [None, "-FI"], 'compiler_fix': [None, "-FI"],
'compiler_f90' : [None], 'compiler_f90': [None],
'linker_so' : ['<F90>', "-shared"], 'linker_so': ['<F90>', "-shared"],
'archiver' : ["ar", "-cr"], 'archiver': ["ar", "-cr"],
'ranlib' : ["ranlib"] 'ranlib': ["ranlib"]
} }
def get_flags(self): def get_flags(self):
@ -147,13 +149,13 @@ class IntelVisualFCompiler(BaseIntelFCompiler):
possible_executables = ['ifort', 'ifl'] possible_executables = ['ifort', 'ifl']
executables = { executables = {
'version_cmd' : None, 'version_cmd': None,
'compiler_f77' : [None], 'compiler_f77': [None],
'compiler_fix' : [None], 'compiler_fix': [None],
'compiler_f90' : [None], 'compiler_f90': [None],
'linker_so' : [None], 'linker_so': [None],
'archiver' : [ar_exe, "/verbose", "/OUT:"], 'archiver': [ar_exe, "/verbose", "/OUT:"],
'ranlib' : None 'ranlib': None
} }
compile_switch = '/c ' compile_switch = '/c '
@ -163,7 +165,8 @@ class IntelVisualFCompiler(BaseIntelFCompiler):
module_include_switch = '/I' module_include_switch = '/I'
def get_flags(self): def get_flags(self):
opt = ['/nologo', '/MD', '/nbs', '/names:lowercase', '/assume:underscore'] opt = ['/nologo', '/MD', '/nbs', '/names:lowercase',
'/assume:underscore']
return opt return opt
def get_flags_free(self): def get_flags_free(self):
@ -192,13 +195,13 @@ class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
ar_exe = IntelVisualFCompiler.ar_exe ar_exe = IntelVisualFCompiler.ar_exe
executables = { executables = {
'version_cmd' : None, 'version_cmd': None,
'compiler_f77' : [None, "-FI", "-w90", "-w95"], 'compiler_f77': [None, "-FI", "-w90", "-w95"],
'compiler_fix' : [None, "-FI", "-4L72", "-w"], 'compiler_fix': [None, "-FI", "-4L72", "-w"],
'compiler_f90' : [None], 'compiler_f90': [None],
'linker_so' : ['<F90>', "-shared"], 'linker_so': ['<F90>', "-shared"],
'archiver' : [ar_exe, "/verbose", "/OUT:"], 'archiver': [ar_exe, "/verbose", "/OUT:"],
'ranlib' : None 'ranlib': None
} }

46
setup.py

@ -31,8 +31,8 @@ else:
chey_intel.IntelEM64TFCompiler) chey_intel.IntelEM64TFCompiler)
ext1 = numpy.distutils.core.Extension( ext1 = numpy.distutils.core.Extension(
name = "wrf._wrffortran", name="wrf._wrffortran",
sources = ["fortran/wrf_constants.f90", sources=["fortran/wrf_constants.f90",
"fortran/wrf_testfunc.f90", "fortran/wrf_testfunc.f90",
"fortran/wrf_user.f90", "fortran/wrf_user.f90",
"fortran/rip_cape.f90", "fortran/rip_cape.f90",
@ -55,9 +55,9 @@ with open("src/wrf/version.py") as f:
exec(f.read()) exec(f.read())
on_rtd = os.environ.get("READTHEDOCS", None) == "True" on_rtd = os.environ.get("READTHEDOCS", None) == "True"
#on_rtd=True # on_rtd=True
if on_rtd: if on_rtd:
if sys.version_info < (3,3): if sys.version_info < (3, 3):
requirements = ["mock"] # for python2 and python < 3.3 requirements = ["mock"] # for python2 and python < 3.3
else: else:
requirements = [] # for >= python3.3 requirements = [] # for >= python3.3
@ -68,29 +68,29 @@ else:
with open("requirements.txt") as f2: with open("requirements.txt") as f2:
requirements = f2.read().strip().splitlines() requirements = f2.read().strip().splitlines()
#if sys.version_info < (3,3): # if sys.version_info < (3,3):
# requirements.append("mock") # requirements.append("mock")
ext_modules = [ext1] ext_modules = [ext1]
numpy.distutils.core.setup( numpy.distutils.core.setup(
author = "Bill Ladwig", author="Bill Ladwig",
author_email = "ladwig@ucar.edu", author_email="ladwig@ucar.edu",
description = "Diagnostic and interpolation routines for WRF-ARW data.", description="Diagnostic and interpolation routines for WRF-ARW data.",
long_description = ("A collection of diagnostic and interpolation routines " long_description=("A collection of diagnostic and interpolation "
"to be used with WRF-ARW data.\n\n" "routines to be used with WRF-ARW data.\n\n"
"GitHub Repository:\n\n" "GitHub Repository:\n\n"
"https://github.com/NCAR/wrf-python\n\n" "https://github.com/NCAR/wrf-python\n\n"
"Documentation:\n\n" "Documentation:\n\n"
"http://wrf-python.rtfd.org\n"), "http://wrf-python.rtfd.org\n"),
url = "https://github.com/NCAR/wrf-python", url="https://github.com/NCAR/wrf-python",
keywords = ["python", "wrf-python", "wrf", "forecast", "model", keywords=["python", "wrf-python", "wrf", "forecast", "model",
"weather research and forecasting", "interpolation", "weather research and forecasting", "interpolation",
"plotting", "plots", "meteorology", "nwp", "plotting", "plots", "meteorology", "nwp",
"numerical weather prediction", "diagnostic", "numerical weather prediction", "diagnostic",
"science", "numpy"], "science", "numpy"],
install_requires = requirements, install_requires=requirements,
classifiers = ["Development Status :: 5 - Production/Stable", classifiers=["Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research", "Intended Audience :: Science/Research",
"Intended Audience :: Developers", "Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
@ -106,14 +106,14 @@ numpy.distutils.core.setup(
"Operating System :: Unix", "Operating System :: Unix",
"Operating System :: MacOS", "Operating System :: MacOS",
"Operating System :: Microsoft :: Windows"], "Operating System :: Microsoft :: Windows"],
name = "wrf-python", name="wrf-python",
platforms = ["any"], platforms=["any"],
license = "Apache License 2.0", license="Apache License 2.0",
version = __version__, version=__version__,
packages = setuptools.find_packages("src"), packages=setuptools.find_packages("src"),
ext_modules = ext_modules, ext_modules=ext_modules,
package_dir = {"" : "src"}, package_dir={"": "src"},
download_url = "http://python.org/pypi/wrf-python", download_url="http://python.org/pypi/wrf-python",
package_data={"wrf" : ["data/psadilookup.dat"]}, package_data={"wrf": ["data/psadilookup.dat"]},
scripts=[] scripts=[]
) )

Loading…
Cancel
Save