I'm attempting to compile some complete Fortran code developed by someone else. The makefile makes references to CC, F77 and F90. Our server doesn't have F90 on it, but I could probably ask for it if it turns out it's actually needed.
Anyway, I think I have the environment variables set appropriately (all I did was uncomment the correct lines), so I cp'd the file to makefile, typed make and got the following errors.
make[1]: Entering directory `/imageseer/Scripts/PGE03_V5.2.6/PGE03/MOD_PR35'
f77 -c -n32 -fullwarn -u -bytereclen -extend_source -woff 2271,2272,2274 -O2 -c -u -bytereclen -col120 -woff 2271,2272,2274 -I -I -I -I -I/shared_src/atmos_src/src_UW -I/shared_src/atmos_src/src_L2 Antarctic_day.f
f77: 2271,2272,2274: No such file or directory
f77: 2271,2272,2274: No such file or directory
f77: unrecognized option `-n32'
f77: unrecognized option `-woff'
f77: unrecognized option `-col120'
f77: unrecognized option `-woff'
f771: error: unrecognized command line option "-fullwarn"
make[1]: *** [Antarctic_day.o] Error 1
make[1]: Leaving directory `/imageseer/Scripts/PGE03_V5.2.6/PGE03/MOD_PR35'
make: *** [target] Error 2
I'm not sure if you guys will be able to help, but unfortunately, due to licensing issues, I don't think it would be appropriate for me to copy code here. Anyway, I am not sure how to tell if the unrecognized opti开发者_JAVA技巧ons are unique to the system of the development team, or if they're due to some shortcoming of my system (i.e., I should ask my noble sysadmin to install f90), or some other problem. I should also confess that I know next to nothing about Fortran, and have only ever used make with cc, so a third possibility is that I should pass the buck to someone else, but I don't think anyone on my team does know Fortran. As always, thanks for your help!
You almost certainly have (or could have) a fortran 90 compiler, whether you know it or not; any decent fortran compiler nowadays has at least F90/95 support. Is f77 a link to g77? Do you have gfortran installed?
It looks to me like the options are for an old SGI compiler. If that's the case, it's possible it could be made to work "out of the box" with the newly-open-sourced Pathscale compilers. But I think most of the options have analogues in other compilers.
Some of the options appear to be listed here. -fullwarn turns on all warnings; in gfortran that would be -Wall. -woff turns off some warnings - here, warning 2271, 2272, and 2274. No idea what those are for now; I'd just leave all warnings on and see what comes of it.
-col120 lifts the 72 column limit of f77 and allows lines to be 120 column wide. In g77/gfortran that would be -ffixed-line-length-120 . -extend_source does something similar and can probably be ignored.
-n32 generates what I take to be a 32-bit object. -m32 should do the same, but I'd wait to find out why this needs to be 32-bit to do this.
精彩评论