Skip to content
Cameron Smith edited this page Feb 2, 2015 · 10 revisions

Building NetCDF static libraries with XL compilers on AMOS (RPI BGQ)

The MPAS branch requires NetCDF. Here we go....

zlib

module load xl
cd /gpfs/u/home/CCNI/CCNIsmth/barn/zlib-1.2.8
./configure --prefix=/gpfs/u/software/bgq/zlib/xl/1.2.8 --static
make install -j8

hdf5

module load xl
cd /gpfs/u/home/CCNI/CCNIsmth/barn/hdf5/hdf5-1.8.13
./configure FC=/opt/ibmcmp/xlf/bg/14.1/bin/bgxlf90 --prefix=/gpfs/u/software/bgq/hdf5/xl/1.8.13 --with-zlib=/gpfs/u/software/bgq/zlib/xl/1.2.8/include/,/gpfs/u/software/bgq/zlib/xl/1.2.8/lib --disable-shared
make install -j8

netcdf

module load xl cmake
cd /gpfs/u/home/CCNI/CCNIsmth/barn/netcdf/netcdf-c/build

Apply the following patch to liblib/CMakeLists.txt

diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index 6603bd0..9dc66d6 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -57,7 +57,7 @@ IF(USE_HDF5 OR USE_NETCDF4)
     IF(HDF5_hdf5_hl_LIBRARY AND NOT HDF5_HL_LIBRARY)
       SET(HDF5_HL_LIBRARY ${HDF5_hdf5_hl_LIBRARY})
     ENDIF()
-    SET(TLL_LIBS ${HDF5_C_LIBRARY} ${HDF5_HL_LIBRARY} ${TLL_LIBS} ${SZIP_LIBRARY})
+    SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY})
   ELSE() # Windows CMake defines HDF5_LIBRARIES.
     SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY})
   ENDIF()

then configure and build.

export CMAKE_PREFIX_PATH=/gpfs/u/software/bgq/hdf5/xl/1.8.13:/gpfs/u/software/bgq/zlib/xl/1.2.8/:$CMAKE_PREFIX_PATH
cmake -DCMAKE_C_COMPILER=/opt/ibmcmp/vacpp/bg/12.1/bin/bgxlc -DCMAKE_C_FLAGS="-DWORDS_BIGENDIAN=1 " -DCMAKE_INSTALL_PREFIX=/gpfs/u/software/bgq/netcdf/xl/4.3.2 -DENABLE_DAP=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_EXAMPLES=OFF -DENABLE_TESTS=OFF -DCMAKE_SKIP_INSTALL_RPATH=ON ../
make install -j8

netcdf-cxx4

module load xl
cd /gpfs/u/home/CCNI/CCNIsmth/barn/netcdf/netcdf-cxx4/build
export PKG_CONFIG_PATH=/gpfs/u/software/bgq/netcdf/4.3.2/lib64/pkgconfig/:/gpfs/u/software/bgq/zlib/1.2.8/lib/pkgconfig/:$PKG_CONFIG_PATH
../configure CC=/opt/ibmcmp/vacpp/bg/12.1/bin/bgxlc CXX=/opt/ibmcmp/vacpp/bg/12.1/bin/bgxlC --prefix=/gpfs/u/software/bgq/netcdf/4.3.2 CPPFLAGS="`pkg-config netcdf --cflags`" CXXFLAGS="`pkg-config netcdf --cflags`" CFLAGS="`pkg-config netcdf --cflags`" LDFLAGS="-L/gpfs/u/software/bgq/hdf5/1.8.13/lib/ `pkg-config zlib netcdf --libs-only-L`" LIBS="`pkg-config zlib netcdf --libs-only-l`" --disable-shared
make install

Configure the SCOREC stack for netcdf on AMOS

Modules for netcdf and friends are coming soon. For now use the following:

module load xl cmake parmetis/xl/4.0.2 zoltan/xl/3.7 netcdf
cmake .. \
 -DCMAKE_C_COMPILER=mpicc \
 -DCMAKE_CXX_COMPILER=mpicxx \
 -DCMAKE_C_FLAGS="$CFLAGS" \
 -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
 -DENABLE_THREADS=ON \
 -DENABLE_ZOLTAN=ON \
 -DENABLE_MPAS=ON

Writing the MPAS partition

Run mpas_write on the pumi partition to produce a series of files containing the MPAS primal element assignments data. These files can be combined with 'cat' as follows:

 cat graph.* >>  graph