Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing miniGhost

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following commands to decompress the miniGhost installation package:
    unzip miniGhost-master.zip
  3. Run the following command to switch to the directory generated after the package is decompressed:
    cd /path/to/MINIGHOST/miniGhost-master/ref
  4. Run the following commands to create a Makeflie file:
    mv Makefile Makefile.bak
    cp makefile.mpi.gnu Makefile
  5. Run the following command to modify the Makeflie file:
    1. Open Makefile.
      vi Makeflie
    2. Press i to enter the insert mode and modify the file as follows:
      PROTOCOL = -D_MG_MPI
      MPI_LOC = /path/TO/OPENMPI
      MPI_INCLUDE = -I$(MPI_LOC)/include
      # State precision: -D_REAL4 and/or -D_REAL8.
      REAL_PRECISION = -D_MG_REAL8
      # Integer precision: -D_INT4 and/or -D_INT8.
      INT_PRECISION = -D_MG_INT4
      # Compilers
      FC=$(MPI_LOC)/bin/mpif90
      CC=$(MPI_LOC)/bin/mpicc
      CFLAGS = $(PROTOCOL) $(REAL_PRECISION) $(INT_PRECISION)
      # C main calling Fortran subroutine:
      CFLAGS += -Df2c_ -fsigned-char
      CFLAGS += $(MPI_INCLUDE)
      FFLAGS = $(PROTOCOL) $(REAL_PRECISION) $(INT_PRECISION)
      # Optimization
      OPT_F =-O3
      FFLAGS += $(OPT_F)
      #FFLAGS += $(MPI_INCLUDE)
      # Free-form Fortran source code:
      FFLAGS += -ffree-form -ffree-line-length-none
      # Array bounds checking: (expensive!)
      #FFLAGS += -fbounds-check
      # Compile to include checkpointing capability.
      FFLAGS += -D_MG_CHECKPT
      NCPATH=
      LNCDF=-L$(NCPATH)/lib
      LD=$(CC)
      LDFLAGS=$(CFLAGS) $(FFLAGS)  -L/path/to/GNU/gcc9.1/lib64/ -lgfortran -L/path/to/OPENMPI/openmpi-4.0.1-gcc9.1/lib -lmpi_mpifh
      #LDFLAGS=$(CFLAGS) $(FFLAGS)
      #LDFLAGS=$(FFLAGS)
      LIBS=
      include make_targets
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Run the following command to perform compilation:
    make

    Parallel compilation (by using the make -j command) is not supported. Run the make command to perform compilation.