Page 1 of 2

makefile problem during compilation

Posted: Tue Mar 15, 2011 6:15 pm
by souledge
I downloaded Yambo for QE(PWscf) and tried to compile it.
Configuring was done well, however, when I run "make all", an error occurred:
make[1]: Entering directory `/home/vm/PWscf/yambo/lib/slatec'
makefile: 66: *** segmentation is lost. STOP (This information was translated from other language)
make[1]: Leaving directory `/home/vm/PWscf/yambo/lib/slatec'
make: *** [libs] ERROR 2

I checked the file "makefile" in <Yambo>/lib/slatec, the objects, the *.o files' name behind objs = , have been seperated into several lines without '\', but when I checked another one which compiled sucessfully in Ubuntu 10.10 i686, all of objects just recorded in only one line. BTW, my OS is Red Hat Enterprise Linux 6 Server x86_64. The detialed information about my system shows below:
package_string = Yambo 3.2.1 r.448
cpu = x86_64
os = linux
debug = yes
make = make
ar = ar
arflags = -ru
cc = gcc
cflags = -O0 -D_C_US -D_FORTRAN_US
pcc = mpicc
pccflags = -O0 -D_C_US -D_FORTRAN_US
cpp = gcc -E
cppflags = -P
f90 = gfortran
f90flags = -O0
f90uflags =
f90suffix = .f90
pf90 = mpif90
pf90flags = -O0
f77 = gfortran
f77flags = -O0
f77uflags =
package_bugreport = yambo@yambo-code.org

How should I do to avoid such an error during compilation?

Re: makefile problem during compilation

Posted: Wed Mar 16, 2011 9:46 am
by andrea marini
Dear souledge,

first of all let me kindly ask you to fill your signature with your complete name and affiliation. We ask this to all users of the forum.

The problem you are encountering is, actually, not directly related to the "official" version of Yambo, but to the version that the PWscf team decided to include in their distribution. Unfortunately the interaction between the Makefile of Yambo and the one of PWscf is not straightforward.

I will contact the responsible of the PWscf distro to see if they can fix the problem.

In the meantime you can download the official version of Yambo from the qe-forge web-site where, if you also decide to register to the Yambo project, you will be able to access the SVN repo with the latest version of the code.

Please follow the instructions on the Yambo download page.

The official version of Yambo is constantly updated and it compiles with no problem and the interface with PWscf is perfectly working.

Andrea

Re: makefile problem during compilation

Posted: Tue Nov 25, 2014 6:01 pm
by martin.gmitra
Hi all,

I am encountering similar problem during compilation of yambo 3.4.1 r.3187 within latest espresso 5.1.1 dist.
Below is the error message. Any idea? I have to set configure option for my case, not sure if needed right now to be seen

Thanks in advance!

>>>[Making slatec]<<<
make[1]: Entering directory `/scratch1/gmm05126/CODES/espresso/espresso-5.1.1/yambo-3.4.1/lib/slatec'
Makefile:68: *** missing separator. Stop.
make[1]: Leaving directory `/scratch1/gmm05126/CODES/espresso/espresso-5.1.1/yambo-3.4.1/lib/slatec'
make: *** [libs] Error 2

Re: makefile problem during compilation

Posted: Tue Nov 25, 2014 6:14 pm
by myrta gruning
Dear Martin,

can you attach the Makefile? As well please provide us with all info's on compilers, architecture etc as in the forum rules.

Thanks
m

Re: makefile problem during compilation

Posted: Wed Nov 26, 2014 12:14 pm
by martin.gmitra
Dear Myrta,

The Makefile is attached. The architecture is an intel MPI cluster with PBS scheduling. I am using for this case gfortran compiler 4.7.2. Not tried with intel yet (expected a speedup by intel?) Below I am copying also the configure input.

Thanks!

./configure \
CPPFLAGS="-I/usr/lib/intel/mkl/include/ -I/usr/lib/intel/mkl/include/fftw" \
FCFLAGS="-I/usr/lib/intel/mkl/include/ -I/usr/lib/intel/mkl/include/fftw" \
PFC="mpif90" \
FC="mpif90" \
LIBS="-L/home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/YAMBO/lib/ -lxc" \
--with-p2y="5.0" \
--with-iotk="/home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/iotk" \
--with-blas="-L/usr/lib/intel/mkl/lib/intel64/ -lmkl_blas95_lp64 -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lpthread -lm" \
--with-lapack="-L/usr/lib/intel/mkl/lib/intel64/ -lmkl_lapack95_lp64 -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lpthread -lm" \
--with-blacs="-L/usr/lib/intel/mkl/lib/intel64/ -lmkl_blacs_openmpi_lp64 -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lpthread -lm" \
--with-scalapack="-L/usr/lib/intel/mkl/lib/intel64/ -lmkl_scalapack_lp64 -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lpthread -lm" \
--with-fftw="/home/gmm05126/scratch1/CODES/fftw3.3.4/lib/" \
--with-fftw-lib="/home/gmm05126/scratch1/CODES/fftw3.3.4/lib/libfftw3.a" \
--with-netcdf-include="/usr/include/" \
--with-netcdf-lib="/usr/lib/" \
--with-netcdf-link="-lnetcdff"



p.s. I am not sure if the attachment works thus the Makefile is here:
#
# Copyright (C) 2000-2013 A. Marini and the YAMBO team
# http://www.yambo-code.org
#
# This file is distributed under the terms of the GNU
# General Public License. You can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation;
# either version 2, or (at your option) any later version.
#
# This program is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330,Boston,
# MA 02111-1307, USA or visit http://www.gnu.org/copyleft/gpl.txt.
#
cpu = x86_64
os = linux
mpi = -D_MPI
netcdf = -D_NETCDF_IO
scalapack = -D_SCALAPACK
precision =
fft = -D_FFTW
xcpp = -D_NETCDF_IO -D_MPI -D_FFTW -D_SCALAPACK
debug = yes
do_blas = no
do_lapack = no
do_local = yes
do_p2y = yes
do_e2y = no
shell = /bin/bash
make = make
package_bugreport = yambo@yambo-code.org
prefix = /home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/YAMBO
exec_prefix = /home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/YAMBO
bindir = ${exec_prefix}/bin
libdir = /home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/YAMBO/lib
includedir = /home/gmm05126/scratch1/CODES/espresso/espresso-5.1.1/YAMBO/include
CFGFILES = config/setup config/Makefile config/report sbin/make_message.pl \
sbin/make_makefile.sh driver/codever.h src/wf_and_fft/sgfft.F \
src/external_c/.objects Makefile driver/version.h \
sbin/objects_debug.sh driver/editor.h
TARGETS = all yambo interfaces ypp
CLEANS = clean clean_all
INTERFCS = a2y p2y e2y
#
# Libraries (ordered for compiling & linking)
#
BASIC_LIBS = external_c modules xc_functionals parser communicate common io wf_and_fft

MAIN_LIBS = $(BASIC_LIBS) coulomb bz_ops qp_ctl setup interface \
tddft pol_function qp bse
#
# Interfaces
#
2YLIBS = external_c modules parser communicate common io bz_ops
#
# YPP
#
YPPLIBS = $(BASIC_LIBS) coulomb bz_ops qp_ctl setup interface interpolate pol_function bse
#
# PROJECTS
#
PROJECTS = yambo_surf ypp_surf yambo_kerr yambo_ph ypp_ph
PJ_SURFLIBS = $(BASIC_LIBS) surf_modules coulomb bz_ops qp_ctl surf setup interface tddft pol_function qp bse
YPPSURFLIBS = $(BASIC_LIBS) surf_modules bz_ops qp_ctl setup interface interpolate surf pol_function bse
EXE = $(TARGETS) $(PROJECTS)
#
nothing:
@$(make_message)
changelog:
svn log | perl sbin/svn2cl.pl > ChangeLog
all: $(TARGETS) $(PROJECTS)
libs:
@$(mklibxc)
@LIBS2DO="slatec"; DIR2GO="lib" ; $(mklib)
@if test "$(do_blas)" = yes ; then LIBS2DO="blas" ; \
DIR2GO="lib" ; $(mklib); fi
@if test "$(do_lapack)" = yes ; then LIBS2DO="lapack" ; \
DIR2GO="lib" ; $(mklib); fi
@if test "$(do_local)" = yes ; then LIBS2DO="local" ; \
DIR2GO="lib" ; $(mklib); fi
yambo: libs
@LIBS2DO="$(MAIN_LIBS)" ; $(mksrc)
@X2DO="yambo"; XPATH="driver";XLIBS="$(MAIN_LIBS)";$(mkx)
yambo_kerr: libs
@LIBS2DO="$(MAIN_LIBS)";ADF="-D_KERR"; $(mksrc)
@X2DO="yambo_kerr"; XPATH="driver";XLIBS="$(MAIN_LIBS)";ADF="-D_KERR";$(mkx)
yambo_surf: libs
@LIBS2DO="$(PJ_SURFLIBS)";ADF="-D_SURF"; $(mksrc)
@X2DO="yambo_surf"; XPATH="driver";XLIBS="$(PJ_SURFLIBS)";ADF="-D_SURF";$(mkx)
ypp_surf: libs
@LIBS2DO="$(YPPSURFLIBS)" ; ADF="-D_YPP_SURF";$(mksrc)
@X2DO="ypp_surf" ;XPATH="ypp";XLIBS="$(YPPSURFLIBS)"; ADF="-D_YPP_SURF";$(mkx)
yambo_ph: libs
@LIBS2DO="$(MAIN_LIBS)";ADF="-D_ELPH"; $(mksrc)
@X2DO="yambo_ph"; XPATH="driver";XLIBS="$(MAIN_LIBS)";ADF="-D_ELPH";$(mkx)
ypp_ph: libs
@LIBS2DO="$(YPPLIBS)";ADF="-D_ELPH"; $(mksrc)
@X2DO="ypp_ph" ;XPATH="ypp";XLIBS="$(YPPLIBS)"; ADF="-D_YPP_ELPH";$(mkx)
interfaces: libs
@LIBS2DO="$(2YLIBS)" ; $(mksrc)
@LIBS2DO="int_modules"; DIR2GO="interfaces" ; $(mklib)
@X2DO="a2y" ;XPATH="interfaces/a2y";XLIBS="$(2YLIBS)";$(mkx)
@if test "$(do_p2y)" = yes ; then X2DO="p2y" ; XPATH="interfaces/p2y" ; \
XLIBS="$(2YLIBS)"; ADF="-D_P2Y_V50"; $(mkx) ; fi
@if test "$(do_e2y)" = yes ; then X2DO="e2y" ; XPATH="interfaces/e2y" ; \
XLIBS="$(2YLIBS)" ; $(mkx) ; fi
ypp: libs
@LIBS2DO="$(YPPLIBS)" ; $(mksrc)
@X2DO="ypp" ;XPATH="ypp";XLIBS="$(YPPLIBS)";$(mkx)
#
clean: clean_fast
clean_fast:
@$(lib_xc_clean)
@$(objects_clean)
@$(lib_mod_clean)
@$(xclean)
clean_all:
@$(lib_xc_distclean)
@$(objects_clean)
@$(lib_mod_netcdf_clean)
@$(conf_clean)
@$(xclean)

# Functions
define make_message
echo;echo "YAMBO" 3.4.1 r.3187 targets;echo;\
for target in $(TARGETS); do echo " [stable] $$target" ; done;echo;\
for target in $(PROJECTS); do echo " [devel] $$target" ; done;echo;\
for target in $(UTILS); do echo " [util] $$target" ; done;echo
for target in $(CLEANS); do echo " [clean] $$target" ; done;echo
endef
define mksrc
for ldir in $$LIBS2DO; do \
if test ! -f "$(libdir)/lib$$ldir.a" || test "$(debug)" = yes ; \
then rm -f "$(libdir)/lib$$ldir.a" ; \
echo " " ; \
echo ">>>[Making $$ldir]<<<" ; \
./sbin/make_makefile.sh src/$$ldir lib$$ldir.a .objects l $(xcpp) $$ADF ; \
cd src/$$ldir ; $(make) VPATH=src/$$ldir || exit "$$?" ; cd ../../; fi \
done
endef
define mklibxc
if test ! -f "$(libdir)/libxc.a" ; then \
echo " " ; \
echo ">>>[Making libxc]<<<" ; \
cd $(libdir)/libxc ; $(make) -s VPATH=$(libdir)/libxc || exit "$$?" ; \
echo ">>>[Installing libxc]<<<" ; \
make -s install ; \
cd ../../; \
fi
endef
define mklib
for ldir in $$LIBS2DO; do \
if test ! -f "$(libdir)/lib$$ldir.a" ; \
echo " " ; \
echo ">>>[Making $$ldir]<<<" ; \
then ./sbin/make_makefile.sh $$DIR2GO/$$ldir lib$$ldir.a .objects l $(precision) $(xcpp) $$ADF ; \
cd $$DIR2GO/$$ldir ; $(make) VPATH=$$DIR2GO/$$ldir || exit "$$?" ; cd ../../; fi \
done
endef
define mkx
LLIBS="";for exe in $$XLIBS; do LLIBS="$$LLIBS -l$$exe" ; done ; \
for exe in $$X2DO; do \
echo " " ; \
echo ">>>[Linking $$exe]<<<" ; \
if test ! -f "$(bindir)/$$exe" || test "$(debug)" = yes ; \
then ./sbin/make_makefile.sh $$XPATH $$exe .objects x $$LLIBS $(xcpp) $$ADF ; \
cd $$XPATH ; $(make) VPATH=$$XPATH || exit "$$?" ; fi ; \
echo " " ; \
done
endef
define objects_clean
find . \( -name '*.o' -o -name 'Makefile' -o -name '*.f90' \
-o -name '*_cpp.f' -o -name 'ifc*' -o -name '__*' -o -name '*.s' \) \
-type f -print | grep -v '\.\/Makefile' | xargs rm -f
echo "[CLEAN] Objects ... done"
echo "[CLEAN] Broken files ... done"
echo "[CLEAN] Makefiles ... done"
if test "$(debug)" = yes ; then \
find . -name '.debug*' | xargs rm -fr ; \
echo "[CLEAN] Debug locks and directories ... done" ; \
fi
endef
define lib_xc_clean
cd $(libdir)/libxc; make -s clean; cd ../..
echo "[CLEAN] LibXC ... done"
endef
define lib_xc_distclean
cd $(libdir)/libxc; make -s distclean; cd ../..
rm -fr include/xc.h include/xc_config.h include/xc_funcs.h lib/pkgconfig/ libxc/autom4te.cache/
echo "[CLEAN] LibXC ... done"
endef
define lib_mod_clean
find . \( -name '*.a' -o -name '*.mod' \) -type f -print | \
grep -v netcdf | grep -v xc_ | grep -v iotk | grep -v typesize | grep -v libxc | xargs rm -f
echo "[CLEAN] Libraries ... done"
echo "[CLEAN] Modules ... done"
endef
define lib_mod_netcdf_clean
find . \( -name '*.a' -o -name '*.mod' \
-o -name 'netcdf*h' -o -name 'netcdf*inc' \) -type f -print | xargs rm -f
echo "[CLEAN] Libraries ... done"
echo "[CLEAN] Modules ... done"
echo "[CLEAN] NetCDF files ... done"
endef
define xclean
for exe in $(EXE); do rm -f $(bindir)/$$exe; done
for exe in $(INTERFCS); do rm -f $(bindir)/$$exe; done
echo "[CLEAN] Targets ... done"
endef
define conf_clean
rm -f $(CFGFILES)
rm -f config.status config.log
rm -fr autom4te.cache
echo "[CLEAN] Autoconf files ... done"
endef

Re: makefile problem during compilation

Posted: Wed Nov 26, 2014 12:55 pm
by myrta gruning
Hallo again

I would need the Makefile in the lib/slatec directory. Sorry for the wrong request. :roll:
Also you should try to upload the file as what I should check is where you have spaces instead of a TAB (Missing separator means usually that instead of a real TAB you have 8 spaces in the Makefile- you can also have a look yourself to see if you spot it).
I have already a fair idea of what the problem could be, so if you can attach the lib/slatec/Makefile I can try to fiw it asap.

Best
m

Re: makefile problem during compilation

Posted: Wed Nov 26, 2014 3:43 pm
by martin.gmitra
Yes you are right, there are spaces not a tabs! Where one needs to change it in a way to have the objects say in one line? This within the slatec folder compiles.

objs = avint.o xermsg.o fdump.o j4save.o xercnt.o xerhlt.o xerprn.o xersve.o i1mach.o xgetua.o polfit.o pcoef.o pvalue.o besj0.o besj1.o besk0.o cesk1.o csevl.o inits.o r1mach.o besi0.o besk0e.o besi1.o besk1e.o besi0e.o besi1e.o qage.o qag.o qk15.o qk21.o qk31.o qk41.o qk51.o qk61.o qpsrt.o qawo.o qawoe.o qc25f.o qelg.o qcheb.o qwgtf.o qk15w.o qwgtf.o sgtsl.o

Re: makefile problem during compilation

Posted: Wed Nov 26, 2014 4:25 pm
by myrta gruning
Hallo Martin

Please next time upload the attachments rather than cut and paste them. As I wrote problem can be tabs vs space. This cannot be seen from the cut&paste.
Furthermore such long texts are making the posts very difficult to follow.

Anyway, from what I can see I think you have a problem with the c preprocessor. Maybe it comes from your specification of the CPPFLAGS

My advice is to do a
make clean_all

and rerun the configure WITHOUT specifying the CPPFLAGS (as well I would not specify the FCFLAGS, it should not be needed to specify those includes. In this way you are overwriting optimization flags)
then try to do make yambo again.

if the problem persists then you can try to add
CPP='gcc -E'
to the configure and redo everything again

Hope it helps,
m

Re: makefile problem during compilation

Posted: Fri Nov 06, 2015 8:39 pm
by rjohns03
Hello all,

I am having this same problem while trying to build the latest yambo with gcc 4.8.3 on a Linux cluster.
I am using the SVN repo, checked out on 11/03/2015. I find this problem with the slatec Makefile in both the stable and devel branches.

I have tried the previous suggestion to clear CPPFLAGS, FCFLAGS and to then specify CPP='gcc -E'. Unfortunately, nothing has resolved this problem.

I can cd into lib/slatec, fix the Makefile by joining the offending lines and run make successfully, however, when I return to the Yambo source dir and rerun make, the incorrect Makefile is rewritten and the same error occurs.

Thank you for your help,

Ryan

Re: makefile problem during compilation

Posted: Fri Nov 06, 2015 9:36 pm
by myrta gruning
Hallo Ryan

I think the problem is with a change in the preprocessor behaviour in gcc 4.8, as described here:
https://gcc.gnu.org/gcc-4.8/porting_to.html

We had a similar problem when installing yambo on PCs for the students here. Our sysadmin solved it by specifying
FCCPP="/lib/cpp -ansi -C -ffreestanding"
(Would need to be changed on machines where cpp isn't in /lib/.)

in the configure. The reference suggests -P as a better option than -ffreestanding for non-C++ code, but it did not work for us.

Hope it works for you too, otherwise just let us know.

Best
m