Hello,
In the process of compiling a pretty large (and somewhat old) app, I’m encountering the error “undefined reference to `MAIN_'.” From reading other posts, the error originates from trying to link object(s) without a program if I understood correctly. The full log is almost 40k lines but the error is clearly identified in the following lines:
…/Linux_x86_64/21.7/compilers/bin/nvfortran -fPIC -O -o app1 object1.o object2.o object3.o object4.o object5.o … -L/usr/lib64 -L/opt/openmpi/lib
…/Linux_x86_64/21.7/compilers/lib/f90main.o: In functionmain': nvcjCgWBt7JZmVJ.ll:(.text+0x2f): undefined reference toMAIN_’
make[4]: *** [Makefile:499: app1] Error 2
Here, object1.f is supposed to be the main program and looks like:
PROGRAM TARGET ... call subroutines ... end
with object2.f, object3.f … having the different subroutines. I’m not really sure why this compilation fails or if the fact that the files are FORTRAN77 has anything to do with the error. Any input or suggestion would be welcomed. Thanks.