Page 1 of 1

Problem of " driver.c:99: multiple definition of `main' "

Posted: Mon Oct 24, 2011 12:37 pm
by souledge
Dear all
I am trying to compile Yambo-3.2.4-r.855. My configure was as:

Code: Select all

./configure --exec-prefix=/home/User/ProgramFiles/Yambo --prefix=/home/User/ProgramFiles/Yambo/LIBS --with-fftw=/usr/local/lib/libfftw3.a --with-mpi=/home/User/ProgramFiles/MPICH/lib/libmpich.a --with-libxc-lib=/home/User/ProgramFiles/LibXC/lib --with-libxc-include=/home/User/ProgramFiles/LibXC/include --with-p2y=4.0 --with-iotk=/home/User/ProgramFiles/Quantum-ESPRESSO/iotk FC=mpif90 LDFLAGS=-nofor_main
Then I obtained the configure result as:
#
# [VER] 3.2.4 r.855
#
# [SYS] linux@x86_64
# [SRC] /home/User/Download/yambo-3.2.4-r.855
# [BIN] /home/User/ProgramFiles/Yambo/LIBS/bin
# [FFT] FFTW Fast Fourier transform
#
# [ ] Double precision
# [X] Redundant compilation
# [X] MPI
# [X] PW (4.0) support
# [ ] ETSF I/O support
# [ ] SCALAPACK
# [X] LibXC
# [ ] NETCDF/HDF5/Large Files
# [XX ] Built-in BLAS/LAPACK/LOCAL
#
# [ CPP ] gcc -E -P
# [ C ] gcc -g -O2 -D_C_US -D_FORTRAN_US
# [MPICC] mpicc -g -O2 -D_C_US -D_FORTRAN_US
# [ F90 ] mpif90 -O
# [MPIF ] mpif90 -O
# [ F77 ] mpif90 -O
# [Cmain]
# [NoOpt] -O0
#
# [ MAKE ] make
# [EDITOR] vim
#
Finally, during compiling by make yambo, an error occurred:
make[1]: Entering directory `/home/User/Download/yambo-3.2.4-r.855/driver'
yambo_driver.F
driver.o: In function `main':
/home/User/Download/yambo-3.2.4-r.855/driver/driver.c:99: multiple definition of `main'
/home/User/intel/composer_xe_2011_sp1.6.233/compiler/lib/intel64/for_main.o:/export/users/nbtester/efi2linux_nightly/branch-12_1/20110812_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x0): first defined here
/home/User/intel/composer_xe_2011_sp1.6.233/compiler/lib/intel64/for_main.o: In function `main':
/export/users/nbtester/efi2linux_nightly/branch-12_1/20110812_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'
make[1]: *** [yambo] Error 1
make[1]: Leaving directory `/home/User/Download/yambo-3.2.4-r.855/driver'
make: *** [yambo] Error 2
I have checked the post: viewtopic.php?f=1&t=313, but I found I have used the parameter LDFLAGS=-nofor_main.
How could I solve this problem?
Any suggestion will be welcome.

Re: Problem of " driver.c:99: multiple definition of `main' "

Posted: Mon Oct 24, 2011 2:21 pm
by claudio
Dear GAO Zhe

if your mpif90 is in the your path try to configure yambo with the options:

./configure FC=ifort F77=ifort

cla

Re: Problem of " driver.c:99: multiple definition of `main' "

Posted: Mon Oct 24, 2011 5:36 pm
by souledge
Thank you, Claudio, for your kindly and quickly reply.
I tried to set FC=ifort, it works well. However, I'm eager to know whether I can use MPI once I compiled Yambo with FC=ifort?
I am using MPICH2, which was compiled by ifort.
Furthermore question. After compile by "make all", there were only four files, a2y, p2y, yambo, and ??(I forgot the name, sorry), have been copied to ~/ProgramFiles/Yambo/bin, which I setted as --prefix=~/ProgramFiles/Yambo/LIBS --exec-prefix=~/ProgramFiles/Yambo. And there was no rule for "make install". May I delete the directory ~/Download/yambo-3.2.4-r.855 and just use the four files?

Re: Problem of " driver.c:99: multiple definition of `main' "

Posted: Mon Oct 24, 2011 5:46 pm
by claudio
Dear GAO Zhe

>I tried to set FC=ifort, it works well. However, I'm eager to know whether I can use MPI once I compiled Yambo with FC=ifort?
>I am using MPICH2, which was compiled by ifort.

check after the configure if yambo found your MPI enviroment

# [ ] Double precision
# [X] Redundant compilation
# [X] MPI
# [X] PW (4.0) support
# [ ] ETSF I/O support
# [ ] SCALAPACK
# [ ] LibXC
# [X ] NETCDF/HDF5/Large Files
# [ X] Built-in BLAS/LAPACK/LOCAL

the MPI boxed has to be ticked

>Furthermore question. After compile by "make all", there were only four files, a2y, p2y, yambo, and ??(I forgot the name, sorry), have been copied to ~/ProgramFiles/Yambo/bin, which I setted as --prefix=~/ProgramFiles/Yambo/LIBS --exec-prefix=~/ProgramFiles/Yambo. And there was no rule for "make >install". May I delete the directory ~/Download/yambo-3.2.4-r.855 and just use the four files?

yes, you just need the executables: yambo, a2y, p2y, ypp

Cla