Compiling SMOKEv4.7

Dear all,

I am compiling SMOKEv4.7, when I was in the /smoke/subsys/smoke/src directory, and typed make. The error is showed in the picture

However, I am sure there is libemmod.a in the /smoke/subsys/smoke/src directory. I also have a try to copy the libemmod.a to the /smoke/subsys/smoke/src/inc directory, but the error is still appeared.

My Makeinclude file was set as:

*               BIN    =  Linux2_x86_64gfort*
*               BASEDIR = ${SMK_HOME}/subsys/smoke/src*
*               INCDIR  = ${BASEDIR}/inc*
*               OBJDIR  = ${BASEDIR}/../${BIN}*
            IOBASE  = ${SMK_HOME}/subsys/ioapi
            IODIR   = ${IOBASE}/ioapi
            IOBIN   = ${IOBASE}/${BIN}
            IOINC   = ${IODIR}/fixed_src

            INSTDIR = /${OBJDIR}/${BIN}

            ##  Architecture dependent stuff
            include ${IODIR}/Makeinclude.${BIN}
            F90 = $(FC)

            # IFLAGS = -I${IOINC} -I${INCDIR} -I${IOBIN}                #  Intel, Absoft, Pathscale, UNIX Fortran
             IFLAGS = -I${IOINC} -I${INCDIR} -I${IOBIN}                #  GNU   Fortran
            # IFLAGS = -I${IOINC} -I${INCDIR} -M${IOBIN}                #  Sun   Fortran
            # IFLAGS = -I${IOINC} -I${INCDIR} -module ${OBJDIR} -module ${IOBIN}    #  PGI Fortran:  order *important*

            # EFLAG = -extend-source 132 -zero                       #  Intel Fortran
             EFLAG = -ffixed-line-length-132  -fno-backslash       #  GNU   Fortran
            # EFLAG = -Mextend -Mbackslash                          #  PGI Fortran
            # EFLAG = -e                                            #  Sun   Fortran
            # EFLAG = -W132                                         #  Absoft   Fortran



            ARFLAGS = rv

            SMKLIB = -L${OBJDIR} -lsmoke
            ########  netCDF-4 needs "-lnetcdff -lnetcdf":
            # IOLIB = -L$(IOBIN) -lioapi -lnetcdff -lnetcdf ${PVMLIBS}
              IOLIB = -L$(IOBIN) -lioapi -lnetcdff -lnetcdf
            ########  Note that we must resolve the  %^&$*! circular dependency
            ########  between libfileset and libsmoke:
            LIBS = -L${OBJDIR} -lfileset -lsmoke -lemmod -lfileset -lsmoke \
                   ${IOLIB} $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
            VPATH  =  ${OBJDIR}

Thank you very much.
Best regards,

Did you do make dir before you did make all ? (That makes ${OBJDIR} for you)

libemmod.a should be in ${OBJDIR? Why isn’t it there – does ${OBJDIR} even exist?

Sorry, what is make dir?
In the /smoke/subsys/smoke directory, I typed
export BIN Linux2_x86_64gfort
mkdir $BIN
Was this step making dir?

Thank you very much.
I typed ls -l to check the libemmod.a in my /smoke/subsys/smoke/src. According to the time, it was generated before today. And it was not generated in the $BIN. So I am really confused.

Yes, make dir does a mkdir ${OBJDIR}

Somehow you’ve managed to get a copy of libemmod.a in the wrong place. So remove it, and all the .o and .mod files in src or any of its sub-directories, and then start over with your make.

Thank you very much. I modified my ${INSTDIR}, and removed the files. This problem was solved.
But I meet a new error.

      &              ((',', PROF_MON( S,NP )), NP = 1,12 )
Error: Expected a right parenthesis in expression at (1)
 `   /disk/r004/cliucv/smoke/subsys/smoke/src/emutil/gentpro.f:1696:34:`

      &                      ( (',', PROF_DAY( S,NP ) ), NP = 1,31 )
Error: Expected a right parenthesis in expression at (1)
make: *** [Makefile:348: gentpro.o] Error 1

This is a different bug (that I reported some time ago, and is fixed in later versions of SMOKE, I think):
gfortran makes its own idiosyncratic and stuffy interpretation of the Fortran Standard, and doesn’t like the double-parentheses (PGI and Intel compilers allow them). Instead, use

            DO S = 1, NSRGFIPS
                WRITE( MODEV, "(A,12(A,E10.3))" ) SRGFIPS( S ),
     &              (',', PROF_MON( S,NP ), NP = 1,12 )
            END DO

Thanks very much. I compiled the model succefully.