is f77 available on freeBSD. this is a GCC application. We found it on a recent version of Linux mint. machine says 64 bit kernel option not found. does that mean you would have to recompile the kernel?
is f77 available on freeBSD. this is a GCC application. We found it on a recent version of Linux mint. machine says 64 bit kernel option not found. does that mean you would have to recompile the kernel?
$ grep -i fortran /usr/ports/lang/gcc13/Makefile | grep "LANGUAGES:"
LANGUAGES:= c,c++,objc,fortran,jit
sudo pkg install gcc13
.And if one wants FOERTRAN IV?lang/f2c is still an option if all you want is f77
Then one needs to check if the fossilisation is allowing for the fingers to still move.And if one wants FOERTRAN IV?
Merged the threads. Probably should have moved the posts, the order is a bit wonky now.The other thread has a lot more answers. It seems easy to install the Gnu Fortran compilar. We should close this thread.
FORTRAN IV was perhaps the last "FORTRAN", not the same as "fortran".Heck, that is OLD
Somewhere in the fridge I still have a copy of Daniel D. McCracken's A Guide to FORTRAN IV Programming.And if one wants FOERTRAN IV?
That was the textbook with which I, and perhaps most students, learnt FORTRAN.Somewhere in the fridge I still have a copy of Daniel D. McCracken's A Guide to FORTRAN IV Programming.
how do i get to the other thread?The other thread has a lot more answers. It seems easy to install the Gnu Fortran compilar. We should close this thread.
thankyou for your response. your comments are very interesting. regarding gfortran. I wonder how can I modify freebsd to include gfortran. And your comment about a gcc compiler being optional. I am not in front of my computer that has BSD 12 on it. But my recollection is that if you type gcc at the command line the computer doesn't say not found but says something like command incomplete. that it needs a fn to respond to your command. Does that indicate there is a default gcc compiler on board? if so how do you find out what it is? regarding /lang/gcc13. Verbiage on the freebsd website promises that it is available. But my friend looked in usr/ports/lang/ and gcc13 wasn't there. what was there wss:gcc,gcc10,gcc11,gcc48,gcc8,gcc9,gcc11 -devel and gcc12 -devel. But no gcc13. This begs the question: how do you add it? I want to use freebsd not linux but my friend is able to compile an ANSI 77 fortran source file on his mint box. that has gcc version 7.5.0 installed using compiler f77 and extension .for. Is there a way to add gcc 7.5.0 to bsd? error messages vary depending on what file extension is used. and regarding lang/f2c. ftoc converts fortran code to c . it is not a compiler.The GNU gcc suite Fortran compiler used to be called g77, but it is no longer supported. As of gcc-4.0 (a long time ago) the name of the GNU Fortran project is gfortran.
You can use the GNU compilers on FreeBSD, but they are optional.
Fortran is installed e.g. as gfortran13 with the gcc13 suite:You can install the gcc13 suite withCode:$ grep -i fortran /usr/ports/lang/gcc13/Makefile | grep "LANGUAGES:" LANGUAGES:= c,c++,objc,fortran,jit
sudo pkg install gcc13
.
Howerver, FreeBSD uses the LLVM compiler toolset natively. And as digifuzzy indicated, lang/lfortran provides a really good option.
lang/f2c is still an option if all you want is f77, but significantly less capable than the modern compilers.
OK. So we have a fortran source code listing. It most certainly was written per ANSI STD 77. I have not been able to get it to compile clean (without errors) on my box with freebsd version 12. It appears I can check to see what version of gcc is installed default using the command gcc -v. I will try that tonight. My friend was able to compile the code clean and produce an execuable file using the command f77 fn.for on his box with with Linux Mint os. The command name and file extension appear important as different combinations give different error codes. the linux box appears to have gcc version 7.5.0 installed and uses gfortran for ansi std 77. It appears gfortran is how gcc provides the ansi std 77 compiler.As it appears from your link that message dates from 2008; some 1.5 decade ago. You also posted elsewhere*:
It would help if you stated your question/problem or desired source code to compile more clearly. **
If you have a (recent) Fortran (cross-)compiler from the FreeBSD ports collection that does not compile or gives you some problems, please specify what you have tried and what (error) output you got.
If you want to use a Linux supported Fortran compiler that satisfies your requirements, you could make use of FreeBSD support for Linux (Linux compatibility layer); see for example Part II: Common Tasks of the FreeBSD Handbook.
If you want to use a Linux Fortran compiler, you could also run Linux virtualized on bhyve (FreeBSD bhyve intro), if so desired.
These remarks are all made from a helicopter-like point of view; more specifics from your part will in all likelihood result in more specific answers from (other) forum users.
___
* that would probably be considered as cross-posting.
** perhaps refer to How to ask questions the smart way; Be precise and informative about your problem
The response you get depends on the shell you are using. Most will say:But my recollection is that if you type gcc at the command line the computer doesn't say not found
[strand.560] $ gcc
ksh: gcc: not found
I don't run FreeBSD 12, but it looks like gcc11 is the most recent gcc suite available on FreeBSD 12.x. So install it withhow can I modify freebsd to include gfortran.
sudo pkg install gcc11
. If sudo
doesn't work, just do it while logged in as root. If gcc11 is not available, try gcc10...That will work on Linux, but not on FreeBSD. The gcc compilers on FreeBSD all have an integer suffix on their name to identify the version (it allows multiple version of gcc to co-exist). UseIt appears I can check to see what version of gcc is installed default using the command gcc -v.
ls -lad /usr/local/bin/gcc??
or ls -lad /usr/local/bin/gfortran??
gfortran is a modern compiler, and recognises many file name extensions, including .f, .for, .ftn, .f90, .f95, .f03 and .f0. It is backwards compatible with Fortran 77.extension .for
There may be, but gcc7.5 is several years old and not currently supported on FreeBSD. You would probably have to acquire and compile it from source. It may have problems. You don't want it. You want a current (not "devel") package, built, maintained, patched, and provided freely by a team of experts.Is there a way to add gcc 7.5.0 to bsd?
Quite so. You convert the Fortran 77 to C and then use the C compiler of your choice. Here is a simple example of how to compile a single Fortran 77 source file (I'm using the native LLVM C compiler here, but it does not matter which C compiler I use):ftoc converts fortran code to c . it is not a compiler.
[strand.628] $ cat xx.f
write(6,1000)
1000 format("Hello world")
stop
end
[strand.629] $ f2c xx.f >xx.c
xx.f:
MAIN:
[strand.630] $ cc -I /usr/local/include -o xx xx.c /usr/local/lib/libf2c.a -lm
[strand.631] $ ./xx
Hello world
It has been merged into this thread.how do i get to the other thread?