[CPMD-list] A missing library?

Axel Kohlmeyer axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Sat May 28 17:30:03 CEST 2005


On Sat, 28 May 2005, Carl Krauthauser wrote:

CK> Greetings!

CK> I am attempting to compile CPMD 3.9-1 using IFC 8.1 and gcc 3.2.3 on a 
CK> RHEL 3.5, dual Athlon machine.  My Makefile settings go as:

carl,

first off, you should upgrade to cpmd-3.9.2 and since you are using
an updated intel fortran 8.1 compiler, you should also apply the
patch i just send to cpmd-list.

CK> #QMMM_FLAGS = -D__QMECHCOUPL
CK> #QMMM_LIBS  = -L. -lmm
CK> FFLAGS = -c -r8 -w90 -w95 -O3 -pc64 -tpp6

for a (hopefully) faster executable, please try: 
FFLAGS=-c -r8 -w90 -w95 -O2 -unroll -pc64 -tpp6

CK> LFLAGS = -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c 
CK> -L/usr3/library/atlas/3.6.0/05272005/gcc-3.2.3-49-ifort-8.1.28/library 
CK> -llapack -lf77blas -latlas -lsvml -Vaxlib -static $(QMMM_LIBS)

-lsvml is not needed here.

[...]

CK> At the final linking, I get two types of errors that go as:
CK> 
CK> /opt/intel_fc_81/lib/libifcore.a(for_open_proc.o)(.text+0x3826): In 
CK> function `for__compute_filename':
CK> : Using 'getpwnam' in statically linked applications requires at runtime 
CK> the shared libraries from the glibc version used for linking
CK> 
CK> The first looks like a warning, however, a disturbing one in that I 
CK> thought a statically linked compiler option meant that all necessary 

well, this is a result of an 'improvement' in the design of GNU libc-2.
this is an important issue for people compiling package programs
on current linux machines, so i'll give a somewhat longer explanations.
even a statically linked glibc-2 binary (i.e. all current linux binaries)
will _always_ read some dynamical shared object, e.g. for accessing
password/userid information. this has the consequence, that fully
static binaries are will cease to work if the ABI (i.e. the binary
interface) of that specific library call changes. so fully static
binaries will only work on a limited range of installations. so 
you have to link glibc dynamically. in this case, your binaries will
work even on newer installations, since glibc includes a mechanism
to support several ABIs for a specific library call.

OTOH, for a dynamical binary you have to install the (too) many 
shared libraries bundled with the intel compiler everywhere. 
also not a nice thing. the best resolution is thus to create a
semi-static binary, in which only libc, libm, and optionally libpthread
are linked dynamically, but the rest statically. the latest updates
to the intel 8.1 compiler contain a new flag, -i-static, which will
just do that. 

there is just one final problem. if you want to have a binary that works
on the largest variation of platforms, you have to pick the oldest
available installation (best a redhat 7.3 installation, since this
is what intel uses to compile the ifort compiler), since old shared
libraries are supported on newer installations, but not the other
way around. :-/

you can find some additional info around the intel compiler on linux at:
http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-linux.html#mkl

CK> and
CK> 
CK> /usr3/library/atlas/3.6.0/05272005/gcc-3.2.3-49-ifort-8.1.28/library/liblapack.a(dgesv.o)(.text+0x9c): 
CK> In function `dgesv_':
CK> : undefined reference to `atl_f77wrap_dgesv_'
CK> 

CK> libraries are linked at compile time.  The second error looks like a 
CK> missing library needed for the ATLAS libraries I created.  Anyone have 
CK> any thoughts as to what the missing library (or libraries) it might be?

despite the directory name, your libatlas.a binary was obviously compiled
with the g77 interface and the lapack with the intel interface.
you can save a lot of effort by picking up a suitable binary from:
http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-linux.html#atlas
these binaries have been specifically tuned with CPMD in mind.
since you have a dual athlon machine, please note, that there are
some issues with the athlon specific instructions, so you you are
probably better off picking up the p3 binary (the performance
difference should be quite small, since a p3 and an athlon are
quite similar architectures as far as ATLAS is concerned).


best regards,
	axel.
CK> 
CK> Thanks for all your help, and have a great day!
CK> 
CK> 
CK> Best Regards,
CK> Carl Krauthauser
CK> _______________________________________________
CK> CPMD-list mailing list
CK> CPMD-list at cpmd.org
CK> http://cpmd.org/mailman/listinfo/cpmd-list
CK> 
CK> 

-- 

=======================================================================
Dr. Axel Kohlmeyer   e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.




More information about the CPMD-list mailing list