Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, June 4, 2020

Installing ParFlow on Ubuntu LTS

Since we have been working with ParFlow on Ubuntu, we thought that it might be helpful to provide a guide for others to install ParFlow on Ubuntu systems. The following directions are to install the current version of ParFlow on the two most recent Ubuntu LTS releases, 18.04 and 20.04.

1) Setup development packages on Linux

First, you need to download the new package information and install some new packages. Copy and paste the following in your command line:
   sudo apt-get update 
   sudo apt-get install \ 
     build-essential \ 
     curl \ 
     git \ 
     gfortran \ 
     libopenblas-dev \ 
     liblapack-dev \ 
     openssh-client \ 
     openssh-server \ 
     openmpi-bin \ 
     libopenmpi-dev \ 
     tcl-dev \ 
     tk-dev 

This may take a little while. Note: you may not need the sudo command if you are running with root privileges.


2) Create the ParFlow directory and its components

Next, you need to create a directory for ParFlow with a few subfolders. This example installs ParFlow and all its dependencies in the home (~) folder, although you can change this to whatever you’d like.

   mkdir -p ~/parflow/build \
     ~/parflow/dependencies/cmake \
     ~/parflow/dependencies/hypre-src 

3) Fetch the dependencies (cmake and hypre)

Let’s start with downloading cmake (3.17.3 being the current version):

   cd ~/parflow/dependencies/cmake 
   curl -L https://cmake.org/files/v3.17/cmake-3.17.3-Linux-x86_64.tar.gz \
     | tar --strip-components=1 -xzv 

Once that is completed, you can install hypre (2.19.0 being the current version):

   cd ~/parflow/dependencies/hypre-src 
   curl -L https://github.com/hypre-space/hypre/archive/v2.19.0.tar.gz \
     | tar --strip-components=1 -xzv 
   cd src 
   ./configure --prefix=~/parflow/dependencies/hypre \
     --with-MPI 
   make install 

4) Download and build ParFlow

You can then download ParFlow from GitHub using the commands below. The current release as of this post is v3.6.0. Note: Ubuntu 20.04 has a newer version of tcl that is not compatible with the current release. If you are installing ParFlow on Ubuntu 20.04, replace the “v3.6.0” with “master” to clone the master branch instead. The current master branch of ParFlow is compatible with the newer version of tcl on Ubuntu 20.04.

   git clone --single-branch --branch v3.6.0 \
     --recursive https://github.com/parflow/parflow.git \
     ~/parflow/src 

Enter the following in your command line to build ParFlow.

   ~/parflow/dependencies/cmake/bin/cmake \
-S ~/parflow/src \
-B ~/parflow/build \
-D PARFLOW_AMPS_LAYER=mpi1 \
-D PARFLOW_AMPS_SEQUENTIAL_IO=TRUE \
-D HYPRE_ROOT=
~/parflow/dependencies/hypre \
-D PARFLOW_ENABLE_TIMING=TRUE \
-D PARFLOW_HAVE_CLM=TRUE

~/parflow/dependencies/cmake/bin/cmake --build \
~/parflow/build

~/parflow/dependencies/cmake/bin/cmake --install \
~/parflow/build --prefix ~/parflow/install

5) Create an environment file

Here, you will create an environment file “env.sh” to store the ParFlow directory, making it easier to reference ParFlow when you want to run it later. Type the following:

   echo export PARFLOW_DIR=~/parflow/install \
     >> ~/parflow/env.sh 

With that environment file, you can use ParFlow from anywhere by sourcing it, as shown:

   source ~/parflow/env.sh 

6) Test ParFlow

Here, you will create an environment file “env.sh” which points to the necessary directories for keeping the components necessary for running ParFlow. Enter the following:

Hopefully you haven’t gotten any errors at this point and you have installed ParFlow successfully. To test ParFlow, source the environment file above and then type:
   cd ~/parflow/build/ 
   ~/parflow/dependencies/cmake/bin/ctest -VV 
This will run the series of tests to make sure your install of ParFlow is working correctly. As of this writing, nine tests fail that are attempting to reference .silo files (note that this installation guide does not install Silo). We are currently addressing this issue. The tests that will fail due to the bug are: water_balance_x.hardflow.nojac.tcl (all topologies), water_balance_x.hardflow.jac.tcl (all topologies), and impes.plinear.tcl.

Conclusion

Congratulations, you now have ParFlow on your system! The ParFlow executable is located in ~/parflow/src/pfsimulator/, and the pftools are located in ~/parflow/src/pftools/. Before running a ParFlow script, you may have to re-source your environment file by typing in “source ~/parflow/env.sh” as shown above.

These install instructions are combined into shell scripts within the scripts folder on this GitHub repo. The install directions above are divided into two scripts: “01_packages.sh” executes step 1, and “02_parflow.sh” executes steps 2 through 5. You will have to execute the testing on your own. The Readme file provides directions for how to use these scripts, as well as instructions and files for building ParFlow within an Ubuntu Docker image.

For more information, please refer to the ParFlow manual PDF located in ~/parflow/src/ and ParFlow’s GitHub page (https://github.com/parflow/parflow). Happy modeling!


Wednesday, March 31, 2010

Running ParFlow on Windows using VirtualBox (also updated instructions for installing ParFlow in Ubuntu)


-->
The title of this post may be a little misleading. This is not actually an instruction to run ParFlow on Windows, but a quick and easy way for Windows users to have access to ParFlow on Ubuntu Linux using virtualization. Sun Microsystems’ VirtualBox is a free and open source virtualization package that allows additional operating systems to run inside another operating system as an application.
This post is divided into three parts. The first section will detail the steps for setting up VirtualBox in Windows. The second part provides instructions for installing and configuring Ubuntu Linux on the virtual machine. The third section is an updated set of instructions for building ParFlow on an Ubuntu system, applicable to both native and virtual Ubuntu installations.
I completed this installation using Microsoft Windows XP SP3 (32-bit), VirtualBox 3.1.4, and Ubuntu 9.10 (32-bit). If you are running a 64-bit version of Windows, you can run a 32-bit or 64-bit version of Ubuntu in your VirtualBox. 64-bit Ubuntu will not work unless you are running a 64-bit version of Windows. When in doubt, install the 32-bit version. These instructions detail the 32-bit installation, but I will make note where differences appear for 64-bit. Excluding download time, setting up a virtual Ubuntu machine takes a little more than an hour.

Installing VirtualBox and setting up your virtual machine
  1. Download the following:
    • Sun VirtualBox – select the version for Windows hosts
    • Ubuntu – for a 64-bit version, Click “Alternative download options” and select “64-bit version” before starting your download. The file is around 700 MB.
  1. Install VirtualBox. This is a standard Windows installation wizard. On Windows XP, you may see several “Logo Testing” failures, which you may ignore.
  1. Start VirtualBox. You will be required to register the software. I did this three weeks ago, and they haven’t sent me any emails to date.
  1. Click “New” in the upper left corner to start the wizard. You may name it anything you like. Select “Linux” in the Operating System dropdown, and select “Ubuntu” in the Version dropdown (or select Ubuntu (64-bit) for a 64-bit install)
  1. Choose how much memory to allocate to Ubuntu. You may choose up to half of the total memory of your computer. 512 MB is the minimum recommended. I went with 1200 MB
  1. Create a Virtual Hard Disk when prompted by the wizard, and check “Boot Hard Disk.”
    • You will be given the choice between dynamically expanding storage or fixed-size storage. The wizard provides a good explanation of each. I picked dynamically expanding.
    • Next, set the size (or maximum size for dynamically expanding) of your virtual hard disk. 10.00 GB will cover you for the operating system, ParFlow and support software, and it will leave room for a small amount of data. I went with 20.00 GB to make sure I have plenty of space for small runs. I would not recommend going under 10.00 GB.
  1. After you finish the wizard, create a shared folder. This will allow you to transfer files between your Ubuntu virtual machine and your Windows machine.
    • In Windows Explorer, create a folder that you want to use as your shared folder.
    • In the VirtualBox window, select the virtual machine you just created, click Settings, then click Shared Folders
    • Click the icon to add a folder (looks like a folder with a green ‘plus’ sign), and enter the path (or click other and navigate) to the folder you just created. “Folder name” is not the name you gave it in Windows. It is the name that will identify it in Ubuntu later. I called it “shared_folder.” Don’t make it read only: that would make it pretty useless.
    • Click OK, click OK.
  1. You’re almost ready to start installing Ubuntu. If you have ever installed Windows, this is painless in comparison. First, we must mount the Ubuntu iso file. The virtual machine will recognize this as a CD.
    • In the VirtualBox window, click File>Virtual Media Manager.
    • Click the CD/DVD Images tab, then click Add.
    • Find and select the Ubuntu image file you downloaded from ubuntu.com, and click OK.
    • Select your virtual machine again and click settings, then click Storage. Under Storage Tree, click the icon that looks a bit like a CD.
    • Under Attributes, select the Ubuntu image file from the CD/DVD Device dropdown list.
    • While you’re dealing with settings, click Display and check the box to “Enable 3D Acceleration.” This will eventually allow you to work in full screen.
Now you’re ready to configure and install Ubuntu on your virtual machine.

Installing and configuring Ubuntu on a Virtual Machine
  1. In the VirtualBox window, select your virtual machine and click Start. This should start installing Ubuntu. Simply follow the on-screen prompts. When you get the part about partitioning, make sure the virtual hard disk you created earlier is selected. If you know what you’re doing, you can set up your partitions manually. If not, select “Erase and use entire disk.” Don’t worry; this won’t touch anything but the virtual hard disk you created earlier, which exists only as a single file on your Windows machine.
  1. Installation may take 45 minutes to an hour, depending on how fast your computer is. When it’s done, you will be prompted to restart. Go ahead and restart. When it tells you to remove the CD from the drive, close the window.
  1. Back in the VirtualBox window, select your virtual machine, click Settings, click storage. Select the CD icon under Storage Tree, then select “Empty” from the CD/DVD Device dropdown list under Attributes. Click OK.
  1. Start the virtual machine again. When it has finished booting into Ubuntu, start setting up Ubuntu to access the shared folder you created in Windows.
    • Go to Devices>Install Guest Additions. Cancel the dialog box that appears (don’t worry if it doesn’t appear).
    • Open a terminal window (Applications>Accessories>Terminal) and enter the following commands:
sudo apt-get install dkms [you will be prompted for your password]
cd /media/cdrom
sudo ./VBoxLinuxAdditions-x86.run
(for a 64-bit installation, enter “sudo ./VBoxLinuxAdditions-amd64.run” instead)
sudo reboot
*If you can't get this to work correctly, try restarting the virtual machine, then try again. If it still won't work, see the comment at the bottom of this post.
  • When Ubuntu finishes rebooting, open a terminal window again and create a directory for your Windows/Ubuntu shared folder. I created mine in the home directory and called it “send_to_XP.”
mkdir send_to_XP
  • In step 7 of installing VirtualBox above, you named a folder for use in Ubuntu. I called mine “shared_folder.” Let’s see if it works. It should. When you input your directory in Ubuntu in the following command, it is best to use the full absolute path, to avoid putting it in the wrong place or overwriting something important (I tell you this because it happened to me).
sudo mount –t vboxsf shared_folder /home/john/send_to_XP
  • If that worked, you now have access to a folder shared between Ubuntu and Windows. Try it out. Stick a file in the folder in Windows. Then open the directory in Ubuntu (Places>Home Folder) and see if the file is in the “send_to_XP” folder (or whatever you decided to call it).
  1. You will have to run the above command every time you start Ubuntu in order to use your shared folder. Here’s a way to mount it automatically so you don’t have to run that command every time:
    • Open the “fstab” file in a text editor (vi and gedit are installed by default).
sudo gedit /etc/fstab
    • Copy the following line to end of the “fstab” file, changing the directory names to the ones you used and "john" to your own username .
shared_folder /home/john/send_to_XP vboxsf defaults,uid=john,gid=john,fmask=111,dmask=022 0 0
  1. You can skip this step and come back to it after you’ve installed ParFlow. It involves up to 2 hours of unattended downloading and updating.
By now, “[Update Manager]” should appear at the bottom of the Ubuntu window. Click it. Click “Check.” You’ll be prompted for your password. When the check finishes, click “Install Updates.” When it is finished, you will probably be prompted to restart. Go ahead and restart.

Installing Parflow in Ubuntu
The instructions in this section are applicable to building ParFlow on both native and virtual installations of Ubuntu. These instructions should be much easier and more effective than those in my previous post about installing ParFlow on Ubuntu.
  1. Open a terminal window.
  1. You will first need to download and install C, C++ and Fortran compilers and Tcl/Tk. The download list below also includes optional, but recommended text editors. Ubuntu ships with vim-lite, which sucks. At the very least, install the full version of vim. Downloading and installing these is very easy. All you have to do is enter the following commands:
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install gdc
sudo apt-get install gfortran
sudo apt-get install tcl-dev
sudo apt-get install tk-dev
Optional
sudo apt-get install vim [highly recommended]
sudo apt-get install jedit [my favorite text editor – allows vertical selection]
  1. Now, download software from the internet. OpenMPI is optional if you are using a machine with a single-core processor. Silo is optional if you do not intend to use the VisIt visualization package. VisIt is also optional, but recommended as it is a good visualization package that lends itself well to use with ParFlow.
    • ParFlow
    • Hypre – A powerful solver package that greatly enhances the performance of ParFlow
    • Silo
    • VisIt
Choose a version for Ubuntu 8.04 (which will work for 9.10 also). Be sure to pick the correct 32-bit or 64-bit version.
    • OpenMPI – if you intend to utilize a multi-core processor, you will need this in order to do so.
  1. Build a directory structure for your ParFlow installation. It really helps to keep this organized, I’ve found, and it’s easy to do. Make a directory in your home directory for ParFlow and its supporting software. I called mine “parflow.” Then place the downloads from step 3 into that directory. If you’re not already working in the terminal window, now you must. I’ll use my directory structure as the example here.
    • Move into the new parflow directory and unpack the downloaded *.tar.gz files. If you’re new to linux command line operations, the [tab] button auto-completes your typing on the command line. I’ll use that in the commands below.
cd [takes you to your home directory]
cd parflow
tar –xvf parflow[tab]
tar –xvf hypre[tab]
tar –xvf silo[tab]
tar –xvf visit[tab]
tar –xvf openmpi[tab]
  • Each “tar” command creates a directory with version numbers at the end of the name (except visit). I renamed the parflow, hypre and silo directories to simply “parflow,” “hypre,” and “silo” for simplicity.
  1. Set environmental variables. This makes the installation a breeze, when we get to it. You can do this on the command line, but it is better to set them in the .bash_aliases file. Then you only have to do it once.
Depending on your text editor of choice:
vi ~/.bash_aliases
jedit ~/.bash_aliases or
gedit ~/.bash_aliases
Add the following lines, adjusted for your own directory structure, of course.
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran

export PARFLOW_DIR=/home/john/parflow/parflow

export SILO_DIR=/home/john/parflow/silo
export HYPRE_DIR=/home/john/parflow/hypre
export PATH=$PATH:/home/john/parflow/visit/bin

Now it’s time to start installing. But first, source your bash aliases
source ~/.bash_aliases
  1. Install OpenMPI
cd openmpi[tab]
sudo ./configure
sudo make all
sudo make check
sudo make all install
cd ..
  1. Install Silo
cd silo
./configure --prefix=$SILO_DIR --disable-silex

make all
make check
make all install
cd ..
  1. Install Hypre
cd hypre/src
./configure --prefix=$HYPRE_DIR --with-MPI [if you’re not using MPI, use --without-MPI]
make all
make check
make all install
cd ../..
  1. Install ParFlow and PFTools, run the test cases
cd parflow/pfsimulator
./configure --prefix=$PARFLOW_DIR --enable-timing --with-clm --with-silo=$SILO_DIR --with-hypre=$HYPRE_DIR --with-amps=mpi1 [if you’re not using MPI, leave the last flag off]
make install
cd ../pftools
./configure --prefix=$PARFLOW_DIR --with-silo=$SILO_DIR --with-amps=mpi1 [if you’re not using MPI, leave the last flag off]
make install
cd ../test
sudo ldconfig
make check

Wednesday, June 10, 2009

Installing VisIt on Ubuntu 9.04 Jaunty Jackalope


-->This post represents the next episode in installing ParFlow on the Ubuntu/Debian system. The purpose of adding Silo support when installing ParFlow is to utilize VisIt for visualization with ParFlow. VisIt is a free and powerful visualization tool that works very well with ParFlow outputs. The VisIt website provides precompiled binaries for several platforms, none of which are Ubuntu/Debian. In order to use VisIt on Ubuntu/Debian, we must build from source code.

I have prepared a precompiled binary for 64-bit Ubuntu systems (which may also work on 64-bit Debian systems). It is known to work on one computer other than my own so far. If you would like to try it, let me know by commenting this post. I make no guarantees that it will work.

Like my ParFlow installation, this installation was filled with repetitions, loops and mulligans, which I will not detail. Building VisIt is a complicated and time intensive process. The developers of VisIt have prepared the “build_visit” script, which automates the process of building VisIt, its prerequisites and optional libraries, making it a little easier. After several problems installing optional libraries, I decided to forgo the optional packages, as they are not needed for ParFlow visualization.

Visit requires several prerequisite libraries and programs be installed before VisIt can be built. The build_visit script will download and install most these, but there are a few preparations that must be made before running the script. Here are the steps that I completed before running the script (successfully).

  1. First I added “libxmu-dev” using the Synaptic Package Manager. This can also be completed using apt-get. Note that there is also a “libxmuu-dev” package. Pick the one that has one “u.”
  2. Next I made a “visit” directory in my “parflow” directory (/visit) and downloaded the VisIt source code here: https://wci.llnl.gov/codes/visit/source.html.
  3. I downloaded the build_visit script and placed it in the visit directory with the visit source code tarball. The source code needs to be unpacked in this directory before running the build_visit script.
  4. VisIt needs to be built using the gcc compiler. My .bash_aliases has not changed since installing ParFlow, so I also needed to cancel the CFLAGS associated with the Intel Compiler.
export CC=gcc
export CFLAGS=
  1. Finally, in order to run the build_visit script, it needs to be made executable.
chmod 700 /visit/build_visit

Now we are ready to build VisIt. The build_visit script should download the needed third-party packages for you. If you would prefer to do it yourself, download the following packages from the bottom of the page at https://wci.llnl.gov/codes/visit/source.html and place them in the /visit directory. They do not need to be unpacked as the build_visit script takes care of that.
  • CMake 2.4.5 sources
  • Mesa 5.0 sources
  • Python 2.5 sources
  • Qt X11 3.3.8 sources
  • VTK 5.0.0c sources

To run the build_visit script, cd into the /visit directory and type:
./build_visit

The script will run through a series of input screens. Spacebar marks check boxes, enter/return moves to the next window, and I never figured out how to cancel, but that option appears to exist as well.

In the first window, I selected to install a parallel version of VisIt with Python support. I did not select any of the other options and I did not install any optional libraries. Do not install Java support. VisIt will not compile properly with that option. I tried to install with some optional packages initially and could not successfully complete the installation.

If you opt to install a parallel version of VisIt, you will be asked about directories for MPI. If you installed OpenMPI to the default location before building ParFlow, the given directories should be correct.

After agreeing to the Qt license agreement, the script took over and I had more than an hour free while it worked. If the build gets interrupted or stops due to an error, it will pick up where it left off when restarted.

If the build_visit script fails during the part where it is actually building VisIt, try entering the following environmental variables and running the build_visit script again.
export CFLAGS=-02
export CXXFLAGS=-02

Once installation of VisIt was complete, I added the following line to the .bash_aliases file:
vi ~/.bash_aliases
export PATH=$PATH://visit/visit1.11.2/src/bin

To call VisIt from the command line, simply type visit.

Wednesday, June 3, 2009

Installing ParFlow on Ubuntu 9.04 Jaunty Jackalope

NOTE:  If you're looking for instructions to install ParFlow on Ubuntu systems, the Ubuntu instructions included in the post entitled "Running ParFlow on Windows using VirtualBox (also updated instructions for installing ParFlow in Ubuntu)" provides clearer and better instructions than this post, and those instructions appear to work on most Linux systems.

Before installing ParFlow on the Ubuntu system, I first had to make sure the prerequisite software was included and prepared on my system, including compilers and scripting language. Once that portion was completed, I was able to build ParFlow using various combinations of compilers. The end result is a working full version of ParFlow that passes (almost) all of the test cases. In writing this narrative of the trials and tribulations doing this install, I’m going to assume the reader holds a basic knowledge of file-system navigation by command line on a Linux system, what a compiler is and does, how to operate the vi text editor, and has already installed Ubuntu.

I installed a full version of ParFlow (r375) that includes CLM, supports MPI, supports SILO output and includes Hypre, a high-performance solver pre-conditioner. I also installed VisIt, a visualization platform that uses the SILO output files, but there is a compatibility issue between VisIt and Ubuntu that I have yet to resolve, so I will not detail that installation here.

This is the order of operations for installing ParFlow that I would use if I were to do it again. I shall spare the reader the loops and repetitions from my maiden voyage.
  1. Install GNU Compilers
  2. Download the following:
  1. Install OpenMPI*
  2. Install Intel Compilers
  3. Install Tcl/Tk
  4. Set environmental variables
  5. Build Silo
  6. Build Hypre
  7. Build Parflow
*If you are not using a multi-core processor, multiple processors or a cluster, MPI is probably not needed.
**Intel compilers are available for free download for non-commercial use.

GNU Compilers
There are several GNU compilers that need to be available:
  • gcc
  • g++
  • gdc
  • gfortran
The GNU compiler collection can be installed via “apt-get” or the Synaptic Package Manager included in Ubuntu. I used the Synaptic Package Manager found in the System menu > Administration > Synaptic Package Manager. You will need to have administrative privileges to do this. Use the “Quick Search” to find gcc, gdc, g++ and gfortran, then install them.

MPI
The machine on which I installed ParFlow uses a dual-core processor, so I decided to install MPI to take full advantage of the processor. I downloaded OpenMPI and installed it according to the included instructions to the default directory (/usr/local/mpi) by leaving the “--prefix” flag off the ./configure line. This directory requires administrative privileges and the use of the “sudo” command.

sudo ./configure
sudo make all install

Intel Compilers
I was not able to get ParFlow to build using the GNU compilers alone, so I installed the Intel C and Fortran Compilers. The installers for the compilers make the installation process nearly fool-proof. I installed to the default directory (/opt/intel). During installation of the second compiler, I received a warning message about overwriting a library installed with the first. This is not a problem as the two compilers share the same library.

Tcl/Tk
Tcl/Tk provides the scripting support needed to initiate ParFlow. It is available through the Synaptic Package Manager and “apt-get,” however when installing with the Synaptic Package Manager, I was unable to figure out the correct pieces to get Tcl/Tk configured correctly. By downloading and installing the latest versions of Tcl and Tk from the source code, you get a complete installation. Tcl and Tk must be installed separately. I installed the Unix versions of Tcl and Tk to the default directory (/usr/local/). I used two flags on the configure line to specify a shared library and 64-bit support. If you are not using a 64-bit processor, the “--enable-64bit” flag is unecessary. Again, this installation requires administrative privileges.

sudo ./configure --enable-shared --enable-64bit
sudo make
sudo make install
sudo make test

I used the same procedure to install Tk. In the event that either portion must be reinstalled, it is important to run “sudo make distclean” first to completely remove the previous installation. Not doing this turned out to cause problems in running ParFlow.

The “make test” command runs several thousand tests. One test failed on Tcl. Several tests failed on Tk. ParFlow works in spite of the test failures, so I'm not going to worry about them much.

Setting Environmental Variables
This is the part of the process that allows the programs to find each other, essentially, and is thus important. This is also the part where you assign directories for ParFlow, Silo, Hypre and VisIt. I made a ParFLow directory, ~/parflow, in my home directory. From now on, I will call this directory “~PF.” I unpacked each *.tar.gz file in my ~PF directory, and renamed each simply “ParFlow,” “Silo” and “Hypre.”

Environmental variables can be set from the terminal command line or saved in the .bash_aliases file (so you only have to do it once). The terminal in Ubuntu does not load .bash_aliases by default. In fact, the file does not exist. To enable bash to load the .bash_aliases, I edited the ~/.bashrc file, located in my home directory.

vi ~/.bashrc

I found the following section in the .bashrc file and uncommented the boldface lines (delete “#” signs):

# Alias definitions. # You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

Next I created the .bash_aliases file and added the following entries to it (numbers not included):
vi ~/.bash_aliases
  1. export PARFLOW_DIR=~PF/parflow
  2. export SILO_DIR=~PF/silo
  3. export HYPRE_DIR=~PF/hypre
  4. export PATH=$PATH:/opt/intel/Compiler/11.0/083/bin/intel64*
  5. export LD_LIBRARY_PATH=/opt/intel/Compiler/11.0/083/lib/intel64*
  6. export FC=ifort
  7. export F77=ifort
  8. export F90=ifort
  9. export CC=icc
  10. export CFLAGS='-no-multibyte-characters'
*This path may be different depending on version and installation path.

1-3 set the directories for ParFlow, Silo and Hypre. 4 and 5 configure the Intel compilers to run from the command line. 6-9 make the Intel compilers default. 10 circumvents a compiler error.

This is the setup to build ParFlow. Silo does not compile correctly using the Intel C Compiler, so I reset the C compiler to gcc by entering the following on the command line.

export CC=gcc
export CFLAGS=

This setting is only valid in the current terminal window for the current session. Starting a new session will load the .bash_aliases file and revert to the Intel C Compiler.

Installing Silo
With the C compiler set to gcc, the installation of Silo went according to the instructions contained in the INSTALL file included in the package. I used a “--disable-silex” flag on the ./configure line. This disables a utility that ParFlow does not use that would complicate the installation.

./configure --prefix=$SILO_DIR --disable-silex
make
make check
make install

The “make check” line runs a series of tests. These should all pass. During my installation, I had plenty of problems getting the program to compile, but once it did, the tests passed.

Installing Hypre
I installed Hypre using the same set of compilers as Silo, and it worked. In the interest of leaving well-enough alone, I did not try it with other combinations of compilers. The autoconf package for Hypre is located in the “src” subfolder (~PF/hypre/src). Like Silo, the installation of Hypre went according to the instructions contained in the INSTALL file. I used the “--with-MPI” flag. If MPI is to be enabled in ParFlow, MPI must be enabled in Hypre as well. For ParFlow builds without MPI, a “--without-MPI” flag is necessary. MPI must be capitalized.

./configure --prefix=$HYPRE_DIR --with-MPI (or “--without-MPI”)
make install

That is all.

Installing ParFlow
Now I'm ready to install a full version of ParFlow with Hypre and Silo support and coupled with CLM. This installation is completed in three parts.

Before beginning, ParFlow seems to compile using the Intel compilers, but not the GNU compilers. If your .bash_aliases file has the same 10 lines as mine above, the easiest way to set the correct compilers is to open a new terminal window and work there. Otherwise, entering lines 10 and 11 from the .bash_aliases above on the command line will make the necessary settings.

1. Installing ParFlow: the autoconf package for ParFlow is located in the ~PF/parflow/pfsimulator directory. I used many flags in the ./configure line to enable all of my extensions.

./configure --prefix=$PARFLOW_DIR --with-amps=mpi1 (or --with-amps=seq, if you're not running MPI) --with-clm --with-silo=$SILO_DIR --with-hypre=$HYPRE_DIR --enable-timing

You're only going to want to type that once, so don't close your terminal window until you're done.

make install

2. If that worked, now it's time to install “pftools,” located in ~PF/parflow/pftools. I used the same ./configure line as above by pressing the up arrow. The autoconf for pftools ignores the flags that do not apply.

make install

3. If that worked, the last step is to test ParFlow. Tests are located in ~PF/parflow/test

make check

One test run, the “forsyth2” test did not pass. ParFlow appears to have completed the problem, but the output does not match the correct output. The remaining fourteen tests passed.

That completes installation of ParFlow with CLM, with Silo and Hypre support, and MPI enabled on an Ubuntu 9.04 Jaunty Jackalope system.