Installation note for NCAR Graphics (NCL):
This installation note is for NCAR Graphics (NCL) 6.0.0, which has been installed on a Red Hat Enterprise Linux 4 server (with ZLIB, JPEG, cairo, szip, HDF4 and NETCDF installed). I upgrade my NCAR Graphic just because some libraries of the older one were not correctly compiled. For availability, I have also installed other optional software like HDF5, HDF-EOS, udunits...et cetera.
The NCL official site suggested that you should use a precompiled binary package rather than building from source code. I think it will be much easier to install the binary package, but I chose the latter way. Here 步驟如下:
UDUNITS-2
- Download UDUNITS-2 and untar it, this OPTIONAL package is for the conversion functions ut_calendar and ut_inv_calendar,you won't need this if you are only a NCAR Graphics user.
- Configure:
[root@HPC ~] export PERL=""
[root@HPC ~] ./configure --prefix=/opt/app/udunits2 |
According to the NCL installation documentation, export PERL="" is to avoid building the perl interface that is not needed for NCL.
- Compile and install: make all; make check; make install
Reference:
How to build NCL and NCAR Graphics from source code - UDUNITS2
GRIB 2
- Download GRIB2 and untar it. It's an OPTIONAL package too.
- Modify the Makefile, make sure that the JASPER library path is correct, and then compile it with "make all".
- Copy the generated grib2.h to /usr/include,
libgrib2c.a to /usr/lib/
Reference:
How to build NCL and NCAR Graphics from source code - GRIB2
HDF 5
- Download HDF5 and untar it. It's an OPTIONAL package if you don't need HDF-EOS format support.
- Configure:
[root@HPC ~] CFLAGS=-m64 ./configure --prefix=/opt/app/hdf5 --enable-fortran --enable-cxx \
--with-szlib=/opt/app/szip --with-zlib=/usr/include,/usr/lib64 --disable-shared |
The "m64" herein enables its support for 64-bit binaries.
The flag "--enable-fortran" and "--enable-cxx" will build the interface to HDF libraries for Fortran and C++ respectively.
Specify the path for szip, zlib here, and use "--disable-shared" to build static libraries.
- Install:
[root@HPC ~] make >& make.output-HDF5187
[root@HPC ~] make check >& make.check-HDF5187
[root@HPC ~] make install
[root@HPC ~] make check-install |
- Please add these variables in your environment setting. (e.g. in ~/.bashrc or /etc/profile)
export HDF5ROOT=/opt/app/hdf5
export HDF5DIR=$HDF5ROOT
export HDF5INC=$HDF5ROOT/include
export HDF5LIB=$HDF5ROOT/lib |
Reference: HDF "Instructions for the Installation of HDF5 Software"
HDF-EOS2 v2.15
- Download the OPTIONAL package HDF EOS2 and its Test Driver (as long as you want to run "make check").
- Configure:
[root@HPC ~] CC='/opt/app/hdf4/bin/h4cc -Df2cFortran' ./configure --prefix=/opt/app/hdfeos2 \
--with-szlib=/opt/app/szip |
HDF-EOS2 depends on HDF4, thus the C compiler used here was set to h4cc, which belongs to HDF4. The "-Df2cFortran" flag is for Fortran support.
- Install: make; make check; make install
- Copy all the .h header file from the "include" directory here to the one under the installation path ( /opt/app/hdfeos2/include, in this case, create one if you need to.)
- Add "export LD_LIBRARY_PATH=/opt/app/hdfeos2/lib:$LD_LIBRARY_PATH" into your environment settings, or copy the "libhdfeos.a" file to /usr/lib.
Reference: How to build HDF-EOS -HDF-EOS2
How to build NCL and NCAR Graphics from source code - HDFEOS2
HDF-EOS5
- Download HDF-EOS5 and it TestDriver, this OPTIONAL package depends on HDF5.
- Configure:
[root@HPC ~] ./configure --prefix=/opt/app/hdfeos5 --with-szlib=/opt/app/szip \
CC='/opt/app/hdf5/bin/h5cc -Df2cFortran' CFLAGS=-DH5_USE_16_API |
If the HDF5 version you use is newer than 1.8, please use
"CFLAGS=-DH5_USE_16_API" to avoid compatibility problems (for more information, please refer to the official documents).
Other settings herein are similar to those for HDFEOS2.
- Install: make; make check; make install
- Copy "HE5_GctpFunc.h" and "HE5_HdfEosDef.h" to the "include" directory under the installation path.
- Add "export LD_LIBRARY_PATH=/opt/app/hdfeos5/lib:$LD_LIBRARY_PATH" into your environment settings.
Reference: How to build HDF-EOS - HDF-EOS5
How to build NCL and NCAR Graphics from source code - HDFEOS5
Triangle
- Download Triangle, this package is OPTIONAL unless you want to use triangle meshes.
- Just copy the "triangle.c" and "triangle.h" to "ni/src/lib/hlu" of the NCL package.
Reference: How to build NCL and NCAR Graphics from source code - Triangle
NCAR NCL 6.0.0
- Download NCL 6.0.0 and untar it.
- It's relatively easy to install NCL/NCARG, just run "./Configure -v", then you will be asked what to install.
- Install: run "make Info" for a final check. Run "make Everything >& make.output-NCL600" subsequently if everything is correct.
if it comes up with this error message during the installation process: "Can't find include file hdf/hdf.h", the very first thing is to check whether the HDF4 has been installed properly. If true, please enter the include path for HDF4 while being asked to specify: "local search include directory" during running Configure (the list should be space-separated for multiple paths).
Or you add those paths into the template file in "config/" (run "grep SYSTEM_INCLUDE Makefile" after the configuration to identify which template has been used.)
If you have encountered "Can't find include file HdfEosDef.h" (or HE5_HdfEosDef.h), please make sure you have copied those files into the corresponding "include" directory.
Done!
Reference: How to build NCL and NCAR Graphics from source code
<-Memo