Friday, June 22, 2018

Parflow-CLM installation guide on Widows machines using the “Windows Subsystem for Linux”


Interesting, but not surprising, many current ParFlow users one day never knew how to use the Linux environment. This post is not about you can now install and run ParFlow on Windows, but introduces a compatibility layer for running Linux binary executables on a Windows machine. This is called “Windows Subsystem for Linux” which has been included with Windows 10 version 1607 and later. The following instruction walks you through a step-by-step guide on how to install ParFlow-CLM on a Windows machine using this platform. It is pretty straightforward and has been tested successfully on different machines to assure functionality. Please notice that you must follow the steps below exactly in order, and every step must pass successfully before proceeding to the next one.

Step 1. Install the Windows Subsystem for Linux

Taken from the Microsoft page, you first need to enable the "Windows Subsystem for Linux" optional feature and reboot. To do so,
  • Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Restart your computer when prompted.
  • Open the Microsoft Store and download Ubuntu.
  • Once the download has completed, select "Launch". This will open a console window. Wait for installation to complete then you will be prompted to create your LINUX user account.
  • Create your LINUX username and password. This user account has no relationship to your Windows username and password and hence can be different.
  • You're done! Now you can use your Linux environment.
Step 2. Download ParFlow-CLM manual

This manual includes the instructions on how to install ParFlow-CLM using cmake.

https://github.com/parflow/parflow/blob/master/parflow-manual.pdf

Step 3. Setup environment variables 

In the terminal, navigate to your home directory and edit your ".bash_profile" as follows:

> cd ~
> vim ~/.bash_profile

Press "i" to enter the insert mode, put the cursor to the end of this file, and add the following lines: 

export PARFLOW_SILO_DIR=~/pfdir/silo/
export PARFLOW_HYPRE_DIR=~/pfdir/hypre/
export PARFLOW_DIR=~/pfdir/install/
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
export PATH=/usr/local/bin/:$PATH

Press esc, and then :wq to save and exit the bash file. Then type:

> source ~/.bash_profile

Step 4. Download parflow-clm package

In your Ubuntu shell, type:

mkdir ~/pfdir
cd ~/pfdir
git clone https://github.com/parflow/parflow.git

Step 5. Install gcc

In your Ubuntu shell, type:

> cd
> sudo apt-get update
> sudo apt-get install gcc
> sudo apt-get install g++
> sudo apt-get install gdc
> sudo apt-get install tcl-dev
> sudo apt-get install tk-dev
> sudo apt-get install build-essential
> sudo apt-get install libgcc1 lib32gcc1 libx32gcc1
> sudo apt-get install build-essential autoconf automake libtool
sudo apt-get install libibnetdisc-dev
> sudo apt-get install binutils
> sudo apt-get install binutils-dev
> sudo apt install gfortran

(When you use the sudo command, it probably asks for your UNIX password.)
Note that it might take a while to install all features depending on your internet speed, etc. Also, whenever asked for “Do you want to continue? [Y/n]”, press Y.

Step 6. Install or update OpenMPI

In your Ubuntu shell, type:

> cd
> cd ~/pfdir
> wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.0.tar.gz
> tar -xvf openmpi-3.1.0.tar.gz
> cd openmpi-3.1.0
> ./configure --prefix=/usr/local/
Then proceed with:

> sudo apt-get install make
> sudo make all install

Please notice that you must not face any error during the installation. Also, stay patient with OpenMPI installation; it might take a fairly good amount of time.

Step 7. Download and install SILO

In your Ubuntu shell, type:

> cd
> cd ~/pfdir
> wget https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2.tar.gz
> tar -xvf silo-4.10.2.tar.gz
> mv silo-4.10.2 silo
> cd silo
./configure --disable-silex
> sudo make all install
Step 8. Download and install HYPRE
In your Ubuntu shell, type:

> cd
> cd ~/pfdir
> wget https://computation.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods/download/hypre-2.9.0b.tar.gz
> tar -xvf hypre-2.9.0b.tar.gz
> mv hypre-2.9.0b hypre
> cd hypre/src
> ./configure --prefix=$PARFLOW_HYPRE_DIR --with-MPI
sudo make install

Step 9. Install Parflow-clm

In your Ubuntu shell, type:

> cd
> cd ~/pfdir
> mkdir build
> cd build
> sudo apt install cmake
> cmake ../parflow -DPARFLOW_AMPS_LAYER=mpi1 -DPARFLOW_HAVE_CLM=ON -DSILO_ROOT=$PARFLOW_SILO_DIR -DHYPRE_ROOT=$PARFLOW_HYPRE_DIR -DCMAKE_INSTALL_PREFIX=$PARFLOW_DIR -DPARFLOW_AMPS_SEQUENTIAL_IO=true
> make
> make install

Note: For some reason, Ubuntu doesn't understand the dashes before each option when copying them into the shell. Hence instead of copying and pasting from this instruction, I recommend users to type the above cmake line manually. Otherwise, you might face the following error:

CMake Error: The source directory "/home/mdanesh/pfdir/build/–DHYPRE_ROOT=/home/mdanesh/pfdir/hypre" does not exist.

Step 10. Check if ParfFow-CLM is working

> make test

This will run some test cases that come with ParFlow package. If some tests fail, don't worry; they probably need a total number of processors that your machine doesn't support.

ParFlow-CLM should be now ready to go! Enjoy and let me know if you faced any issues at danesh[@]sharif[dot]edu.



Monday, October 16, 2017

ParFlow repository moved to GitHub

New ParFlow Repository Location


The ParFlow repository has been moved to GitHub.  The new repository is located here:

ParFlow GitHub Repository

The Subversion based CloudForge repository is for archival purposes, please use the GitHub repo to download the latest versions of ParFlow.


The new repository is using Git.  We are replacing Subversion since Git is a newer source code control system that is gaining widespread use for open source projects.  GitHub is a hosting site for many projects.

There are many web resources for learning Git.   There is a free Git book available here:

   https://git-scm.com/book/en/v2

If you simply wish to obtain the latest version of ParFlow replace the previous "svn checkout ..." commands with:

>git clone https://github.com/parflow/parflow.git

OS X Yosemite build instruction updates


The following are some helpful instructions provided by Laura Condon updating the build steps for installing ParFlow on OS X Yosemite.

Modifications to the ParFlow blog instructions for installation
Most of the steps on the blog are just fine but the one that needs updating is item 7 on the Yosemite installation instructions (Installing ParFlow in OSX-Yosemite), we’ve really only got two changes.

1. Navigate to your “~/ParF” folder. We’re going to download the source from the “master” branch on GitHub and this will create a folder in this directory called “parflow.” In order for the installation to succeed, the environment variable “PARFLOW_DIR” needs to match this directory name. To verify this, at the command line , type

>echo $PARFLOW_DIR

and something like this should be returned (where
username is you’re your username):

/Users/*username*/ParF/parflow

is a directory This can actually be anything you’d like, but you’ll need to
2. Download the source from the repository.   Within “~ParF/”, type the following:

>git clone -b master --single-branch https://github.com/parflow/parflow.git

“git” tells the system we’re using a command for the repository, “clone” tells it to make a local copy, “-b master --single-branch” extracts only the main branch of the development tree and the URL is the path to the repository. If you google “github parflow” and navigate into the source tree, on the right had side you’ll see a green box that contains that URL when you click on it.
When you enter that command you should the download start. After its done, type “ls” and you should see a folder called “parflow.” If you’d like to rename it to reflect the version you can type

>mv parflow parflow.3.2.0

Or any other name you’d like, just make sure to update the $PARFLOW_DIR variable to reflect your name.

Saturday, January 16, 2016

Setup guide for OS X 10.11 El Capitan

by Nick Engdahl


By now you've probably upgraded your Mac to OS X El Capitan (version 10.11) and if you had a previous installation of ParFlow on OS X Yosemite on your system, it's probably working just fine. The reason is that, unlike some previous OS X updates, very little has changed under the hood between the two most recent releases that would have any effect on ParFlow. So to make this arguably the shortest blog post of all time, if you're trying to get a new installation set up on El Capitan the instructions for OS X Yosemite are all you'll need:

OS X Yosemite instructions

But before you click over there, we have come across a very important compatibility issue with Hypre you need to know about. The most recent version (2.10) has changed some function calls and is not compatible with the current ParFlow release. Fortunately, the Hypre developers leave most of their versions available for download so be sure to use Hypre release 2.9.0b or the ParFlow installation will fail.

All of the other components have been tested and we can report that GCC version 6.0, Silo version 4.10.2, and OpenMPI 1.10.2 all work, it's just Hypre that is being difficult. We're looking into an efficient solution but for now, just stick with the legacy version and you'll be fine. And one last reminder, you may and/or probably will need to reinstall command line tools, but that's a mere "xcode-select --install" away (entered at the command line of course).

See, I told you it would be the shortest post ever.