Skip to content

Commit

Permalink
Test/fix CI + update docs + use ssh for cloning (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmey authored Aug 29, 2018
1 parent 4e02ae0 commit f59a33b
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 224 deletions.
2 changes: 1 addition & 1 deletion .ci/travis/install-wrf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ $SYSTEM == "cmake" ]; then

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=install \
-DENABLE_GRIB1=${GRIB1} -DENABLE_GRIB2=${GRIB2} -DMODE=${MODE} -DNESTING=${NESTING} -DIDEAL_CASE=${IDEAL_CASE} ..
-DENABLE_GRIB1=${GRIB1} -DENABLE_GRIB2=${GRIB2} -DMODE=${MODE} -DNESTING=${NESTING} ..

# It sometimes happens that the compiler runs out of memory due to parallel compilation.
# The construction below means "try with 2 cores, and if it fails, try again with 1 core".
Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- WRF_COMMIT=$TRAVIS_COMMIT
- WPS_COMMIT=wps-cmake
- WATS_REPO=WRF-CMake/wats
- WATS_BRANCH=master
- WATS_BRANCH=wats-ci # TODO change to master
- WATS_DATA_REPO=WRF-CMake/wats-data
- WATS_MODE=wrf

Expand Down Expand Up @@ -68,7 +68,6 @@ jobs:
- GRIB2=0
- MODE=dm+sm
- NESTING=basic
- IDEAL_CASE=ALL

- stage: build
os: osx
Expand Down Expand Up @@ -100,11 +99,9 @@ jobs:

- stage: wats
os: linux
git:
depth: 1 # ideally we'd like to disable cloning completely
before_install: skip
install:
- git clone --depth=1 --branch=$WATS_BRANCH git@github.com:$WATS_REPO.git wats
- git clone --depth=1 --branch=$WATS_BRANCH https://github.com/$WATS_REPO.git wats
script:
- wats/.ci/travis/trigger-wats-travis.sh
- wats/.ci/travis/trigger-wats-appveyor.sh
Expand All @@ -119,8 +116,8 @@ script: skip

before_deploy:
- cd ..
- git clone --depth=100 --no-single-branch git@github.com:$WPS_REPO.git WPS
- git clone --depth=1 --branch=$WATS_BRANCH git@github.com:$WATS_REPO.git wats
- git clone --depth=100 --no-single-branch https://github.com/$WPS_REPO.git WPS
- git clone --depth=1 --branch=$WATS_BRANCH https://github.com/$WATS_REPO.git wats
- cd WPS
- git checkout $WPS_COMMIT
- .ci/travis/install-wps.sh
Expand All @@ -130,9 +127,12 @@ before_deploy:
- python wats/wats/main.py run --mode $WATS_MODE --wrf-dir WRF --wps-dir WPS --work-dir wats_work $MPI_FLAG

deploy:
provider: script
skip_cleanup: true
provider: pages
github-token: $GITHUB_TOKEN
skip-cleanup: true
local-dir: ../wats_work/output
repo: $WATS_DATA_REPO
target-branch: $TRAVIS_REPO_SLUG-$TRAVIS_BUILD_NUMBER-$MODE
on:
all_branches: true
condition: $SYSTEM = make
script: bash wats/.ci/travis/deploy-wats-data.sh wats_work/output
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<p align="center"><img src="images/WRF-Cmake_Logo.svg" alt="WRF-CMake Logo" width="160"></p>
# WRF-CMake [![Build status](https://ci.appveyor.com/api/projects/status/86508wximkvmf95g/branch/wrf-cmake?svg=true)](https://ci.appveyor.com/project/WRF-CMake/wrf/branch/wrf-cmake) [![Build Status](https://travis-ci.com/WRF-CMake/WRF.svg?branch=wrf-cmake)](https://travis-ci.com/WRF-CMake/WRF)

## Table of contents
- [Table of contents](#table-of-contents)
- [What is WRF-CMake?](#what-is-wrf-cmake)
- [Currently supported platforms](#currently-supported-platforms)
- [Currently unsupported features](#currently-unsupported-features)
Expand Down Expand Up @@ -38,7 +36,7 @@ To download the latest releases, please see the following links:
To use WRF-CMake and WPS-CMake built in `dmpar`, you need to download and install Microsoft MPI — download and install `msmpisetup.exe` from [https://www.microsoft.com/en-us/download/details.aspx?id=56727](https://www.microsoft.com/en-us/download/details.aspx?id=56727).

### Build from source
To build WRF-CMake from source, please refer to the [WRF-CMake Installation page](README_CMAKE.md).
To build WRF-CMake from source, please refer to the [WRF-CMake Installation page](README_CMAKE_INSTALL.md).

## Changes to be upstreamed
- `external/io_grib1/MEL_grib1/{grib_enc.c,gribputgds.c,pack_spatial.c}`: Remove redundant header includes causing symbol conflicts in Windows
Expand All @@ -60,4 +58,4 @@ General WRF copyright and license applies for any files part of the original WRF
Additional files provided by WRF-CMake are licensed according to [LICENSE_CMAKE.txt](LICENSE_CMAKE.txt) if the relevant file contains the following header at the beginning of the file, otherwise the general WRF copyright and license applies.
```
Copyright 2018 M. Riechert and D. Meyer. Licensed under the MIT License.
```
```
10 changes: 5 additions & 5 deletions README_CMAKE.md → README_CMAKE_INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# How to install WRF-CMake and WPS-CMake from source

There are two mandatory steps and one optional step to install WRF-CMake/WPS-CMake from source on your system:
1. [Install dependencies](#install-dependencies)
2. [Build and Install WRF-CMake](#build-and-install-wrf-cmake)
3. [Build and Install WPS-CMake (required to run `real` cases)](#build-and-install-wps-cmake)
1. Required: [Install dependencies](#install-dependencies)
2. Required: [Build and Install WRF-CMake](#build-and-install-wrf-cmake)
3. Optional: [Build and Install WPS-CMake required to run `real` cases](#build-and-install-wps-cmake)

## Install dependencies
The following libraries are required on your system to install WRF-CMake from source: [Git](https://git-scm.com/), [JasPer](https://www.ece.uvic.ca/~frodo/jasper/), [libpng](http://www.libpng.org/pub/png/libpng.html), [libjpeg](http://libjpeg.sourceforge.net/), [zlib](https://zlib.net/), [HDF5](https://support.hdfgroup.org/HDF5/), [NetCDF-C](https://www.unidata.ucar.edu/downloads/netcdf/index.jsp), [NetCDF-Fortran](https://www.unidata.ucar.edu/downloads/netcdf/index.jsp), and MPI (required if building in `dmpar` or `dm+sm` mode). The above libraries are most likely available from your system's package manager (e.g. APT, yum, Homebrew, etc.). If you do not have the latest version of these libraries installed on your system, please refer to [How to install required libraries for WRF-CMake](README_CMAKE_LIBS.md).
Expand All @@ -25,7 +25,7 @@ where `<install_directory>` is the directory where to install WRF. Depending on
### On Windows (with MinGW-w64 and gcc/gfortran)
Make sure you [installed all the required dependencies](README_CMAKE_LIBS.md) before continuing.

### Build WRF-CMake in serial mode
#### Build WRF-CMake in serial mode
Open an MSYS2 **MinGW 64-bit** shell and run:
```sh
git clone https://github.com/WRF-CMake/WRF.git
Expand All @@ -36,7 +36,7 @@ cmake --build . --target install
```
The folder `~/WRF_install` now contains the WRF installation and is ready to use.

### Build WRF-CMake with MPI support
#### Build WRF-CMake with MPI support
Open an MSYS2 **MinGW 64-bit** shell and run:
```sh
git clone https://github.com/WRF-CMake/WRF.git
Expand Down
73 changes: 66 additions & 7 deletions README_CMAKE_LIBS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,73 @@
# How to install required libraries for WRF-CMake
The following libraries are required on your system to install WRF-CMake from source: [Git](https://git-scm.com/), [JasPer](https://www.ece.uvic.ca/~frodo/jasper/), [libpng](http://www.libpng.org/pub/png/libpng.html), [libjpeg](http://libjpeg.sourceforge.net/), [zlib](https://zlib.net/), [HDF5](https://support.hdfgroup.org/HDF5/), [NetCDF-C](https://www.unidata.ucar.edu/downloads/netcdf/index.jsp), [NetCDF-Fortran](https://www.unidata.ucar.edu/downloads/netcdf/index.jsp), and MPI (required if building in `dmpar` or `dm+sm` mode).

For the installation of libraries, we rely on your system's package managers (APT, YUM, Homebrew). We assume that you have administrative privileges on your computer. If you do not have administrative privileges you should request these libraries to be installed by your system administrator so that they can tare of this for you and manage updates on your behalf.

## Table of contents
- [Ubuntu](#ubuntu)
- [Ubuntu 14.04 LTS (Trusty)](#14.04-lts-(trusty))
- [16.04 LTS (Xenial)](#16.04-lts-(xenial))
- [18.04 LTS (Bionic)](#18.04-lts-(bionic))
- [macOS](#macOS)
- [Windows](#windows)
- [Microsoft MPI support](#microsoft-mpi-support)

## Ubuntu

### Ubuntu 14.04 LTS (Trusty)
To install all the required dependencies, including support for MPI, run the following commands from your terminal prompt:

```sh
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git cmake3 gfortran libnetcdf-dev libpng-dev libjasper-dev libmpich-dev
```

After the installtion is complete, you can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).

### 16.04 LTS (Xenial)
To install all the required dependencies, including support for MPI, run the following commands from your terminal prompt:

```sh
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git cmake gfortran libnetcdf-dev libnetcdff-dev libpng-dev libjasper-dev libjpeg-dev zlib1g-dev libmpich-dev
```

After the installtion is complete, you can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).

### 18.04 LTS (Bionic)

To install all the required dependencies except for JasPer (installed manually, see below), including support for MPI, run the following commands from your terminal prompt:

### Ubuntu
```sh
sudo apt-get install libjasper-dev libjpeg-dev libpng-dev zlib1g-dev libmpich-dev
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git cmake gfortran libnetcdf-dev libnetcdff-dev libpng-dev libjpeg-dev zlib1g-dev libmpich-dev
```

NOTE: `libjasper-dev` is currently not provided though APT and you will need to install it from source. For the moment, you can simply [download the latest version of JasPer](https://www.ece.uvic.ca/~frodo/jasper/#download) and install it manually from source. To do this you can use the following commands:

```
cd /tmp
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-2.0.14.tar.gz
tar xvzf jasper-2.0.14.tar.gz
cd jasper-2.0.14/build/
cmake build ..
sudo make install
```

After the installtion is complete, you can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).

## macOS

On macOS, we can use Homebrew to to install the required libraries. If you do not have Homebrew installed on your system, install it from [here](https://brew.sh/) then, to install all the required dependencies, including support for MPI, run the following commands from your terminal prompt:

### macOS
```sh
brew update
brew install gcc netcdf jasper
brew install git cmake gcc netcdf jasper mpich
```

### Windows
After the installtion is complete, you can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).

## Windows
- Install the 64bit version of [MSYS2](http://www.msys2.org/)
- If you already have MSYS2 installed, make sure that you didn't compile and install any of WRF's dependencies within the **MSYS** shell, otherwise these might be picked up by accident within the **MinGW** shell. To be sure, use a fresh MSYS2 install.
- Inside the MSYS2 **MinGW 64-bit** shell, run `pacman -Syu`
Expand Down Expand Up @@ -40,7 +97,9 @@ cmake -DCMAKE_GENERATOR="MSYS Makefiles" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_T
make install
```

#### Microsoft MPI
If you require MPI support you can continue with the section below, otherwise you can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).

### Microsoft MPI support
The following MS MPI instructions originated from:
- http://www.math.ucla.edu/~wotaoyin/windows_coding.html
- https://github.com/coderefinery/autocmake/issues/85
Expand Down Expand Up @@ -86,4 +145,4 @@ mpiexec -n 2 example1.exe
mpiexec -n 2 example2.exe
```

If everything went OK, you can now build WRF with MPI.
If everything went OK, you can now build WRF with MPI. You can go back to [Build and Install WRF-CMake](README_CMAKE_INSTALL.md#build-and-install-wrf-cmake).
Loading

0 comments on commit f59a33b

Please sign in to comment.