Compilation error, gfortran: error: unrecognized command line option ‘-nofor-main’; did you mean ‘-Wno-main’?

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
VSanger
Posts: 1
Joined: Tue Feb 07, 2023 2:33 pm

Compilation error, gfortran: error: unrecognized command line option ‘-nofor-main’; did you mean ‘-Wno-main’?

Post by VSanger » Wed Feb 08, 2023 4:55 am

Before configure, I've downloaded all libs in /lib/archive by "make -f Makefile.loc"
I'm trying to compile Yambo based on Intel Compiler+MKL+OpenMPI

here's my compile process

Code: Select all

export CC=icc
export FC=ifort
export F77=ifort

export MPICC=mpicc
export MPIFC=mpif90
export MPIF77=mpif77

export CFLAGS=-O3
export FCFLAGS=-O3
export FFLAGS=-O3

./configure \
--enable-memory-profile --disable-open-mp --enable-iotk \
--with-blas-libs="-lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-lapack-libs="-lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-blacs-libs="-lmkl_blacs_openmpi_lp64" \
--with-scalapack-libs="-lmkl_scalapack_lp64" \
--with-fft-libs="-mkl" \
--with-iotk-path="$HOME/soft/qe-7.1/S3DE/iotk"

make core
still it reports this

I'v read other similar error, knowing this might because gfortran and intel complier are used, but no idea how to solve this

Code: Select all

>>>[Making qe_pseudo]<<<
Warning #2216: '=' assumed following macro name "_libqe_pseudo" in command-line definition

make[2]: Entering directory '/project/hewenyingdi/software/yambo-5.0.4/lib/qe_pseudo'
creating folder /project/hewenyingdi/software/yambo-5.0.4//include//modules__HDF5_IO_MPI_TIMING
cd /project/hewenyingdi/software/yambo-5.0.4/lib/qe_pseudo; /project/hewenyingdi/software/yambo-5.0.4/sbin/moduledep.sh atom.o becmod.o constants.o kind.o parameters.o pseudo_types.o s_psi.o uspp.o              qe_auxdata.o invmat.o init_us_1.o init_us_2.o radial_grids.o ylmr2.o              us_module.o recvec.o spin_orb.o simpsn.o upf_to_internal.o upf.o              read_upf_v1.o read_upf_v2.o read_pseudo.o read_ncpp.o read_uspp.o struct_fact.o              sph_ind.o spinor.o sph_bes.o qvan2.o setqf.o matches.o erf.o allocate_nlpot.o              init_run.o qe_pseudo_module.o qe_errore.o addusdens.o sum_bec.o              d_matrix.o > /project/hewenyingdi/software/yambo-5.0.4/lib/qe_pseudo/make.dep
gfortran: error: unrecognized command line option ‘-nofor-main’; did you mean ‘-Wno-main’?
make[2]: *** [Makefile:221: kind.o] Error 1
make[2]: Leaving directory '/project/hewenyingdi/software/yambo-5.0.4/lib/qe_pseudo'
make[1]: *** [config/mk/actions/compile_yambo.mk:2: yambo] Error 2
make[1]: Leaving directory '/project/hewenyingdi/software/yambo-5.0.4'
yambo build failed
and here's other information

Code: Select all

mpif90 -v
mpif90 for the Intel(R) MPI Library 2021.2 for Linux*
Copyright 2003-2021, Intel Corporation.
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

User avatar
Davide Sangalli
Posts: 610
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: Compilation error, gfortran: error: unrecognized command line option ‘-nofor-main’; did you mean ‘-Wno-main’?

Post by Davide Sangalli » Wed Feb 08, 2023 10:14 am

Dear VSanger,
please add the signature to your user profile. It is a rule of the forum.

For the compilation, try *without* setting

Code: Select all

export CFLAGS=-O3
export FCFLAGS=-O3
export FFLAGS=-O3
Best,
D.
Davide Sangalli, PhD
CNR-ISM, Division of Ultrafast Processes in Materials (FLASHit) and MaX Centre
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

Post Reply