Here is the code in Makefile:
#=======================================================================
# MASTER MAKEFILE FOR ZEUS-2D CODE
#
#------------------- object files -------------------- ----------------
OBJ = bval.o \
bvalrad.o \
ct.o \
dataio.o \
derivs.o \
emfs.o \
empty.o \
findno.o \
fld.o \
ggen.o \
giccg.o \
gradv.o \
gravity.o \
hdfall.o \
iccgaf.o \
intchk.o \
lorentz.o \
maxmin.o \
moment.o \
momx1.o \
momx2.o \
mprops.o \
msave.o \
mstart.o \
newgrid.o \
newvg.o \
newx1.o \
newx2.o \
nudt.o \
pdv.o \
pgas.o \
phibv.o \
printd.o \
restart.o \
rhs.o \
riccg.o \
setup.o \
srcstep.o \
strtoi.o \
stv1.o \
stv2.o \
stv3b3.o \
tav.o \
transprt.o \
tranx1.o \
tranx2.o \
viscus.o \
vtos.o \
x1intfc.o \
x2intfc.o \
x1intzc.o \
x2intzc.o \
zeus2d.o \
bcdflt.o \
checkin.o \
linpck.o \
alpha_old.o
#------------------- macro definitions -------------------------------
.SUFFIXES:
.SUFFIXES: .src .c .f .o
EXEDIR = ../exe/
SPEC = alpha_old
PROB = torus
USER = empty
# macros for sun or SGI
FC = gfortran
OPTS = -c
CC = cc
LDR = gfortran
#LIB = -ldf
LIB = -L/home/ianyang/CODE/hdflibs-64 -lmfhdf -ldf -
ljpeg -lz
#-------------------- implicit rules ---------------------------------
.src.o:
\cpp -P -traditional $< > $*.f
\${FC} \${OPTS} $*.f
.c.o:
${CC} -c -ansi -D_BSD_SOURCE -
I/home/fyuan/ZEUS2d/zeus2d_v2.0.3/hdf/4.1r5-
linux/include $<
#--------------------- targets ---------------------------------------
help:
@echo Type 'make compile' to generate ZEUS-2D
executable
@echo Type 'make clean' to remove *.f and *.o
files
@echo Type 'make listing' to create listing of code
#-----------------------------------------------------------------------
clean:
\rm *.o *.f
#-----------------------------------------------------------------------
listing:
cat Makefile zeus2d.def *.h *.src *.c > listing
#-----------------------------------------------------------------------
compile: ${OBJ} ${PROB}.o
${LDR} -o ${EXEDIR}zeus2d.exe ${OBJ} ${PROB}.o \
${LIB}
I've already download gfortran and tried to change the 'ifort' to 'gfort' or 'gfortran' :
FC = gfortran
LDR = gfortran
but it ended up with an error after I 'make compile':
collect2: error: ld returned 1 exit status
make: *** [Makefile:95: compile] Error 1
and some warnings:
Warning: Deleted feature: ASSIGN statement at (1)
linpck.f:296:20:
296 | 20 go to next,(30, 50, 70, 110)
|
Warning: Deleted feature: Assigned GOTO statement at (1)
linpck.f:298:72:
298 | assign 50 to next
|
Warning: Deleted feature: ASSIGN statement at (1)
linpck.f:307:72:
307 | assign 70 to next
|
Warning: Deleted feature: ASSIGN statement at (1)
linpck.f:313:72:
313 | assign 110 to next
|
Warning: Deleted feature: ASSIGN statement at (1)
linpck.f:349:72:
349 | 95 sum = sum + sx(j)**2
Warning: Fortran 2018 deleted feature: DO termination
statement which is not END DO or CONTINUE with
label 95 at (1)
\cpp -P -traditional alpha_old.src > alpha_old.f
\gfortran \-c alpha_old.f
\cpp -P -traditional torus.src > torus.f
\gfortran \-c torus.f
torus.f:236:72:
236 | do 10 i=is-2,ie+2
|
and it should've generated some .f files and an executable file, however, there wasn't an exe file. \After add -w in OPTS:
\cpp -P -traditional bval.src > bval.f
\gfortran \-w -c bval.f
\cpp -P -traditional bvalrad.src > bvalrad.f
\gfortran \-w -c bvalrad.f
\cpp -P -traditional ct.src > ct.f
\gfortran \-w -c ct.f
\cpp -P -traditional dataio.src > dataio.f
\gfortran \-w -c dataio.f
\cpp -P -traditional derivs.src > derivs.f
\gfortran \-w -c derivs.f
\cpp -P -traditional emfs.src > emfs.f
\gfortran \-w -c emfs.f
\cpp -P -traditional empty.src > empty.f
\gfortran \-w -c empty.f
\cpp -P -traditional findno.src > findno.f
\gfortran \-w -c findno.f
\cpp -P -traditional fld.src > fld.f
\gfortran \-w -c fld.f
\cpp -P -traditional ggen.src > ggen.f
\gfortran \-w -c ggen.f
\cpp -P -traditional giccg.src > giccg.f
\gfortran \-w -c giccg.f
\cpp -P -traditional gradv.src > gradv.f
\gfortran \-w -c gradv.f
\cpp -P -traditional gravity.src > gravity.f
\gfortran \-w -c gravity.f
\cpp -P -traditional hdfall.src > hdfall.f
\gfortran \-w -c hdfall.f
\cpp -P -traditional iccgaf.src > iccgaf.f
\gfortran \-w -c iccgaf.f
\cpp -P -traditional intchk.src > intchk.f
\gfortran \-w -c intchk.f
\cpp -P -traditional lorentz.src > lorentz.f
\gfortran \-w -c lorentz.f
\cpp -P -traditional maxmin.src > maxmin.f
\gfortran \-w -c maxmin.f
\cpp -P -traditional moment.src > moment.f
\gfortran \-w -c moment.f
\cpp -P -traditional momx1.src > momx1.f
\gfortran \-w -c momx1.f
\cpp -P -traditional momx2.src > momx2.f
\gfortran \-w -c momx2.f
\cpp -P -traditional mprops.src > mprops.f
\gfortran \-w -c mprops.f
\cpp -P -traditional msave.src > msave.f
\gfortran \-w -c msave.f
\cpp -P -traditional mstart.src > mstart.f
\gfortran \-w -c mstart.f
\cpp -P -traditional newgrid.src > newgrid.f
\gfortran \-w -c newgrid.f
\cpp -P -traditional newvg.src > newvg.f
\gfortran \-w -c newvg.f
\cpp -P -traditional newx1.src > newx1.f
\gfortran \-w -c newx1.f
\cpp -P -traditional newx2.src > newx2.f
\gfortran \-w -c newx2.f
\cpp -P -traditional nudt.src > nudt.f
\gfortran \-w -c nudt.f
\cpp -P -traditional pdv.src > pdv.f
\gfortran \-w -c pdv.f
\cpp -P -traditional pgas.src > pgas.f
\gfortran \-w -c pgas.f
\cpp -P -traditional phibv.src > phibv.f
\gfortran \-w -c phibv.f
\cpp -P -traditional printd.src > printd.f
\gfortran \-w -c printd.f
\cpp -P -traditional restart.src > restart.f
\gfortran \-w -c restart.f
\cpp -P -traditional rhs.src > rhs.f
\gfortran \-w -c rhs.f
\cpp -P -traditional riccg.src > riccg.f
\gfortran \-w -c riccg.f
\cpp -P -traditional setup.src > setup.f
\gfortran \-w -c setup.f
\cpp -P -traditional srcstep.src > srcstep.f
\gfortran \-w -c srcstep.f
\cpp -P -traditional strtoi.src > strtoi.f
\gfortran \-w -c strtoi.f
\cpp -P -traditional stv1.src > stv1.f
\gfortran \-w -c stv1.f
\cpp -P -traditional stv2.src > stv2.f
\gfortran \-w -c stv2.f
\cpp -P -traditional stv3b3.src > stv3b3.f
\gfortran \-w -c stv3b3.f
\cpp -P -traditional tav.src > tav.f
\gfortran \-w -c tav.f
\cpp -P -traditional transprt.src > transprt.f
\gfortran \-w -c transprt.f
\cpp -P -traditional tranx1.src > tranx1.f
\gfortran \-w -c tranx1.f
\cpp -P -traditional tranx2.src > tranx2.f
\gfortran \-w -c tranx2.f
\cpp -P -traditional viscus.src > viscus.f
\gfortran \-w -c viscus.f
\cpp -P -traditional vtos.src > vtos.f
\gfortran \-w -c vtos.f
\cpp -P -traditional x1intfc.src > x1intfc.f
\gfortran \-w -c x1intfc.f
\cpp -P -traditional x2intfc.src > x2intfc.f
\gfortran \-w -c x2intfc.f
\cpp -P -traditional x1intzc.src > x1intzc.f
\gfortran \-w -c x1intzc.f
\cpp -P -traditional x2intzc.src > x2intzc.f
\gfortran \-w -c x2intzc.f
\cpp -P -traditional zeus2d.src > zeus2d.f
\gfortran \-w -c zeus2d.f
cc -c -ansi -D_BSD_SOURCE -I/home/fyuan/ZEUS2d/zeus2d_v2.0.3/hdf/4.1r5-linux/include bcdflt.c
bcdflt.c: In function \u2018bcdflt_\u2019:
bcdflt.c:33:3: warning: incompatible implicit declaration of built-in function \u2018strncpy\u2019 [-Wbuiltin-declaration-mismatch]
33 | strncpy(buf,(char *)in + *ioff,*n);
| ^~~~~~~
bcdflt.c:2:1: note: include \u2018<string.h>\u2019 or provide a declaration of \u2018strncpy\u2019
1 | #include "zeus2d.def"
+++ |+#include <string.h>
2 | #ifdef UNICOS
cc -c -ansi -D_BSD_SOURCE -I/home/fyuan/ZEUS2d/zeus2d_v2.0.3/hdf/4.1r5-linux/include checkin.c
In file included from /usr/include/aarch64-linux-gnu/sys/time.h:21,
from checkin.c:74:
/usr/include/features.h:194:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
194 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
checkin.c: In function \u2018checkin_\u2019:
checkin.c:88:30: warning: passing argument 2 of \u2018select\u2019 from incompatible pointer type [-Wincompatible-pointer-types]
88 | if(*wait)nfound = select(1,&mask,0,0,&timeout);
| ^~~~~
| |
| int *
In file included from /usr/include/aarch64-linux-gnu/sys/time.h:32,
from checkin.c:74:
/usr/include/aarch64-linux-gnu/sys/select.h:102:51: note: expected \u2018fd_set * __restrict__\u2019 but argument is of type \u2018int *\u2019
102 | extern int select (int __nfds, fd_set *__restrict __readfds,
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
\cpp -P -traditional linpck.src > linpck.f
\gfortran \-w -c linpck.f
\cpp -P -traditional alpha_old.src > alpha_old.f
\gfortran \-w -c alpha_old.f
\cpp -P -traditional torus.src > torus.f
\gfortran \-w -c torus.f
gfortran -o ../exe/zeus2d.exe bval.o bvalrad.o ct.o dataio.o derivs.o emfs.o empty.o findno.o fld.o ggen.o giccg.o gradv.o gravity.o hdfall.o iccgaf.o intchk.o lorentz.o maxmin.o moment.o momx1.o momx2.o mprops.o msave.o mstart.o newgrid.o newvg.o newx1.o newx2.o nudt.o pdv.o pgas.o phibv.o printd.o restart.o rhs.o riccg.o setup.o srcstep.o strtoi.o stv1.o stv2.o stv3b3.o tav.o transprt.o tranx1.o tranx2.o viscus.o vtos.o x1intfc.o x2intfc.o x1intzc.o x2intzc.o zeus2d.o bcdflt.o checkin.o linpck.o alpha_old.o torus.o \
-L/home/ianyang/CODE/hdflibs-64 -lmfhdf -ldf -ljpeg -lz
/usr/bin/ld: skipping incompatible /home/ianyang/CODE/hdflibs-64/libmfhdf.a when searching for -lmfhdf
/usr/bin/ld: cannot find -lmfhdf: No such file or directory
/usr/bin/ld: skipping incompatible /home/ianyang/CODE/hdflibs-64/libdf.a when searching for -ldf
/usr/bin/ld: cannot find -ldf: No such file or directory
/usr/bin/ld: skipping incompatible /home/ianyang/CODE/hdflibs-64/libjpeg.a when searching for -ljpeg
/usr/bin/ld: cannot find -ljpeg: No such file or directory
/usr/bin/ld: skipping incompatible /home/ianyang/CODE/hdflibs-64/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:95: compile] Error 1
Files in home/CODE/hdflibs-64 are:
hello.c
libdf.a
libjpeg.a
libmfhdf.a
libz.a
ps: I'm using a M1 macbook so ifort cannot run on my computer.
Thanks so much for solving my problem!