Page 1 of 1

compilation error with intel ifort

Posted: Sun Sep 05, 2021 3:54 am
by Sumit
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

Re: compilation error with intel ifort

Posted: Sun Sep 05, 2021 8:39 am
by andrea.ferretti
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