Browse Source

Updated build scripts and recipe

lon0
Bill Ladwig 7 years ago
parent
commit
dd188359a4
  1. 16
      build_scripts/gnu_no_omp.sh
  2. 16
      build_scripts/gnu_omp.sh
  3. 21
      build_scripts/win_mingw_no_omp.bat
  4. 22
      build_scripts/win_mingw_omp.bat
  5. 23
      build_scripts/win_msvc_mingw_no_omp.bat
  6. 21
      build_scripts/win_msvc_mingw_omp.bat
  7. 9
      conda_recipe/bld.bat
  8. 8
      conda_recipe/build.sh
  9. 20
      conda_recipe/meta.yaml
  10. 58
      conda_recipe/meta.yaml.develop
  11. 58
      conda_recipe/meta.yaml.release

16
build_scripts/gnu_no_omp.sh

@ -4,5 +4,17 @@ cd ../fortran
gfortran -E ompgen.F90 -cpp -o omp.f90 gfortran -E ompgen.F90 -cpp -o omp.f90
f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature
cd .. 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

16
build_scripts/gnu_omp.sh

@ -4,6 +4,18 @@ cd ../fortran
gfortran -E ompgen.F90 -fopenmp -cpp -o omp.f90 gfortran -E ompgen.F90 -fopenmp -cpp -o omp.f90
f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature f2py *.f90 -m _wrffortran -h wrffortran.pyf --overwrite-signature
cd .. 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

21
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 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 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 .. cd ..
CALL python setup.py clean --all
%PROCESSOR_ARCHITECTURE% == AMD64 ( IF %CONDA_BUILD% == 1 (
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=mingw32 --fcompiler=gnu95 IF %ARCH% == 64 (
) else ( CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2 -mincoming-stack-boundary=2" 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

22
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 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 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 .. cd ..
CALL python setup.py clean --all
%PROCESSOR_ARCHITECTURE% == AMD64 ( IF %CONDA_BUILD% == 1 (
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95 IF %ARCH% == 64 (
) else ( CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=mingw32 --fcompiler=gnu95
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" 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

23
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 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 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 .. cd ..
CALL python setup.py clean --all
%PROCESSOR_ARCHITECTURE% == AMD64 IF %CONDA_BUILD% == 1 (
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=msvc --fcompiler=gnu95 IF %ARCH% == 64 (
) else ( CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic" build --compiler=mingw32 --fcompiler=gnu95
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2 -mincoming-stack-boundary=2" build --compiler=msvc --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 )
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 .
)

21
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 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 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 .. cd ..
CALL python setup.py clean --all
%PROCESSOR_ARCHITECTURE% == AMD64 ( IF %CONDA_BUILD% == 1 (
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95 IF %ARCH% == 64 (
) else ( CALL %PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp" build_ext --libraries="gomp" build --compiler=msvc --fcompiler=gnu95
CALL python setup.py config_fc --f90flags="-O2 -mtune=generic -fopenmp -mincoming-stack-boundary=2" 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

9
conda_recipe/bld.bat

@ -1,8 +1,5 @@
%ARCH% == 64 ( cd build_scripts
%PYTHON% setup.py config_fc --f90flags="-O2 -mtune=generic -mfpmath=sse -msse2" build --compiler=mingw32 --fcompiler=gnu95 CALL win_msvc_mingw_omp.bat
) 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

8
conda_recipe/build.sh

@ -1,10 +1,6 @@
#!/bin/bash #!/bin/bash
if [ `uname` == Darwin ]; then cd build_scripts
LDFLAGS="$LDFLAGS -undefined dynamic_lookup -bundle" sh gnu_omp.sh
fi
$PYTHON setup.py config_fc --f90flags="-mtune=generic -mfpmath=sse" build
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

20
conda_recipe/meta.yaml

@ -1,38 +1,40 @@
{% set version = "1.0.5" %} {% set version = "1.1.0" %}
package: package:
name: wrf-python name: wrf-python
version: {{ version }} version: {{ version }}
source: source:
fn: wrf-python-{{ version }}.tar.gz git_url: https://github.com/NCAR/wrf-python
url: https://github.com/NCAR/wrf-python/archive/{{ version }}.tar.gz git_branch: develop
sha256: ea2202e1d8237c65b9d77a91f00da0f2e7a37ed6214ddd976872b619b9647b33
build: build:
number: 0 number: 0
detect_binary_files_with_prefix: true detect_binary_files_with_prefix: true
skip: True # [(win and py>=35)]
requirements: requirements:
build: build:
- setuptools - setuptools
- numpy x.x - numpy 1.11.* # [unix]
- numpy 1.14.* # [win]
- wrapt - wrapt
- mingwpy # [win] - m2w64-toolchain # [win]
- gcc # [unix] - gcc # [unix]
- python - python
run: run:
- numpy x.x - setuptools
- numpy >=1.11
- python - python
- wrapt - wrapt
- mingwpy # [win] - m2w64-gcc-libs # [win]
- libgfortran # [unix] - libgfortran # [unix]
- libgcc # [unix] - libgcc # [unix]
- xarray - xarray
test: test:
requires: requires:
- setuptools
- netcdf4 - netcdf4
- xarray - xarray
source_files: source_files:

58
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

58
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
Loading…
Cancel
Save