Compile with ATC problem

Thanks.
But next problem.

Ubuntu 10.04, gcc 4.4.3 (last)
0) get last lammps pack
1) try make g++ ATC
[email protected]...:~/lammps-13Dec11/lib/atc$ make -f Makefile.g++
g++ -O -g -I../../src -DMPICH_IGNORE_CXX_SEEK -c ATC_HardyKernel.cpp
..
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
collect2: ld returned 1 exit status
make[1]: *** [../lmp_openmpi] Ошибка(error) 1
make[1]: Выход из каталога `/home/maks/lammps-9Nov11/src/Obj_openmpi'
make: *** [openmpi] Ошибка 2

2) try serial
[email protected]...:~/lammps-13Dec11/lib/atc$ make -f Makefile.serial
g++ -O -g -I../../src -I../../src/STUBS -c ATC_HardyKernel.cpp
g++ -O -g -I../../src -I../../src/STUBS -c ATC_Transfer.cpp
In file included from PhysicsModel.h:18,
from ATC_Transfer.h:12,
from ATC_Transfer.cpp:2:
Array2D.h: In member function ‘void Array2D<T>::write_restart(FILE*) const’:
Array2D.h:143: error: there are no arguments to ‘fwrite’ that depend on a template parameter, so a declaration of ‘fwrite’ must be available
Array2D.h:143: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Array2D.h:144: error: there are no arguments to ‘fwrite’ that depend on a template parameter, so a declaration of ‘fwrite’ must be available
make: *** [ATC_Transfer.o] Ошибка 1
[email protected]...:~/lammps-13Dec11/lib/atc$
3) do this with -fpermissive. It's done.
4) make yes-user-atc
5) make openmpi

verlet.o write_restart.o -latc -lfftw -lblas -llapack -lstdc++ -o ../lmp_openmpi
/usr/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status

6) do this:
user-atc_SYSINC =
user-atc_SYSLIB = -llapack -lblas -lgfortran #default was -lblas -llapack
user-atc_SYSPATH = -L/home/maks/lapack -L/home/maks/BLAS

but error as first:
..
verlet.o write_restart.o -latc -lfftw -llapack -lblas -lgfortran -lstdc++ -o ../lmp_openmpi
...
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
collect2: ld returned 1 exit status
make[1]: *** [../lmp_openmpi] Ошибка 1

14.12.2011, 22:08, "Templeton, Jeremy Alan" <[email protected]...>:

Thanks.
But next problem.

Ubuntu 10.04, gcc 4.4.3 (last)
0) get last lammps pack
1) try make g++ ATC
[email protected]...:~/lammps-13Dec11/lib/atc$ make -f Makefile.g++
g++ -O -g -I../../src -DMPICH_IGNORE_CXX_SEEK -c ATC_HardyKernel.cpp
..
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
collect2: ld returned 1 exit status
make[1]: *** [../lmp_openmpi] Ошибка(error) 1
make[1]: Выход из каталога `/home/maks/lammps-9Nov11/src/Obj_openmpi'
make: *** [openmpi] Ошибка 2

either use mpic++ or mpiCC (highly recommend) instead of g++
or add the proper include to get the MPI headers.
people not using the proper mpi compiler wrappers
is a very bad habit that has developed, since MPICH
was shipping with wrappers that were (and probably
still are) quite broken. the ones in OpenMPI however
work very will and should be used. you save yourself
a lot of trouble this way.

2) try serial
[email protected]...:~/lammps-13Dec11/lib/atc$ make -f Makefile.serial
g++ -O -g -I../../src -I../../src/STUBS -c ATC_HardyKernel.cpp
g++ -O -g -I../../src -I../../src/STUBS -c ATC_Transfer.cpp
In file included from PhysicsModel.h:18,
                 from ATC_Transfer.h:12,
                 from ATC_Transfer.cpp:2:
Array2D.h: In member function 'void Array2D<T>::write_restart(FILE*) const':
Array2D.h:143: error: there are no arguments to 'fwrite' that depend on a template parameter, so a declaration of 'fwrite' must be available
Array2D.h:143: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Array2D.h:144: error: there are no arguments to 'fwrite' that depend on a template parameter, so a declaration of 'fwrite' must be available
make: *** [ATC_Transfer.o] Ошибка 1
[email protected]...:~/lammps-13Dec11/lib/atc$
3) do this with -fpermissive. It's done.

but very wrong. you have a newer GCC installation
where the iostream header doesn't automatically
include the stdio header. this is an issue that was
reported repeatedly on this mailing list.

you need to modify Array.h and Array2D.h
to add the line:

#include<cstdio>

after:

#include<iostream>

4) make yes-user-atc
5) make openmpi

verlet.o write_restart.o -latc -lfftw -lblas -llapack -lstdc++ -o ../lmp_openmpi
/usr/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status

yup.

6) do this:
user-atc_SYSINC =
user-atc_SYSLIB = -llapack -lblas -lgfortran #default was -lblas -llapack
user-atc_SYSPATH = -L/home/maks/lapack -L/home/maks/BLAS

but error as first:
..
verlet.o write_restart.o -latc -lfftw -llapack -lblas -lgfortran -lstdc++ -o ../lmp_openmpi
...
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:68: undefined reference to `MPI_Allreduce(void*, void*, int, int, int, int)'
/home/maks/lammps-9Nov11/lib/atc/LammpsInterface.h:69: undefined reference to `MPI_Barrier(int)'
collect2: ld returned 1 exit status
make[1]: *** [../lmp_openmpi] Ошибка 1

that doesn't make sense, but could be a result of using -fpermissive

cheers,
    axel.

Maxim, have you built the serial mpi library in the src/STUBS directory? Also, we have had trouble with gcc 4.4.X used to build the mpi library at -O2 or greater. It seems the compiler was over-ambitious in its optimization for these cases. Either use a different gcc or rebuild your mpi install at the lower optimization.
Jeremy