compilation error with intel ifort

Having trouble compiling the Yambo source? Using an unusual architecture? Problems with the "configure" script? Problems in GPU architectures? This is the place to look.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Forum rules
If you have trouble compiling Yambo, please make sure to list:
(1) the compiler (vendor and release: e.g. intel 10.1)
(2) the architecture (e.g. 64-bit IBM SP5)
(3) if the problems occur compiling in serial/in parallel
(4) the version of Yambo (revision number/major release version)
(5) the relevant compiler error message
Post Reply
Sumit
Posts: 20
Joined: Wed Jun 09, 2021 12:10 pm

compilation error with intel ifort

Post by Sumit » Sun Sep 05, 2021 3:54 am

Dear Community,

I am using UBUNTU 20.04 version on my machine. I downloaded Yambo from the link
https://github.com/yambo-code/yambo, and tried to compile it here. I followed steps:
./configure
make -j4 hdf5
make -j4 netcdf
make -j4 yambo

But in the last step, it showed error:

>>>[Linking yambo]<<<
make[1]: Entering directory '/home/cl01/Documents/setup/yambo-master/driver'

ld: driver.o: in function `main':
driver.c:(.text+0x0): multiple definition of `main'; /opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/for_main.o:for_main.c:(.text+0x0): first defined here
ld: /opt/intel/oneapi/compiler/2021.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/for_main.o: in function `main':
for_main.c:(.text+0x2e): undefined reference to `MAIN__'
make[1]: *** [Makefile:100: yambo] Error 1
make[1]: Leaving directory '/home/cl01/Documents/setup/yambo-master/driver'
make: *** [config/mk/actions/compile_yambo.mk:5: yambo] Error 2

Kindly figure out this and suggest to me the needful.

Thank You

Regards
Sumit Kukreti
PhD Scholar
IIT Jodhpur
India
You do not have the required permissions to view the files attached to this post.

andrea.ferretti
Posts: 206
Joined: Fri Jan 31, 2014 11:13 am

Re: compilation error with intel ifort

Post by andrea.ferretti » Sun Sep 05, 2021 8:39 am

Dear Sumit,

the problem you find is related a mismatch of the compilers and compiler flags
(compilers are intel, flags are gnu, we should probably investigate a bit why this happens).
In order to solve it, I would help the configure script to identify the proper environment, e.g. by issuing:

Code: Select all

./configure FC=ifort CC=icc  <other flags>
Just to give an example, here follows my own script to compile with intel on a local machine:

Code: Select all

MKLROOT=/opt/intel/compilers_and_libraries_2020.0.166/linux/mkl

./configure \
  FC=ifort \
  CC=icc \
  --with-fft-libs="-mkl" \
  --with-blas-libs="-L$MKLROOT -lmkl_intel_lp64  -lmkl_sequential -lmkl_core " \
  --with-lapack-libs="-L$MKLROOT -lmkl_intel_lp64  -lmkl_sequential -lmkl_core " \
  --with-scalapack-libs="-L$MKLROOT -lmkl_scalapack_lp64 " \
  --with-blacs-libs="-L$MKLROOT -lmkl_blacs_intelmpi_lp64 " \
  --with-iotk-path="/opt/iotk/y1.2.2-intel" \
  --with-libxc-path="/opt/libxc/2.2.3-intel" \
  --with-hdf5-path="/opt/hdf5/1.12.0-intel" \
  --with-netcdf-path="/opt/netcdf/4.7.4-hdf5-intel" \
  --with-netcdff-path="/opt/netcdff/4.5.2-hdf5-intel" \
  --enable-open-mp \
  --enable-time-profile \
  --enable-memory-profile \
  --enable-msgs-comps
best,
Andrea
Andrea Ferretti, PhD
CNR-NANO-S3 and MaX Centre
via Campi 213/A, 41125, Modena, Italy
Tel: +39 059 2055322; Skype: andrea_ferretti
URL: http://www.nano.cnr.it

Post Reply