Solved Fortran Compiler

I am currently looking for a Fortran 95 compiler for FreeBSD, but I can't seem to find one. Is there one available?
 
GCC should include Fortran 95/2003 compiler. Should be just

gcc program.f

Note that FreeBSD have several different versions of GCC in ports.
 
Did you mean % gfortran program.f?

Update: You will have to run % gfortran -Wl,-rpath=/usr/local/lib/gcc48 program.f (or the equivalent for whatever version of gcc you install).
 
GCC should include Fortran 95/2003 compiler. Should be just

gcc program.f

Note that FreeBSD have several different versions of GCC in ports.

I didn't know you could do that with gcc. I've always used it for C/C++. No wonder the compiler code takes forever to compile.

Did you mean % gfortran program.f?

Update: You will have to run % gfortran -Wl,-rpath=/usr/local/lib/gcc48 program.f (or the equivalent for whatever version of gcc you install).

I'll put that in the make file transforms section.
 
Did you mean % gfortran program.f?

Update: You will have to run % gfortran -Wl,-rpath=/usr/local/lib/gcc48 program.f (or the equivalent for whatever version of gcc you install).

Depends on the system but in general GCC is smart enough so that you can compile the "Hello World" program with

gcc program.f
 
The thing is, I am going to have to learn Fortran. GCC 6.1 is not a prebuilt package, so I had to build it. It took 10 hours to do so.
 
Not a pre-built package? On what platform?
lang/gcc6-aux is definitely pre-built on i386 and amd64 (ada compiler but includes fortran by default).
I'm nearly 100% sure lang/gcc6* is also prebuilt.
 
It is.
Code:
% pkg rquery -r FreeBSD "%Ok=%Ov" -x gcc6
BOOTSTRAP=on
GRAPHITE=off
JAVA=on
Code:
% pkg rquery -r FreeBSD "%Ok=%Ov" -x gcc6-aux
ALLSTAGES=off
BOOTSTRAP=off
FORT=on
NLS=on
OBJC=on
STATIC=off
TESTSUITE=off
 
The port does this, so those packages should be fine.

Code:
% grep fortran /usr/ports/lang/gcc6/Makefile
LANGUAGES:=     c,c++,objc,fortran
 
jrm is correct, the fortran options are set ON by default. I don't know where maelstrom is getting his idea that gcc6 is not prebuilt. jrm linked to the allegedly missing packages so hopefully that settles it.
 

Maybe, because pkg couldn't find it.

Code:
strata:/root 622 ### ->pkg fetch gcc6
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%  944 B  0.9kB/s  00:01
Fetching packagesite.txz: 100%  5 MiB  1.9MB/s  00:03
Processing entries: 100%
FreeBSD repository update completed. 25124 packages processed.
gcc6 has no direct installation candidates, change it to gcc? [Y/n]: n
gcc6 has no direct installation candidates, change it to gcc? [Y/n]: n
gcc6 has no direct installation candidates, change it to gcc46? [Y/n]: ^C
strata:/root 623 ### ->pkg fetch gcc6-6.1.0
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages matching 'gcc6-6.1.0' have been found in the repositories
strata:/root 624 ### ->

That is why I had to build it from ports.
 
Thanks for clarifying. I'll report the problem. In the meantime, if you have to re-install for some reason, the package for lang/gcc6-aux is available (verified).
 
Of, of course. FreeBSD 10 switched to the quarterly repositories by default. You have to tell pkg to use the latest repository if you want to install the packages linked to above.
 
Not a pre-built package? On what platform?
lang/gcc6-aux is definitely pre-built on i386 and amd64 (ada compiler but includes fortran by default).
I'm nearly 100% sure lang/gcc6* is also prebuilt.
Hi I installed gcc6-aux using pkg due to an installation issue with scikit-learn (which is a python programming language module) which I tried to install in a python virtual environment using pip.
Would anyone be able to help me in this regards
Thanks & Best Regards
Schroter
 
I have scikit compiled from ports
Code:
pkg info | grep scikit
py38-scikit-bio-0.5.6          Data structures, algorithms, educational resources for bioinformatics
py38-scikit-build-0.11.1       Build system generator for Python C/C++/Fortran/Cython extensions
py38-scikit-fusion-0.2.1_2     Data fusion based on recent collective latent factor models
py38-scikit-fuzzy-0.4.2_1      Fuzzy logic toolkit for SciPy
py38-scikit-image-0.18.2       Image processing in Python
py38-scikit-learn-0.22_1       Machine learning algorithms for python
py38-scikit-optimize-0.8.1     Sequential model-based optimization toolbox
py38-scikit-sparse-0.4.5       Sparse matrix package
py38-scikit-umfpack-0.3.2_3    Python interface to UMFPACK sparse direct solver
No need for any gcc-aux.
scikit uses
Code:
gcc10-10.3.0                   GNU Compiler Collection 10
 
I have scikit compiled compiled from ports
Code:
pkg info | grep scikit
py38-scikit-bio-0.5.6          Data structures, algorithms, educational resources for bioinformatics
py38-scikit-build-0.11.1       Build system generator for Python C/C++/Fortran/Cython extensions
py38-scikit-fusion-0.2.1_2     Data fusion based on recent collective latent factor models
py38-scikit-fuzzy-0.4.2_1      Fuzzy logic toolkit for SciPy
py38-scikit-image-0.18.2       Image processing in Python
py38-scikit-learn-0.22_1       Machine learning algorithms for python
py38-scikit-optimize-0.8.1     Sequential model-based optimization toolbox
py38-scikit-sparse-0.4.5       Sparse matrix package
py38-scikit-umfpack-0.3.2_3    Python interface to UMFPACK sparse direct solver
No need for any gcc-aux.
scikit uses
Code:
gcc10-10.3.0                   GNU Compiler Collection 10
Hi,Thanks for the reply However, this solution is good if you do not intend to use virtual environments. I use virtual environments since I do not want to these packages messing with system files. In fact it is recommenced in scikit-learn website itself to use virtual environments when using scikit-learn.

Thanks & Best Regards
Schroter
 
Hi I installed gcc6-aux using pkg due to an installation issue with scikit-learn (which is a python programming language module) which I tried to install in a python virtual environment using pip.
Would anyone be able to help me in this regards
Thanks & Best Regards
Schroter
hi, i ran across this in GG search for install scikit-image, a similar package that was failing to install using a similar setup (venv+pip) out of the box on FreeBSD, and i wanted to document just in case anyone else ran across this.

i found it necessary to pkg install openblas gcc12 cmake and ln -s /usr/local/bin/gfortran12 ~/bin/gfortran.


now,
what i would've preferred to do is use lfortran to build the pip package, except the Meson build system (of which i'm totally unaware) is involved in building the package, and the error message indicated that Meson was nowhere searching for lfortran. i think it was checking using the list here in the Meson defaults. would be nice if lfortran were supported since other FreeBSD forum readings suggest it might be a nicer alternative to the gcc toolchain for FreeBSD.
 
Back
Top