2018年8月16日 星期四

WRF Installation  on NTNU-HPCS  (cschang @ Sep. 2017)

1. Installation

1.1 Compiler & MPI:


   In :~/.bash_profile":
  • source /opt/intel/compilers_and_libraries_2017/linux/bin/compilervars.sh intel64
  • export            PATH=/opt/openmpi-1.10.5-intel17/bin:$PATH
  • export LD_LIBRARY_PATH=/opt/openmpi-1.10.5-intel17/lib:$LD_LIBRARY_PATH
  • export     LD_RUN_PATH=/opt/openmpi-1.10.5-intel17/lib:$LD_RUN_PATH
     ($ mpirun -V ) 

1.2 Building hdf-1.10.1 (parallel version; to support netCDF4 & pnetCDF)
     (Note: when use openmpi with ifort, just only has "mpicxx", no "mpiicpc ") 

  • export  CC=mpicc
  • export CXX=mpicxx   
  • export  FC=mpif90
  • export F90=mpif90
     ( echo $CC $CXX $FC $F77 $F90 )  
  • ./configure --prefix=/home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/ --enable-parallel --enable-shared --enable-static --enable-fortran
     (check config.status)
  • make -j 12 install
    # after install, to check:
      $cat /home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/lib/libhdf5.settings
           or
      $ldd /home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5/bin/xxxxxx



1.3 Building parallel-netcdf (pnetcdf)
          (same as $1.2;  echo $CC $CXX $FC $F77 $F90 )


  • export  CC=mpicc
  • export CXX=mpicxx   
  • export  FC=mpif90
  • export F90=mpif90
  • export  OMPI_MPICC=icc 
  • export OMPI_MPICXX=icpc 
  • export  OMPI_MPIFC=ifort 
  • export OMPI_MPIF77=ifort 
  • export OMPI_MPIF90=ifort
     ( echo $OMPI_MPICC $OMPI_MPICXX $OMPI_MPIFC $OMPI_MPIF77 $OMPI_MPIF90 )
  • export     CFLAGS="-g -O2 -fPIC"  
  • export   CXXFLAGS="-g -O2 -fPIC"
  • export     FFLAGS="-g -fPIC"
  • export    FCFLAGS="-g -fPIC"
  • export   FLDFLAGS="-fPIC"
  • export F90LDFLAGS="-fPIC"
  • export    LDFLAGS="-fPIC"
   ("-fPIC" needs by shared library) 
    ( echo $CFLAGS $CXXFLAGS $FFLAGS $FCFLAGS $FLDFLAGS $F90LDFLAGS $LDFLAGS )
  • ./configure --prefix=/home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5/ --enable-fortran --enable-large-file-test
  • make -j 16 install
  • (make check --> check squential programs)
  • (make ptest --> check parallel programs)
      # after install, to check:
     $ldd /home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5/bin/xxxxxx


1.4 Building netcdf-C & netcdf-fortran 
        #netcdf-C:
         
  • export  CC=mpicc
  • export CXX=mpicxx   
  • export  FC=mpif90
  • export F90=mpif90
  • export  OMPI_MPICC=icc 
  • export OMPI_MPICXX=icpc 
  • export  OMPI_MPIFC=ifort 
  • export OMPI_MPIF77=ifort 
  • export OMPI_MPIF90=ifort
(same as $1.2;  $ echo $CC $CXX $FC $F77 $F90 )
  • export HDF5=/home/cschang/software_cschang/hdf5-1.10.1_ifort-17.0.1_openmpi-1.10.5
  • export PNET=/home/cschang/software_cschang/pnetCDF-1.8.1_intel-17.0.1_openmpi-1.10.5
  • export   CFLAGS="-I$HDF5/include -I$PNET/include"
  • export CXXFLAGS="-I$HDF5/include -I$PNET/include"
  • export CPPFLAGS="-I$HDF5/include -I$PNET/include"
  • export   FFLAGS="-I$HDF5/include -I$PNET/include"
  • export  FCFLAGS="-I$HDF5/include -I$PNET/include"
  • export  LDFLAGS="-I$HDF5/include -I$PNET/include -L$HDF5/lib -L$PNET/lib"
     ( echo $CFLAGS $CXXFLAGS $CPPFLAGS $FCFLAGS $FFLAGS $LDFLAGS )
  • ./configure --prefix=/home/cschang/software_cschang/netcdf-4.4.x_intel-17.0.1_openmpi-1.10.5 --enable-fortran --disable-static --enable-shared --with-pic --enable-parallel-tests --enable-pnetcdf --enable-large-file-tests --enable-largefile --disable-dap --enable-netcdf4
  • make
  • make check
  • make install
      (check: ..../lib/libnetcdgf.settings --> PNetCDF Support:        yes)

        #netcdf-fortran:
  • export NCDIR=/home/cschang/software_cschang/netcdf-4.4.x_intel-17.0.1_openmpi-1.10.5
  • export LD_LIBRARY_PATH=${NCDIR}/lib:$LD_LIBRARY_PATH

  • export   CFLAGS="-I$HDF5/include -I$NCDIR/include"
  • export CXXFLAGS="-I$HDF5/include -I$NCDIR/include"
  • export CPPFLAGS="-I$HDF5/include -I$NCDIR/include"
  • export   FFLAGS="-I$HDF5/include -I$NCDIR/include"
  • export  FCFLAGS="-I$HDF5/include -I$NCDIR/include"
  • export  LDFLAGS="-I$HDF5/include -I$NCDIR/include -L$HDF5/lib -L$NCDIR/lib"
     ( echo $CFLAGS $CXXFLAGS $CPPFLAGS $FCFLAGS $FFLAGS $LDFLAGS )
  • ./configure --prefix=$NCDIR --disable-static --enable-shared --with-pic --enable-parallel-tests --enable-large-file-tests --enable-largefile
  • make
  • make install
  • Note: You can use script "nf-config" to find out the relevant compiler options to build your application. Enter
        #set environment variables for pnetcdf & NETCDF:

1.5 Building extra libraries for "grib2" (JasPer + libpng + zlib) 
        #JasPer:
  • ref: "WRF user Guide"

2017年9月29日 星期五

★★★ update Intel Compiler academic license ★★★

Note: don't need to uninstall & install

Step 1.  https://software.intel.com/en-us/qualify-for-free-software/student
             先再申請一組一年免費之學術(學生、教師)授權序號。
              (系統立即產生、且寄送至所填之學校Email)

Step 3.  回到LINUX主機,查詢「Host ID」<-- address="" p="">              (#/sbin/ifconfig )

Step 2.  以申請序號之Email 登入https://registrationcenter.intel.com/en/
           
             點選 「 Activate Serial MNumber」之「+」,
             填入LINUX主機之Host ID (去除冒號),
             執行「Activate Serial Number」,
             即可產生、並下載 「 .lic」檔案,
             上傳該檔案至LINUX 主機之/opt/intel/license。

              Note: 執行 ifort等指令,即會自動辨識到新授權檔存在。
<-- address="" p="">    

Note:  2018,更新MCS、EDDY,直接將license file放到/opt/intel/license 即可。