diff --git a/build_scripts/gnu_no_omp.sh b/build_scripts/gnu_no_omp.sh index 6f73784..bde0aad 100755 --- a/build_scripts/gnu_no_omp.sh +++ b/build_scripts/gnu_no_omp.sh @@ -4,5 +4,17 @@ cd ../fortran gfortran -E ompgen.F90 -cpp -o omp.f90 f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. -python setup.py clean --all -python setup.py config_fc --f90flags="-mtune=generic" build_ext build + + +if [$CONDA_BUILD == 1] + if [ `uname` == Darwin ]; then + LDFLAGS="$LDFLAGS -undefined dynamic_lookup -bundle" + fi + $PYTHON setup.py clean --all + $PYTHON setup.py config_fc --f90flags="-mtune=generic" build_ext build + $PYTHON setup.py install --single-version-externally-managed --record=record.txt +else + python setup.py clean --all + python setup.py config_fc --f90flags="-mtune=generic" build_ext build + pip install . +fi diff --git a/build_scripts/gnu_omp.sh b/build_scripts/gnu_omp.sh index a9901b6..c088122 100755 --- a/build_scripts/gnu_omp.sh +++ b/build_scripts/gnu_omp.sh @@ -4,6 +4,18 @@ cd ../fortran gfortran -E ompgen.F90 -fopenmp -cpp -o omp.f90 f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature cd .. -python setup.py clean --all -python setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build + + +if [$CONCDA_BUILD == 1] + if [ `uname` == Darwin ]; then + LDFLAGS="$LDFLAGS -undefined dynamic_lookup -bundle" + fi + $PYTHON setup.py clean --all + $PYTHON setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build + $PYTHON setup.py install --single-version-externally-managed --record=record.txt +else + python setup.py clean --all + python setup.py config_fc --f90flags="-mtune=generic -fopenmp" build_ext --libraries="gomp" build + pip install . +fi diff --git a/build_scripts/win_mingw_no_omp.bat b/build_scripts/win_mingw_no_omp.bat index e254eec..601b3f2 100644 --- a/build_scripts/win_mingw_no_omp.bat +++ b/build_scripts/win_mingw_no_omp.bat @@ -3,11 +3,20 @@ CALL gfortran -E ompgen.F90 -cpp -o omp.f90 REM Wildcards not working on Windows for some reason CALL f2py -m _wrffortran -h wrffortran.pyf --overwrite-signature wrf_constants.f90 wrf_testfunc.f90 wrf_user.f90 rip_cape.f90 wrf_cloud_fracf.f90 wrf_fctt.f90 wrf_user_dbz.f90 wrf_relhl.f90 calc_uh.f90 wrf_user_latlon_routines.f90 wrf_pvo.f90 eqthecalc.f90 wrf_rip_phys_routines.f90 wrf_pw.f90 wrf_vinterp.f90 wrf_wind.f90 omp.f90 cd .. -CALL python setup.py clean --all -%PROCESSOR_ARCHITECTURE% == AMD64 ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=mingw32 --fcompiler=gnu95 -) else ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2 -mincoming-stack-boundary=2" build --compiler=mingw32 --fcompiler=gnu95 +IF %CONDA_BUILD% == 1 ( + IF %ARCH% == 64 ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -mincoming-stack-boundary=2" build --compiler=mingw32 --fcompiler=gnu95 + ) + CALL %PYTHON% setup.py install --single-version-externally-managed --record=record.txt +) ELSE ( + CALL python setup.py clean --all + IF %PROCESSOR_ARCHITECTURE% == AMD64 ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mincoming-stack-boundary=2" build --compiler=mingw32 --fcompiler=gnu95 + ) + CALL pip install . ) -CALL python setup.py install --single-version-externally-managed --record=record.txt diff --git a/build_scripts/win_mingw_omp.bat b/build_scripts/win_mingw_omp.bat index e9809e3..7b36225 100644 --- a/build_scripts/win_mingw_omp.bat +++ b/build_scripts/win_mingw_omp.bat @@ -3,11 +3,21 @@ CALL gfortran -E ompgen.F90 -cpp -fopenmp -o omp.f90 REM Wildcards not working on Windows for some reason CALLf2py -m _wrffortran -h wrffortran.pyf --overwrite-signature wrf_constants.f90 wrf_testfunc.f90 wrf_user.f90 rip_cape.f90 wrf_cloud_fracf.f90 wrf_fctt.f90 wrf_user_dbz.f90 wrf_relhl.f90 calc_uh.f90 wrf_user_latlon_routines.f90 wrf_pvo.f90 eqthecalc.f90 wrf_rip_phys_routines.f90 wrf_pw.f90 wrf_vinterp.f90 wrf_wind.f90 omp.f90 cd .. -CALL python setup.py clean --all -%PROCESSOR_ARCHITECTURE% == AMD64 ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 -) else ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 +IF %CONDA_BUILD% == 1 ( + IF %ARCH% == 64 ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 + ) + CALL %PYTHON% setup.py install --single-version-externally-managed --record=record.txt +) ELSE ( + CALL python setup.py clean --all + IF %PROCESSOR_ARCHITECTURE% == AMD64 ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 + ) + CALL pip install . ) -CALL python setup.py install --single-version-externally-managed --record=record.txt + diff --git a/build_scripts/win_msvc_mingw_no_omp.bat b/build_scripts/win_msvc_mingw_no_omp.bat index 3b0d008..c70cf4c 100644 --- a/build_scripts/win_msvc_mingw_no_omp.bat +++ b/build_scripts/win_msvc_mingw_no_omp.bat @@ -3,11 +3,20 @@ CALL gfortran -E ompgen.F90 -cpp -o omp.f90 REM Wildcards not working on Windows for some reason CALL f2py -m _wrffortran -h wrffortran.pyf --overwrite-signature wrf_constants.f90 wrf_testfunc.f90 wrf_user.f90 rip_cape.f90 wrf_cloud_fracf.f90 wrf_fctt.f90 wrf_user_dbz.f90 wrf_relhl.f90 calc_uh.f90 wrf_user_latlon_routines.f90 wrf_pvo.f90 eqthecalc.f90 wrf_rip_phys_routines.f90 wrf_pw.f90 wrf_vinterp.f90 wrf_wind.f90 omp.f90 cd .. -CALL python setup.py clean --all -%PROCESSOR_ARCHITECTURE% == AMD64 - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=msvc --fcompiler=gnu95 -) else ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2 -mincoming-stack-boundary=2" build --compiler=msvc --fcompiler=gnu95 -) -CALL python setup.py install --single-version-externally-managed --record=record.txt \ No newline at end of file +IF %CONDA_BUILD% == 1 ( + IF %ARCH% == 64 ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -mincoming-stack-boundary=2" build --compiler=msvc --fcompiler=gnu95 + ) + CALL %PYTHON% setup.py install --single-version-externally-managed --record=record.txt +) ELSE ( + CALL python setup.py clean --all + IF %PROCESSOR_ARCHITECTURE% == AMD64 ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95 + ) ELSE ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mincoming-stack-boundary=2" build --compiler=msvc --fcompiler=gnu95 + ) + CALL pip install . +) \ No newline at end of file diff --git a/build_scripts/win_msvc_mingw_omp.bat b/build_scripts/win_msvc_mingw_omp.bat index 40062d0..6c3fcc0 100644 --- a/build_scripts/win_msvc_mingw_omp.bat +++ b/build_scripts/win_msvc_mingw_omp.bat @@ -3,11 +3,20 @@ CALL gfortran -E ompgen.F90 -cpp -fopenmp -o omp.f90 REM Wildcards not working on Windows for some reason CALL f2py -m _wrffortran -h wrffortran.pyf --overwrite-signature wrf_constants.f90 wrf_testfunc.f90 wrf_user.f90 rip_cape.f90 wrf_cloud_fracf.f90 wrf_fctt.f90 wrf_user_dbz.f90 wrf_relhl.f90 calc_uh.f90 wrf_user_latlon_routines.f90 wrf_pvo.f90 eqthecalc.f90 wrf_rip_phys_routines.f90 wrf_pw.f90 wrf_vinterp.f90 wrf_wind.f90 omp.f90 cd .. -CALL python setup.py clean --all -%PROCESSOR_ARCHITECTURE% == AMD64 ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 -) else ( - CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 +IF %CONDA_BUILD% == 1 ( + IF %ARCH% == 64 ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 + ) ELSE ( + CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 + ) + CALL %PYTHON% setup.py install --single-version-externally-managed --record=record.txt +) ELSE ( + CALL python setup.py clean --all + IF %PROCESSOR_ARCHITECTURE% == AMD64 ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 + ) ELSE ( + CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 + ) + CALL pip install . ) -CALL python setup.py install --single-version-externally-managed --record=record.txt diff --git a/conda_recipe/bld.bat b/conda_recipe/bld.bat index cedde2c..808baee 100644 --- a/conda_recipe/bld.bat +++ b/conda_recipe/bld.bat @@ -1,8 +1,5 @@ -%ARCH% == 64 ( - %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=mingw32 --fcompiler=gnu95 -) else ( - %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2 -mincoming-stack-boundary=2" build --compiler=mingw32 --fcompiler=gnu95 -) -%PYTHON% setup.py install --single-version-externally-managed --record=record.txt +cd build_scripts +CALL win_msvc_mingw_omp.bat + diff --git a/conda_recipe/build.sh b/conda_recipe/build.sh index 9ae7b95..87e8e24 100644 --- a/conda_recipe/build.sh +++ b/conda_recipe/build.sh @@ -1,10 +1,6 @@ #!/bin/bash -if [ `uname` == Darwin ]; then - LDFLAGS="$LDFLAGS -undefined dynamic_lookup -bundle" -fi - -$PYTHON setup.py config_fc --f90flags="-mtune=generic -mfpmath=sse" build -$PYTHON setup.py install --single-version-externally-managed --record=record.txt +cd build_scripts +sh gnu_omp.sh diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index 6fbe7d0..ee75ff1 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -1,38 +1,40 @@ -{% set version = "1.0.5" %} +{% set version = "1.1.0" %} package: name: wrf-python version: {{ version }} source: - fn: wrf-python-{{ version }}.tar.gz - url: https://github.com/NCAR/wrf-python/archive/{{ version }}.tar.gz - sha256: ea2202e1d8237c65b9d77a91f00da0f2e7a37ed6214ddd976872b619b9647b33 + git_url: https://github.com/NCAR/wrf-python + git_branch: develop + build: number: 0 detect_binary_files_with_prefix: true - skip: True # [(win and py>=35)] requirements: build: - setuptools - - numpy x.x + - numpy 1.11.* # [unix] + - numpy 1.14.* # [win] - wrapt - - mingwpy # [win] + - m2w64-toolchain # [win] - gcc # [unix] - python run: - - numpy x.x + - setuptools + - numpy >=1.11 - python - wrapt - - mingwpy # [win] + - m2w64-gcc-libs # [win] - libgfortran # [unix] - libgcc # [unix] - xarray test: requires: + - setuptools - netcdf4 - xarray source_files: diff --git a/conda_recipe/meta.yaml.develop b/conda_recipe/meta.yaml.develop new file mode 100644 index 0000000..ee75ff1 --- /dev/null +++ b/conda_recipe/meta.yaml.develop @@ -0,0 +1,58 @@ +{% set version = "1.1.0" %} + +package: + name: wrf-python + version: {{ version }} + +source: + git_url: https://github.com/NCAR/wrf-python + git_branch: develop + + +build: + number: 0 + detect_binary_files_with_prefix: true + +requirements: + build: + - setuptools + - numpy 1.11.* # [unix] + - numpy 1.14.* # [win] + - wrapt + - m2w64-toolchain # [win] + - gcc # [unix] + - python + run: + - setuptools + - numpy >=1.11 + - python + - wrapt + - m2w64-gcc-libs # [win] + - libgfortran # [unix] + - libgcc # [unix] + - xarray + +test: + requires: + - setuptools + - netcdf4 + - xarray + source_files: + - test/ci_tests + imports: + - wrf + commands: + - cd test/ci_tests && python utests.py + +about: + home: https://github.com/NCAR/wrf-python + license: "UCAR" + license_file: '{{ environ["RECIPE_DIR"] }}/LICENSE' + summary: "Diagnostic and interpolation routines for WRF-ARW data." + +extra: + recipe-maintainers: + - bladwig1 + - marylhaley + - david-ian-brown + - khallock diff --git a/conda_recipe/meta.yaml.release b/conda_recipe/meta.yaml.release new file mode 100644 index 0000000..51c2ee0 --- /dev/null +++ b/conda_recipe/meta.yaml.release @@ -0,0 +1,58 @@ +{% set version = "1.1.0" %} + +package: + name: wrf-python + version: {{ version }} + +source: + fn: wrf-python-{{ version }}.tar.gz + url: https://github.com/NCAR/wrf-python/archive/{{ version }}.tar.gz + sha256: ea2202e1d8237c65b9d77a91f00da0f2e7a37ed6214ddd976872b619b9647b33 + +build: + number: 0 + detect_binary_files_with_prefix: true + +requirements: + build: + - setuptools + - numpy 1.11.* # [unix] + - numpy 1.14.* # [win] + - wrapt + - m2w64-toolchain # [win] + - gcc # [unix] + - python + run: + - setuptools + - numpy >=1.11 + - python + - wrapt + - m2w64-gcc-libs # [win] + - libgfortran # [unix] + - libgcc # [unix] + - xarray + +test: + requires: + - setuptools + - netcdf4 + - xarray + source_files: + - test/ci_tests + imports: + - wrf + commands: + - cd test/ci_tests && python utests.py + +about: + home: https://github.com/NCAR/wrf-python + license: "UCAR" + license_file: '{{ environ["RECIPE_DIR"] }}/LICENSE' + summary: "Diagnostic and interpolation routines for WRF-ARW data." + +extra: + recipe-maintainers: + - bladwig1 + - marylhaley + - david-ian-brown + - khallock