[lammps-users] Package ATC buliding problems!

Dear lammps users!

I was trying to bulid the lammps-4Dec10 with the atc package on redhat 6.0.

I built the libatc.a successfully. When I tried to compile Lammps, I got following errors:

/kunshou/fftw/fftw_215_install/lib -o …/lmp_linux

/usr/lib/libblas.a(xerbla.o): In function `xerbla_’:

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined reference to `_gfortran_st_write’

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined reference to `_gfortran_string_len_trim’

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined reference to `_gfortran_transfer_character’

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined reference to `_gfortran_transfer_integer’

………………

It seems that something is wrong with the blas library I was using, which confused me a lot. The atc package are written in c++ and uses

the blas, while lapack libraries are written in fortran. Or I have used the wrong version of lapack libraries( lapack-3.3.0 currently).

What I do???

Thanks

hi
� I think what you have is a linker error, meaning the linker (“ln”) can’t match symbols for functions in the various libs it is trying to connect. Is it possible that you didn’t use the same gfortran to compile lapack/blas as you did for lammps?
� The only functions that ATC needs are these (in MatrixDef.h)
extern “C”
{
extern void dgemv_(char*,int*,int*,double*,const double*,int*,const double*,int ,double,double*,int*);
extern void dgemm_(char*,char*,int*,int*,int*,double*,const double*,int*,const double*,int*,double*,double*,int*);
extern void dgetrf_(int*,int*,double*,int*,int*,int*);
extern void dgetri_(int*,double*,int*,int*,double*,int*,int*);
extern void dgecon_(char*,int*,double*,int*,double*,double*,double*,int*,int*);
extern double dlange_(char*,int*,int*,const double*,int*,double*);
extern double dsygvd_(int*,char*,char*,int*,double*,int*,double*,int*,double*,double*,int*,int*,int*,int*);
};
which are fortran functions treated as C functions. If you can get a small test program in C++ to compile with one of these you would probably learn what went wrong.
�� Also, if you have access to the intel Math Kernel Library you can use this instead by defining “MKL” in the compilation of ATC.
�� Lastly, do you really mean RH6.0 from the late 90s?
Reese

Dear lammps users!

I was trying to bulid the lammps-4Dec10 with the atc package on redhat 6.0.

i assume this is referring to the recently released red hat enterprise
linux, right?

I built the libatc.a successfully. When I tried to compile Lammps, I got
following errors:

/kunshou/fftw/fftw_215_install/lib -o ../lmp_linux

/usr/lib/libblas.a(xerbla.o): In function `xerbla_':

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined
reference to `_gfortran_st_write'

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined
reference to `_gfortran_string_len_trim'

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined
reference to `_gfortran_transfer_character'

/home/kunshou/app sources/lapack-3.3.0/BLAS/SRC/xerbla.f:39: undefined
reference to `_gfortran_transfer_integer'

……………..

It seems that something is wrong with the blas library I was using, which
confused me a lot. The atc package are written in c++ and uses

your BLAS library has been compiled with gfortran and thus the resulting
lammps binary requires to be linked with the gfortran runtime library
libgfortran.
if you build and link fortran binaries with gfortran, this is done
automatically.
however lammps requires to be linked with the c++ compiler and thus you
have to link with libgfortran explicitly. most of the time, just
adding -lgfortran
to the linker flags in your makefile should do the trick.

check out the documentation for building lammps with support for the reax
forcefield, which is also a fortran library and thus would require -lgfortran if
the reax library is built with gfortran.

hope that helps,
     axel.