Installation Problem with omp_lib.h

I have just moved my installation to a new computer, re-installed it, and have obtained a permament license for my new installation. I obtained a demo program from www.openmp.org that is having a problem including the omp_lib.h include file. This is a standard Foratran 77 OpenMP demo program that computes pi from a series. The program includes the omp_lib.h include file:

implicit none

include ‘omp_lib.h’

integer r8_logn_max
parameter ( r8_logn_max = 10 )


When I compile, this code, I am seeing a number of the following errors:

$ pgf77 -mp compute_pi.f -o compute_pi
PGFTN-S-0034-Syntax error at or near /opt/pgi/linux86-64/7.2-5/include/omp_lib.h: xx

Obviously, I am missing a lib enviroment variable or have some installation error.

If someone could suggest a solution, I would appreciate the information.


Thanks,
Jim West

Hi Jim,

The ‘omp_lib.h’ file that we ship includes F90 kind specifiers, hence the syntax error with the F77 compiler. You have a few options. Use the ‘pgfortran’ driver instead of ‘pgf77’, edit the ‘omp_lib.h’ to remove the F90 language features, or manually add the external refefence to OpenMP routines that you’ll be using to your program.

Hope this helps,
Mat

Thanks Mat!
Your note really help explain this situation.
I thought using pgf77 to complie this code would work since the included scripts used “gfortran -openmp”. Given your note, I located a F90 version of compute_pi and that compiled fine with the pgf90 compiler.

Thanks,
Jim