Building CVS Baselibs: Difference between revisions

mNo edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page will detail the process of building Baselibs. For the purposes of this page, GMAO-Baselibs-4_0_1 as an example tag, but this process should work with any "recent" tag (say, GMAO-Baselibs-3_3_0 or higher).
This page will detail the process of building Baselibs. For the purposes of this page, <tt>GMAO-Baselibs-4_0_7</tt> as an example tag, but this process should work with any tag after <tt>GMAO-Baselibs-3_3_0</tt>.


==Check out Baselibs==
NOTE: This is now outdated as Baselibs has moved to GitHub.


The first step is to check out the tag you want.
== Obtaining Baselibs ==


=== Set up the 'bcvs' alias ===
=== Check out Baselibs ===
 
The first step is to check out the tag you want. Tags on CVS are versions of Baselibs 2.x.y, 3.x.y, and 4.x.y. For version 5.x.y, the recommended Baselibs is now hosted on NASA Internal Github and build instructions can be found on [[Building_Git_Baselibs|the Building Git Baselibs page]].
 
==== Set up the 'bcvs' alias ====


Something useful to set up first is an alias that you can use to refer to the CVS repo for Baselibs. This is because the Baselibs are hosted on progress while the GEOS-5 model and most other tools are on the CVSACL repo. So, I recommend setting a 'bcvs' alias:
Something useful to set up first is an alias that you can use to refer to the CVS repo for Baselibs. This is because the Baselibs are hosted on progress while the GEOS-5 model and most other tools are on the CVSACL repo. So, I recommend setting a 'bcvs' alias:
Line 13: Line 17:
where <tt>USERNAME</tt> is your username ''at progress''. Note that this works on discover and pleiades, but elsewhere you'll need to set up a tunnel to progress and alter the CVSROOT appropriately.
where <tt>USERNAME</tt> is your username ''at progress''. Note that this works on discover and pleiades, but elsewhere you'll need to set up a tunnel to progress and alter the CVSROOT appropriately.


=== Checking out the tag ===
==== Checking out the tag ====


Next, checkout the tag:
Next, checkout the tag:


  $ bcvs co -r GMAO-Baselibs-4_0_1 -d GMAO-Baselibs-4_0_1 Baselibs
  $ bcvs co -r GMAO-Baselibs-4_0_7 -d GMAO-Baselibs-4_0_7 Baselibs


This will create a <tt>GMAO-Baselibs-4_0_1</tt> inside which is a <tt>src</tt> directory.
This will create a <tt>GMAO-Baselibs-4_0_7</tt> inside which is a <tt>src</tt> directory.


== Build Baselibs ==
== Build Baselibs ==


The next task is to build Baselibs. In order to correctly build it, two arguments are needed: <tt>ESMF_COMM</tt> and <tt>CONFIG_SETUP</tt>. <tt>ESMF_COMM</tt> is the MPI stack used by ESMF (usually, <tt>mvapich2</tt>, <tt>mpi</tt>, <tt>openmpi</tt>, or <tt>intelmpi</tt>). <tt>CONFIG_SETUP</tt> is actually an "identifier" that will allow you to build multiple versions of Baselibs for multiple compiler/MPI combination. The style recommended is for, say, Intel 13.0.1.117 and MVAPICH2 1.9a2 is: <tt>CONFIG_SETUP=ifort_13.0.1.117-mvapich2_1.9a2</tt> where you identify the compiler (by its name on the command line), its version, the MPI stack, and its version.
The next task is to build Baselibs. In order to correctly build it, two arguments are needed: <tt>ESMF_COMM</tt> and <tt>CONFIG_SETUP</tt>. <tt>ESMF_COMM</tt> is the MPI stack used by ESMF (usually <tt>mvapich2</tt>, <tt>mpi</tt> (for SGI MPT or other vendor MPI), <tt>openmpi</tt>, or <tt>intelmpi</tt>). <tt>CONFIG_SETUP</tt> is actually an "identifier" that will allow you to build multiple versions of Baselibs for multiple compiler/MPI combination in the same checkout. The style recommended is for, say, Intel 15.0.2.164 and Intel MPI 5.0.3.048 is: <tt>CONFIG_SETUP=ifort_15.0.2.164-intelmpi_5.0.3.048</tt> where you identify the compiler (by its name on the command line), its version, the MPI stack, and its version.  
 
Note that if you do not add a <tt>CONFIG_SETUP</tt>, it will instead build into a directory named after <tt>$(FC)</tt>, so <tt>ifort</tt> or <tt>gfortran</tt>. This is fine as long as you only build for that compiler once. Build again (say for a different MPI stack) and you will overwrite that first build!


=== Load modules ===
=== Load modules ===
Line 29: Line 35:
For our example we want to load these modules:
For our example we want to load these modules:


1) comp/intel-13.0.1.117
  1) comp/intel-15.0.2.164
2) other/mpi/mvapich2-1.9a2/intel-13.0.1.117
  2) mpi/impi-5.0.3.048
3) other/comp/gcc-4.6.3-sp1
  3) lib/mkl-15.0.2.164
4) other/SIVO-PyD/spd_1.6.0_gcc-4.6.3-sp1
  4) other/comp/gcc-4.6.3-sp1
  5) other/SIVO-PyD/spd_1.20.0_gcc-4.6.3-sp1_mkl-15.0.0.090


For other modules see the table at the end.
For other modules see the table at the end.
Line 40: Line 47:
=== Undo any CPP Environment Variable ===
=== Undo any CPP Environment Variable ===


Before doing any make, you should issue:
Before doing any make (especially with PGI), you should issue:


  $ unsetenv CPP DEFAULT_CPP
  $ unsetenv CPP DEFAULT_CPP


Some modules set these and most of the Baselibs assume the C-preprocessor will be gcc, not, say, pgcpp.
Some modules set these and most of the Baselibs assume the C-preprocessor will be gcc, not, say, pgcpp (which is '''not''' a C++ compiler!).


=== Set MPICC_CC and MPICXX_CXX variables if using MPT ===
=== (OPTIONAL) Set MPICC_CC and MPICXX_CXX variables if using MPT ===


If you are using MPT at Pleiades, you must set the MPICC_CC and MPICXX_CXX variables to be the "correct" compilers. This can be done either in the environment full (beware!) or during the install by adding at the end:
If you are using SGI MPT, and you wish to use, say, the PGI C and C++ compilers instead of GNU, you must set the MPICC_CC and MPICXX_CXX variables to be the "correct" compilers. This can be done either in the environment full (beware!) or during the install by adding at the end:


MPICC_CC=icc  MPICXX_CXX=icpc
  MPICC_CC=pgcc MPICXX_CXX=pgc++
  MPICC_CC=pgcc MPICXX_CXX=pgCC


=== Build and install ===
=== Build and install ===
Line 57: Line 63:
So for the above example you'd issue:
So for the above example you'd issue:


  $ make install ESMF_COMM=mvapich2 CONFIG_SETUP=ifort_13.0.1.117-mvapich2_1.9a2 |& tee makeinstall.ifort_13.0.1.117-mvapich2_1.9a2.log
  $ make install ESMF_COMM=intelmpi CONFIG_SETUP=ifort_15.0.2.164-intelmpi_5.0.3.048 |& tee makeinstall.ifort_15.0.2.164-intelmpi_5.0.3.048.log


and it would build all the libraries. The <tt>tee</tt> is so that you can capture the install log, and also see it real-time.
and it would build all the libraries. The <tt>tee</tt> is so that you can capture the install log, and also see it real-time.


Once built, check for "Error" in your log file:
Once built, check for "Error" in your log file, and if you don't see any "<tt>Error 2</tt>" messages, you are probably safe.
 
==== make verify ====


<nowiki>$ grep Error makeinstall.ifort_13.0.1.117-mvapich2_1.9a2.log
You can also use <tt>make verify</tt> which will check the status of the build (by looking for xxx.config and xxx.install files) and print a table like:
    (test $HDF5_Make_Ignore && echo "*** Error ignored") ||          \
    (test $HDF5_Make_Ignore && echo "*** Error ignored") ||          \
      H5Eset_auto2(H5E_DEFAULT, PrintErrorStackFunc, PrintErrorStackData);
make[6]: [install-exec-hook] Error 1 (ignored)
make[6]: [install-data-hook] Error 1 (ignored)
      Whimper ( "Error creating scratch file" ) ;
/usr/local/other/SLES11.1/mvapich2/1.9a2/intel-13.0.1.117/bin/mpicc  -c -O2 -DH5_USE_16_API -DLINUX64 -Df2cFortran -DHDF4_NETCDF_HAVE_SD -DLINUX64 -DPGS_MET_COMPILE  -I/discover/swdev/mathomp4/Baselibs/GMAO-Baselibs-4_0_1/src/SDPToolkit/include -I/discover/swdev/mathomp4/Baselibs/GMAO-Baselibs-4_0_1/src/SDPToolkit/include/CUC -I/discover/swdev/mathomp4/Baselibs/GMAO-Baselibs-4_0_1/x86_64-unknown-linux-gnu/ifort_13.0.1.117-mvapich2_1.9a2/Linux/include/hdf -I/discover/swdev/mathomp4/Baselibs/GMAO-Baselibs-4_0_1/x86_64-unknown-linux-gnu/ifort_13.0.1.117-mvapich2_1.9a2/Linux/include/hdf5 PGS_MET_ErrorMsg.c -o /discover/swdev/mathomp4/Baselibs/GMAO-Baselibs-4_0_1/src/SDPToolkit/obj/linux64/MET/PGS_MET_ErrorMsg.o
cp PGS_MET_ErrorMsg.o tmp/METErrorMsg.o</nowiki>


If you don't see any "<tt>Error 2</tt>" messages, you are probably safe.
-------+---------+---------+--------------
Config | Install |  Check  |  Package
-------+---------+---------+--------------
  ok  |  ok    |  --    | jpeg
  ok  |  ok    |  --    | zlib
  ok  |  ok    |  --    | szlib
  ok  |  ok    |  --    | curl
  ok  |  ok    |  --    | hdf4
  ok  |  ok    |  --    | hdf5
  ok  |  ok    |  --    | h5edit
  ok  |  ok    |  --    | netcdf
  ok  |  ok    |  --    | netcdf-fortran
  ok  |  ok    |  --    | udunits2
  ok  |  ok    |  --    | nco
  ok  |  ok    |  --    | cdo
  ok  |  ok    |  --    | esmf
  ok  |  ok    |  --    | hdfeos
  ok  |  ok    |  --    | uuid
  ok  |  ok    |  --    | cmor
  ok  |  ok    |  --    | hdfeos5
  ok  |  ok    |  --    | SDPToolkit
-------+---------+---------+--------------
 
Note that this is not as comprehensive as looking at the log file as it is possible that some submakes will fail but not communicate that well enough to the main make process. Test


== Checking Baselibs ==
== Checking Baselibs ==
Line 79: Line 102:
This is optional, but recommended. Many of the Baselibs have the ability to do a check. You should do this only in an environment where you can run MPI (like compute nodes at NCCS or NAS). This is because parallel NetCDF and ESMF tests are run:
This is optional, but recommended. Many of the Baselibs have the ability to do a check. You should do this only in an environment where you can run MPI (like compute nodes at NCCS or NAS). This is because parallel NetCDF and ESMF tests are run:


  $ make check ESMF_COMM=mvapich2 CONFIG_SETUP=ifort_13.0.1.117-mvapich2_1.9a2 |& tee makecheck.ifort_13.0.1.117-mvapich2_1.9a2.log
  $ make check ESMF_COMM=intelmpi CONFIG_SETUP=ifort_15.0.2.164-intelmpi_5.0.3.048 |& tee makecheck.ifort_15.0.2.164-intelmpi_5.0.3.048.log
 
Note that at the moment, many will exit with errors. For example, NetCDF has tests that require internet access.
 
=== Checking with Intel MPI ===
 
Note that if you use Intel MPI as the MPI stack, when you run the check (on discover) you have to manually run <tt>mpdboot</tt> to start a mpd ring:
 
$ mpdboot -n 8 -r ssh -f $PBS_NODEFILE
 
This example is for 8 nodes.
 
== Table of Modules ==


{| class="wikitable" width="95%"
Note that at the moment, many will exit with errors. For example, NetCDF has tests that require internet access and if a check is done on a compute node with no external access, it will fail.  
!colspan="3"| Discover
|-
! Compiler || MPI Stack || Other Libraries
|- style="font-family: monospace"
| comp/intel-11.0.083 || mpi/impi-3.2.2.006 || lib/mkl-10.0.3.020 other/SIVO-PyD/spd_1.6.0_gcc-4.3.4-sp1
|- style="font-family: monospace"
|rowspan="3"| comp/intel-13.0.1.117 || other/mpi/mvapich2-1.9a2/intel-13.0.1.117 || rowspan="5"|other/comp/gcc-4.6.3-sp1 other/SIVO-PyD/spd_1.6.0_gcc-4.6.3-sp1
|- style="font-family: monospace"
| mpi/impi-4.0.3.008
|- style="font-family: monospace"
| mpi/impi-4.0.1.007-beta
|- style="font-family: monospace"
| rowspan="2"|comp/pgi-12.8.0 || other/mpi/openmpi/1.6.0-pgi-12.8.0
|- style="font-family: monospace"
| other/mpi/mvapich2-1.8/pgi-12.8.0
|-
!colspan="3"| Pleiades
|-
! Compiler || MPI Stack || Other Libraries
|- style="font-family: monospace"
| rowspan="2"|comp/intel/11.0.083_64 || mpi-intel/3.2.011 || rowspan="2"|math/intel_mkl_64_10.0.011 python/2.6.1
|- style="font-family: monospace"
| mpi-sgi/mpt.2.06a67
|- style="font-family: monospace"
| comp-intel/2012.0.032 || mpi-sgi/mpt.2.06a67 || rowspan="3"|python/2.6.1
|- style="font-family: monospace"
| rowspan="2"|pgi_12.8 || mvapich2_1.8.1_pgi_12.8
|- style="font-family: monospace"
| mpi-sgi/mpt.2.06a67
|}


[[Category:Baselibs]]
[[Category:Baselibs]]
[[Category:SI Team]]
[[Category:SI Team]]