I try to build a makefile for the DL POLY 4 program, however, when executing the make gnu -f Makefile_MPI clean command, an error is displayed:

 make LD = gfortran \
 LDFLAGS = "- O3" \
 FC = "gfortran -c" \
 FCFLAGS = "- O3" \
 EX = DLPOLY.Z BINROOT = .. / execute master
 make [1]: enter the directory "/ home / rasul / desktop / blya / source"
 make [1]: *** There is no rule for building a master target.  Stop.
 make [1]: exit directory "/ home / rasul / desktop / blya / source"
 Makefile_MPI: 242: Recipe execution error for the "gnu" target
 make: *** [gnu] Error 2 

Makefile summary:

 / * --- CODE --- * /

 gnu:
     $ (MAKE) LD = gfortran \
     LDFLAGS = "- O3" \
     FC = "gfortran -c" \
     FCFLAGS = "- O3" \
     EX = $ (EX) BINROOT = $ (BINROOT) $ (TYPE)

 ---------------------

 master: message check $ (OBJ_MOD) $ (OBJ_ALL)
     $ (LD) $ (EXE) $ (LDFLAGS) $ (OBJ_MOD) $ (OBJ_ALL)

 # Message
 message:
     @echo "DL_POLY_4 compilation in MPI mode"
     @echo
     @echo "'Use mpi_module' must change to 'Use mpi' in 'comms_module.f90'"
     @echo

 # Check that a platform has been specified
 check:
     @if test "$ {FC}" = "undefined";  then \
     echo;  echo "*** FORTRAN90 compiler unspecified!";  \
     echo;  echo "*** Please edit your Makefile entries!";  \
     echo;  exit 99;  \
     fi;  \
     \
     if test "$ {LD}" = "undefined";  then \
     echo;  echo "*** FORTRAN90 Linker-loaDer unspecified!";  \
     echo;  echo "*** Please edit your Makefile entries!";  \
     echo;  exit 99;  \
     fi;  \
     \
     mkdir -p $ (BINROOT);  touch dl_poly.f90

     / * --- CODE --- * /

Never worked with makefile and fortran , help, please.

    1 answer 1

    recursively runs the make program, which does not pass the argument -f Makefile_MPI .

    accordingly, this instance of the make program tries to interpret the first file found in the current directory with the name: GNUmakefile , makefile , Makefile . and in this file (I quote):

    There is no rule for building a master target.


    The simplest solution for circumventing this flaw of developers is to run the make program for the desired purpose, without forgetting to add all the arguments mentioned in the log directly :

     $ make -f Makefile_MPI LD=gfortran LDFLAGS="-O3" FC="gfortran -c" FCFLAGS="-O3" EX=DLPOLY.Z BINROOT=../execute master 
    • Thank you so much! Everything worked out! - KRasul