Compilation and Installation
Procedure
- Use PuTTY to log in to the server as the root user.
- Decompress the installation package.
unzip miniGhost-master.zip
- Go to the directory generated after the decompression.
cd /path/to/MINIGHOST/miniGhost-master/ref
- Create a Makefile file.
mv Makefile Makefile.bak cp makefile.mpi.gnu Makefile
- Modify the Makefile file.
- Open the Makefile file.
vi Makefile
- Press i to enter the edit 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/HMPI/lib -lmpi_mpifh #LDFLAGS=$(CFLAGS) $(FFLAGS) #LDFLAGS=$(FFLAGS) LIBS= include make_targets
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the Makefile file.
- Perform the compilation.
make
Parent topic: miniGhost 1.0 Porting Guide (openEuler 21.03)