[Wien] Compiling Wien2k with Intel Fortran 9.0 and MKL 7.2.1, seems it works (wo file)

Gerhard H Fecher fecher at uni-mainz.de
Tue Aug 30 12:46:59 CEST 2005


Dear Peter,
sorry but it seems someting went wrong with my e-mail, I did not intend to s p 
a m you.
This is the same version like I tried to post before, just without the 
at-tached siteconfig_lapw script. Let me know were I may send it.
Ciao
Gerhard


Dear Wien2k users,
I succeeded to compile and run Wien2k using the new Intel Fortran 9.0 
compiler.

For those who do not have a fully licensed but an unsupported (free) version 
of the Intel Compiler (and MKL), it may not be possible to download the older 
Versions. Newbies starting from scratch with Wien2k and Fortran thus may not 
be able to make use of the options given in the siteconfig script for the 
older Versions.

The installed Versions of ifort and MKL that I use are:
ifort 9.0.021
and
mkl 7.2.1.003
(in case of troubles, please check and report always which "small" .xxx 
Version you use, probably some libraries are changed between such small 
versions, and things you download tomorrow are different from those 
yesterday.)

After uninstalling all old Intel versions, I installed into the directories:
/intel/opt/fc90   (other than suggested by the install 
script /opt/intel/fc/9.0),
/intel/opt/mkl721 (is the directory if using the default suggestion of the 
install script /opt/intel).
Unfortunately the Intel install scripts are not that consistent about the 
install path.

LD_LIBRARY_PATH and environment variables have to be set accordingly !

I tested on an older PIV (without EMT64 or SS3 extensions) and a Pentium M 760 
(indeed not to calculate band structures but to play in the train) with 2 GB 
or 1GB RAM, respectively.
I tested on Linux Versions Suse 9.2 and Suse 9.3, both with the latest patches 
installed.

As already reported before, there are some problems (or at least differences) 
with the libraries needed to be given depending on the installed GNU Version 
and Linux distribution.

According to the processors used, I tested the compiler switches -xW, -xN, and 
-xB, for processor specific compilation and optimisation.

First of all, static linking works, but be aware to think that you can now 
transfer the program simply from one to another computer, this  may be only 
possible if you have identical (!) Linux versions installed (most probably 
that was the reason for Intel to claim static linking does not work with 8.0. 
You still receive a warning from the linker that is more than strange because 
a statically linked program should not need any dynamically libraries, as you 
can check with ldd). Even dynamically linking is different for different 
Linux Versions (at least for Suse distributions).

Second, here is a new option -i-static such that only Intel libraries are 
linked statically, but not the gnu ones. (Seems they start to learn from the 
disaster of different gnu versions and linux distributions). I tested and it 
works but ....

Note that the used dynamic (also if using -i-static) libraries will depend on 
how one sets the paths in the LD_LIBRARY_PATH variable, but not on the -L 
option for ld ! In case of troubles check the dynamically linked libraries 
with ldd and make sure that the used Intel libraries are compatible to the 
used gnu libraries !
If ld complains about some missing routines, check in which library file of 
your Linux distribution it is located and include this in the linker options 
(typical examples are libpthread or libpthread_nonshared). 

For Suse 9.2 and 9.3 I succeeded to have a running version with the following 
options.

a) Compiler (note -xX may be either -xW, -xN, -xB or similar depending on 
processor in use):
-FR -w -mp1 -prec_div -pc80 -pad -ip -xX

(most probably -prec_div (default off) and -pc80 (default on) are not needed 
because being included in -mp1, the compiler options manual is a little 
spongy about -prec_div, I have to read another time. However, one should 
avoid to confuse the compiler by use of reduntant or not existing options. At 
least do not wonder about strange results.)
 
b) Linker:
-L/opt/intel/fc90/lib -static -lguide -lsvml (-lpthread)
or
-L/opt/intel/fc90/lib -i-static -lguide -lguide_stats -lsvml (-lpthread)
or
-L/opt/intel/fc90/lib -lguide -lguide_stats -lsvml (-lpthread)

(One needs to give -L/opt/intel/fc90/lib because there one finds the 
libguide_stats, and it will not be found if only giving the path to MKL. One 
should avoid confusing the linker about unused or not existing options.)

c) BLAS-LAPACK:
-L/opt/intel/mkl721/lib/32 -lmkl_lapack -lmkl_ia32 -lguide -lguide_stats 
-lpthread

For Suse 9.3, there was no need to use the libpthread library thus you may 
drop the -lpthread, it is probably somewhere in the linker path.

The reason to give some libraries twice (in LDFLAGS and R_LIBS) is the 
behaviour of the Linux linker ld that needs to have the libraries given in a 
particular series. For example libmkl_lapack needs libguide and libmkl_ia32, 
so libguide and  libmkl_ia32 have to be given after libmkl_lapack otherwise 
the linker complains about missing routines. On the other hand, the 
libmkl_lapack is only needed in few make files, but libguide or libpthread 
may be needed in other subroutines without libmkl_lapack. Therefore some 
libraries are needed in LDFLAGS and as R_LIBS comes in the make files after 
LDFLAGS, one needs to give some libraries another time.

If you are running on AMD, be aware to assume the same will work. 

I at-tached a revised Version of siteconfig that has ifort 9.0 and MKL 7.2.1 
as 
option, it would be nice if someone can test it and report his experience. 
Please, use only the options you really need ! Note that the script does not 
know about your personal set up of Linux or the compiler or the MKL. If you 
have a different path for MKL you may need to change the script in order to 
find the *.a files.
I was able to run only short tests, so it still has to be checked if 
everything is fine with more complicated cases.
Hopefully there is someone to check the parallel switches that I was not able 
to do on my laptop.

If you have problems, note that it may depend on your Linux distribution. I 
was just able to test the two as mentioned above and I do not have any other 
installed.
In case you have troubles with the same distributions, be sure that they are 
not updated say from 9.1 to 9.2, in that case some old libraries or paths 
will have remained what causes a lot of troubles. I tried Suse 9.2 updated 
from 9.0 and received segmentation faults (ifort 8.1 mkl 7.2), after a 
complete new installation of 9.2 (on the same computer) everything was fine.

 
Finally some question:

1) is there anyone who tested the following compiler switches:
-ipo for optimisation between different object files
-fast that is a combination of -O3, -ipo, -static (one should probably use -mp 
(combination of -pc80, -prec_div, etc.) in order to maintain floating point 
precession).

2) is there anyone who has tried 9.0 with AMD processors

3) has anyone experience with the AMD performance libraries that may have 
better results than the MKL on AMD processors ?


I will try to write another short information how to install the combination 
of Intel compiler, MKL and Wien, but that may take some more days.

Ciao and good luck
Gerhard


More information about the Wien mailing list