#107 f95 examples do not compile with ifort


I installed plplot-5.9.7 from tarball as per instructions, but the f95 examples
will not compile with ifort 12.0.3.

The f95 examples do compile and run OK if instead of ifort I use gfortran
(by using "setenv FC gfortran").

The exact sequence of commands I used for the install are:

setenv FC "ifort -assume byterecl"
cd ~/plplot
tar xf plplot-5.9.7.tar.gz
mkdir build_dir
mkdir install_dir
cd build_dir
cmake -DCMAKE_INSTALL_PREFIX=~/plplot/install_dir ../plplot-5.9.7 >& cmake.out
less cmake.out
make >& make.out
less make.out
make install >& make_install.out
less make_install.out

[BTW: Documentation at http://www.miscdebris.net/plplot_wiki/index.php?title=Additional_notes_for_ifort_users
is incorrect. The ifort option is specified as "ifort -assume byterecl" not "ifort --assume byterecl".
That is, a single "-" not "--".]

The ifort compile problem for f95 examples:

> cd ~/plplot/install_dir/share/plplot5.9.7/examples/f95

> make
/opt/intel/composerxe-2011.3.174/bin/intel64/ifort x01f.f90 -o x01f -Wl,-rpath -Wl,/home/andrewn/plplot/install_dir/lib `PKG_CONFIG_PATH=/home/andrewn/plplot/install_dir/lib/pkgconfig pkg-config --cflags --libs plplotd-f95`
x01f.f90(23): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [PLPLOT_TYPES]
use plplot, PI => PL_PI
x01f.f90(32): error #6404: This name does not have a type, and must have an explicit type. [PL_PARSE_FULL]
call plparseopts(PL_PARSE_FULL)
x01f.f90(23): error #6581: Unresolved rename. [PI]
use plplot, PI => PL_PI
x01f.f90(189): error #6498: The use-name for this local-name is not defined. [PI]
y(i) = sin( x(i) * PI/180.0_plflt )
compilation aborted for x01f.f90 (code 1)
make: *** [x01f] Error 1

Further info that may be of use:

The f77 examples compile and run OK with ifort.

The files
are attached as
> cat cmake.out make.out make_install.out > output

I think the includes and libs used in
expand with pkg-config as follows:

> setenv PKG_CONFIG_PATH /home/andrewn/plplot/install_dir/lib/pkgconfig
> pkg-config --cflags --libs plplotd-f95
-L/home/andrewn/plplot/install_dir/lib -lplplotf95d -lplplotf95cd -lplplotd -lltdl -ldl -lm -lcsirocsa -lcsironn -lqhull -lqsastime

> cat /etc/redhat-release
Scientific Linux release 6.0 (Carbon)

> cat /proc/version
Linux version 2.6.32-71.24.1.el6.x86_64 (mockbuild@sl6.fnal.gov) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Fri Apr 8 01:07:23 CDT 2011


  • andrewn

    cmake.out make.out make_install.out

  • Arjen Markus
    Arjen Markus

    What does
    echo "/opt/intel/composerxe-2011.3.174/bin/intel64/ifort x01f.f90 -o x01f -Wl,-rpath -Wl,/home/andrewn/plplot/install_dir/lib `PKG_CONFIG_PATH=/home/andrewn/plplot/install_dir/lib/pkgconfig pkg-config --cflags --libs plplotd-f95`"

    report? That ought to give us insight in the exact command that is run.

    On my Windows system - using MinGW - the module files reside in bindings/f95 - but that is pre-installation. Could you check what the content is of the directory /home/andrewn/plplot/install_dir/lib/fortran/modules/plplot ?

  • andrewn

    This is the command that Makefile runs. (The following make no sense in tcsh, just get error:
    PKG_CONFIG_PATH=/home/andrewn/plplot/install_dir/lib/pkgconfig: Command not found.)
    In bash we get:

    echo "/opt/intel/composerxe-2011.3.174/bin/intel64/ifort x01f.f90 -o x01f -Wl,-rpath -Wl,/home/andrewn/plplot/install_dir/lib `PKG_CONFIG_PATH=/home/andrewn/plplot/install_dir/lib/pkgconfig pkg-config --cflags --libs plplotd-f95`"
    /opt/intel/composerxe-2011.3.174/bin/intel64/ifort x01f.f90 -o x01f -Wl,-rpath -Wl,/home/andrewn/plplot/install_dir/lib -I/home/andrewn/plplot/install_dir/include/plplot -I/home/andrewn/plplot/install_dir/lib/fortran/modules/plplot -L/home/andrewn/plplot/install_dir/lib -lplplotf95d -lplplotf95cd -lplplotd -lltdl -ldl -lm -lcsirocsa -lcsironn -lqhull -lqsastime

    ....which looks OK to me, and the .mod files are where the above says they are:

    > ls -l /home/andrewn/plplot/install_dir/lib/fortran/modules/plplot
    plplot_flt.mod plplot.mod plplotp.mod

  • Alan W. Irwin
    Alan W. Irwin

    You have confirmed that pkg-configure does deliver a -I option that points to the module location, and that location is populated with the module files. So that explains why gfortran works (where the -I option may be used to specify the module location). But I am wondering if some other compiler option than "-I" is required to specify module location in the ifort case.

  • Alan W. Irwin
    Alan W. Irwin

    p.s. I suggest you cut and paste the pkg-config output and try modifying specific flags (such as the -I option to specify module location) until you discover what works with your ifort compiler. Then we should be able to change our build system to accommodate that special ifort need.


  • Anonymous

    I had exactly the same problem.
    I fixed it by adding the "plplot_types.mod" file to the "$(INSTALL_DIR)/lib/fortran/modules/plplot" directory.
    (I found it in the "$(BUILD_DIR)/bindings/f95/" directory).

    Thanks to airwin for his suggestion, a little use of the "make -VERBOSE=1" command did the job.

    Last edit: Anonymous 2014-03-14