Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28872 Discussions

F77, F77_OPTIONS, INCLUDE_DIRS, LD_OPTIONS_NETCDF

negar
New Contributor I
2,423 Views

Hello

I have just installed Ubuntu 18.04 LTS on my laptop and I'm new to this. I am required to run my Model which is called IBIS, so I have to install g77 or f77. I could not install these compilers. Finally, I installed fort 77.  Then, I am trying to compile my Model with the NetCDF library. The environment variable which is needed to compile my model is: F77, F77_OPTIONS, INCLUDE_DIRS, LD_OPTIONS_NETCDF  
 Could anybody help me how can I determine these variable?

Thanks 

Negar.T

0 Kudos
10 Replies
Arjen_Markus
Honored Contributor I
2,412 Views

I do not know the software you mention, IBIS, but the environment variables you mention indicate that you have to build the software using a makefile. Typically, such a makefile is parameterised to make things flexible. Here is my guess at the meaning:

F77 - the Fortran (or better FORTRAN) compiler you want to use. That will be "ifort" (without the quotation marks), make sure that ifort is in your PATH.

F77_OPTIONS - any additional options, like -g for debugging or -O2 for optimisation and the like

INCLUDE_DIRS - that could be anything, but I guess the directories that contain your extra included files.

LD_OPTIONS_NETCDF - presumably the option to indicate where the NetCDF library are stored

 

One way to deal with the problem of finding the right values is to first set the F77 variable and then run make. Detect from the error messages what is now missing and use the above indications to set the remaining environment variables.

Or consult the documentation or the user community of this software :).

 

 

negar
New Contributor I
2,380 Views

Hello,

Thank you for answering my question. I have just understood how to determine these variables (INCLUDE_DIRS and LD_OPTIONS_NETCDF)  with your help but unfortunately, I have not understood how to determine these variables  (F77 and F77_OPTIONS) yet. I have sent a file to you. you maybe understand what are these 2 variables. 

Thank you

Negar.T

 

 

0 Kudos
Arjen_Markus
Honored Contributor I
2,375 Views

Fairly clear: the makefile contains settings for a bunch of compilers, not of course for Intel Fortran.

But by the looks of it:

F77 = ifort

F77_OPTIONS =

should do it.

Edit the makefile directly though, do not set environment variables in the shell and then run make, as you would have to know what takes precedence - these environment variables or the variables explicitly set in the makefile. (I do not, myself :))

 

mecej4
Honored Contributor III
2,382 Views

I think that "fort 77" is just a script that allows you to use the AT&T f2c Fortran-to-C converter. The converter was great for the 90s, when there were few free Fortran compilers for PCs, but it is very much dated now. You may be able to modify the makefiles or other scripts that come with your IBIS software so as to use Intel Fortran or Gfortran instead, and that will work far better than f2C. 

negar
New Contributor I
2,372 Views

Hello,

Thank you very much for answering my question. I have installed gfortran and gcc in my Linux. I, actually, do not know what is Intel Fortran and I have not installed it. My major question is how can I determine these 2 variables (F77 , F77_OPTIONS ). Do you know anything about them?

Thank you

Negar,T

0 Kudos
Arjen_Markus
Honored Contributor I
2,364 Views

Now you have me puzzled. If you do not know what Intel Fortran is and you have not installed it at all, why then do you go to a forum dedicated to the Intel Fortran compiler?

ifort is the command/program that drives the compiler. Other such commands are: g77, f77 (both old stuff, geared to the FORTRAN 77 standard), gfortran, nagfor, pgifort, ifort (more modern compilers supporting the later Fortran standards).

To try and answer your question in different words:

The variable F77 in the makefile is the command that drives the compiler. In your case that would be gfortran.

The variable F77_OPTIONS in the makefile is the list of options you want to add. In your case I would leave it empty. In general no specific options are required. They can tune the compiler, but that is a whole different matter than simply building the program initially.

If you seek general advice on Fortran, there is the newsgroup and other resources on the Internet.

negar
New Contributor I
2,345 Views

Hello again,

Do you mean that F77=gfortran or fort77?

Actually, I saw a question that is similar to mine (in a link below). Then, I joined the Intel Community. Maybe someone will answer my question. I'm new to Fortran.

Thank you for your help.

 

https://community.intel.com/t5/Intel-Fortran-Compiler/Undefined-symbols-for-architecture-x86-64/td-p/760614

0 Kudos
mecej4
Honored Contributor III
2,317 Views

The symbol F77 in the makefile is simply a variable whose value should be set to the name of the Fortran compiler that you wish to use. For your system, change the line

F77 = g77

in the makefile to 

F77 = gfortran

and then run make.

negar
New Contributor I
2,294 Views
Hello
The environment variable which I have told you (F77, F77_OPTIONS, INCLUDE_DIRS) will be determined like below?
( I have not known how to determine F77_OPTIONS yet)
F77 - the compiler I want to use. F77_OPTIONS - any additional options, like -g for debugging or -O2 for optimization and the like. INCLUDE_DIRS - that could be anything, but I guess the directories that contain your extra included files. LD_OPTIONS_NETCDF - presumably the option to indicate where the NetCDF library is stored.
F77 = gfortran
F77_OPTIONS =?  
INCLUDE_DIRS  = -I/usr/include
  LD_OPTIONS_NETCDF  = -L/usr/lib -lnetcdff
 

nf-config --all

This netCDF-Fortran 4.4.4 has been built with the following features:

  --cc        -> gcc
  --cflags    ->  -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2

  --fc        -> gfortran
  --fflags    -> -I/usr/include
  --flibs     -> -L/usr/lib -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF-Fortran 4.4.4

0 Kudos
Steve_Lionel
Honored Contributor III
2,330 Views

A lot of people searching for help on Fortran end up here, even though this is a forum specifically for Intel Fortran, because this is one of the best places on the web to find Fortran help. 

Reply