Page 1 of 1

Compilation error of Yambo on Mac OSX

Posted: Sun Jun 07, 2020 9:00 am
by DavidPolito93
Good Morning,

I am a PhD student at Politecnico di Torino.
I have a Mac with operating system OS X 10.12.6 and I am trying to compile Yambo in its serial version on my pc with the following configuration keywords:

Code: Select all

./configure --enable-mpi="no" --with-blas-libs="/Users/davide/qe-6.5/LAPACK/libblas.a" --with-lapack-libs="/Users/davide/qe-6.5/LAPACK/liblapack.a" --with-iotk-path="/Users/davide/qe-6.5/S3DE/iotk"
The result of the compilation file is the following:

Code: Select all

checking for vim... vim
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking for malloc.h... (cached) no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking whether lstat correctly handles trailing slash... no
checking whether stat accepts an empty string... no
checking whether make sets $(MAKE)... yes
checking for the size of a pointer... 8 bytes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking build system type... i686-apple-darwin16.7.0
checking host system type... i686-apple-darwin16.7.0
checking for GNU make... make
checking for ar... ar
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking if the current OS is supported... yes
configure: WIDESETUP: using build_os="apple"
configure: WIDESETUP: using F90SUFFIX=".f90"
configure: WIDESETUP: using AR="ar"
configure: WIDESETUP: using AR_FLAGS="-ru"
checking for Fortran flag to compile .f90 files... none
checking for gfortran kind and version... gfortran GNU Fortran (GCC) 5.2.0 unknown
checking for specific gfortran flags... -O3 -g -mtune=native
checking for specific Open-MP flags... -fopenmp
checking for specific gcc flags... -O2
checking for specific unoptimized flags... -O0 -g -mtune=native
checking for specific NETCDF flags... -DgFortran
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0 -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0/../../.. -lgfortran -lquadmath -lm
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for external C routine (test) naming scheme... test_
checking for Fortran flag needed to accept free-form source... none
checking fortran 90 modules inclusion flag... -I
configure: testing C-preprocessor gcc -E -P -D_apple
checking if C precompiler works on C source... yes
configure: testing FC-preprocessor gfortran -E -P -cpp
checking if FC precompiler works on FC source... yes
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking if Fortran 77 compiler gfortran works... yes
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0 -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0/../../.. -lgfortran -lquadmath -lm
checking for caxpy in /Users/davide/qe-6.5/LAPACK/libblas.a... yes
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking for cheev in /Users/davide/qe-6.5/LAPACK/liblapack.a... yes
checking for dlaran_ in /Users/davide/qe-6.5/LAPACK/liblapack.a... no
checking for FFT... checking for FFT... Internal FFTW3
checking for dlopen in -ldl... yes
checking for deflate in -lz ... yes
checking for deflate in -lsz... no
checking for dlopen in -ldl... (cached) yes
checking for curl_version in -lcurl... yes
checking for cos in -lm... yes
checking for internal NetCDF library... to be compiled
checking for IOTK in /Users/davide/qe-6.5/S3DE/iotk... yes
checking for ETSF_IO Library... no
checking for libxc... Compatible external LibXC not found/specified. Internal to be compiled.
configure: creating ./config.status
config.status: creating config/setup
config.status: creating config/Makefile
config.status: creating config/report
config.status: creating src/wf_and_fft/sgfft.F
config.status: creating sbin/make_makefile.sh
config.status: creating sbin/objects_store.sh
config.status: creating driver/codever.h
config.status: creating driver/editor.h
config.status: creating src/external_c/.objects
config.status: creating include/c_defs.h
#
# [VER] 4.5.0 r.163
# 
# - GENERAL CONFIGURATIONS -
# 
# [SYS] apple@i686
# [SRC] /Users/davide/yambo
# [BRN] @Y_BRANCH@
# [TGT] /Users/davide/yambo
# [BIN] /Users/davide/yambo/bin
# [LIB] /Users/davide/yambo/lib/external
#
# [EDITOR] vim
# [ MAKE ] make
#
# [-] Double precision
# [X] Keep object files
# [X] Run-Time timing profile 
# [-] Run-Time memory profile 
#
# - SCRIPTS -
#
# [-] YDB: Yambo DataBase
# [-] YAMBOpy: Yambo Python scripts
# 
# - PARALLEL SUPPORT -
#
# [-] MPI
# [-] OpenMP
# 
# - LIBRARIES [E=external library; I?=internal library (c=to be compiled / f=found already compiled); X=system default; -=not used;] -
#
# > I/O: (NETCDF with large files support) 
#
# [ E ] IOTK    : /Users/davide/qe-6.5/S3DE/iotk/src/libiotk.a (QE no-hdf5-support)
#                 -I/Users/davide/qe-6.5/S3DE/iotk/src
# [ - ] ETSF_IO :  
#                  
# [ Ic] NETCDF  : /Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/lib/libnetcdff.a /Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/lib/libnetcdf.a -lm -lcurl
#                 -I/Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/include -I/Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/include
# [ - ] HDF5    : 
#                 
#
# > MATH: (Internal FFTW3) 
#
# [ Ic] FFT       : /Users/davide/yambo/lib/external/gfortran/gfortran/lib/libfftw3.a
#                   -I/Users/davide/yambo/lib/external/gfortran/gfortran/include/
# [ E ] BLAS      : /Users/davide/qe-6.5/LAPACK/libblas.a
# [ E ] LAPACK    : /Users/davide/qe-6.5/LAPACK/liblapack.a
# [ - ] SCALAPACK :  
# [ - ] BLACS     : 
# [ - ] PETSC     :  
#                    
# [ - ] SLEPC     :  
#                    
#
# > OTHERs
#
# [ Ic] LibXC     : /Users/davide/yambo/lib/external/gfortran/gfortran/lib/libxcf90.a /Users/davide/yambo/lib/external/gfortran/gfortran/lib/libxc.a
#                   -I/Users/davide/yambo/lib/external/gfortran/gfortran/include
# [ - ] MPI       :  
#                   
#
# - COMPILERS -
#
# FC kind = gfortran GNU Fortran (GCC) 5.2.0
# MPI kind= 
#
# [ CPP ] gcc -E -P -D_apple   -D_FFTW       -D_TIMING    
# [ FPP ] gfortran -E -P -cpp   -D_FFTW       -D_TIMING   
# [ CC  ] gcc -O2 -D_C_US -D_FORTRAN_US
# [ FC  ] gfortran -O3 -g -mtune=native    
# [ FCUF] -O0 -g -mtune=native 
# [ F77 ] gfortran -O3 -g -mtune=native 
# [ F77U] -O0 -g -mtune=native 
# [Cmain] 
#
However when I do "make yambo", the compilation fails at this point with the following error:

Code: Select all

>>>[Linking yambo]<<<
cd /Users/davide/yambo/driver; /Users/davide/yambo/sbin/moduledep.sh yambo_driver.o > /Users/davide/yambo/driver/make.dep
yambo_driver.F 
/Users/davide/yambo/driver/getopt.c:694:6: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                   else
                   ^
1 warning generated.

ld: warning: ignoring file /Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/lib/libnetcdff.a, file was built for archive which is not the architecture being linked (x86_64): /Users/davide/yambo/lib/external/gfortran/gfortran/v3/serial/lib/libnetcdff.a
Undefined symbols for architecture x86_64:
  "___netcdf_MOD_nf90_close", referenced from:
      ___io_m_MOD_io_disconnect in libmodules.a(mod_IO.o)
  "___netcdf_MOD_nf90_create", referenced from:
      _io_connect_ in libio.a(io_connect.o)
  "___netcdf_MOD_nf90_def_dim", referenced from:
      ___io_m_MOD_netcdf_dim in libmodules.a(mod_IO.o)
  "___netcdf_MOD_nf90_def_var_manydims", referenced from:
      _def_variable_bulk_ in libio.a(def_variable_bulk.o)
      _def_variable_elemental_ in libio.a(def_variable_elemental.o)
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
  "___netcdf_MOD_nf90_def_var_onedim", referenced from:
      _io_elemental_ in libio.a(io_elemental.o)
  "___netcdf_MOD_nf90_enddef", referenced from:
      _def_variable_bulk_ in libio.a(def_variable_bulk.o)
      _def_variable_elemental_ in libio.a(def_variable_elemental.o)
      _io_bulk_ in libio.a(io_bulk.o)
      _io_connect_ in libio.a(io_connect.o)
      _io_elemental_ in libio.a(io_elemental.o)
  "___netcdf_MOD_nf90_get_var_1d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_1d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_get_var_1d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_get_var_1d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_1d_text", referenced from:
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_get_var_2d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_2d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_2d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_2d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_2d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_3d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_3d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_3d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_3d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_3d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_4d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_4d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_4d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_4d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_4d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_5d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_5d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_5d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_6d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_6d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_7d_fourbytereal", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_get_var_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_get_var_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_get_var_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_inq_dimid", referenced from:
      ___io_m_MOD_netcdf_dim in libmodules.a(mod_IO.o)
  "___netcdf_MOD_nf90_inq_varid", referenced from:
      ___io_m_MOD_variable_exist in libmodules.a(mod_IO.o)
      _def_variable_bulk_ in libio.a(def_variable_bulk.o)
      _def_variable_elemental_ in libio.a(def_variable_elemental.o)
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
  "___netcdf_MOD_nf90_inquire", referenced from:
      ___io_m_MOD_netcdf_file_is_open in libmodules.a(mod_IO.o)
      ___io_m_MOD_io_disconnect in libmodules.a(mod_IO.o)
  "___netcdf_MOD_nf90_inquire_variable", referenced from:
      ___io_m_MOD_netcdf_call in libmodules.a(mod_IO.o)
      _def_variable_bulk_ in libio.a(def_variable_bulk.o)
      _io_bulk_ in libio.a(io_bulk.o)
  "___netcdf_MOD_nf90_open", referenced from:
      _io_connect_ in libio.a(io_connect.o)
  "___netcdf_MOD_nf90_put_var_1d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_1d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_1d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_1d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_1d_text", referenced from:
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_2d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_2d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_2d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_2d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_2d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_3d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_3d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_3d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_3d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_3d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_4d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_4d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_4d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_4d_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_4d_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_5d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_5d_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_5d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_6d_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_6d_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_7d_fourbytereal", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_eightbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_fourbyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_fourbytereal", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
      _io_variable_elemental_ in libio.a(io_variable_elemental.o)
  "___netcdf_MOD_nf90_put_var_onebyteint", referenced from:
      _io_bulk_ in libio.a(io_bulk.o)
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_put_var_text", referenced from:
      _io_variable_bulk_ in libio.a(io_variable_bulk.o)
  "___netcdf_MOD_nf90_redef", referenced from:
      _def_variable_bulk_ in libio.a(def_variable_bulk.o)
      _def_variable_elemental_ in libio.a(def_variable_elemental.o)
      _io_bulk_ in libio.a(io_bulk.o)
      _io_elemental_ in libio.a(io_elemental.o)
  "___netcdf_MOD_nf90_strerror", referenced from:
      ___io_m_MOD_netcdf_call in libmodules.a(mod_IO.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [yambo] Error 1
make: *** [yambo] Error 2
It seems to be a problem with the netcdf library, but I cannot understand why... It actually looks like that the compilation of that library has been performed successfully, but in the end when it links it it doesn't recognize the architecture.

Can you help me?

Sincerely,
Davide Romanin
-----------------------------------------------------
PhD student in Physics XXXIII cycle
Representative of the PhD students in Physics
Applied Science and Technology department (DiSAT)
Politecnico di Torino
Corso Duca degli Abruzzi, 24
10129 Torino ITALY
------------------------------------------------------

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jun 08, 2020 7:41 am
by Daniele Varsano
Dear Davide,
compilation on Mac can be problematic, and the problem you are facing is not uncommon.
I successfully compiled the code on Mac using the configuration script below:

Note: here some libs were previously compiled (libxc,ext_lib), anyway they will be downloaded and compiled by yambo.
About NETCDF I have linked to library installed via homebrew (https://brew.sh)
brew install netcdf.

Not guaranteed it will work but you can have a try.

I append here also a comment by Fulvio Paleari who faced and solved the problem:
So, it was a combination of two issues, namely: [1] impossibility to compile the internal netcdf library and [2] impossibility to link external netcdf libraries.

TL;DR: better to always rely on external libraries when compiling yambo on a mac laptop with no "module load" system. See details below.

Issue [1] seems to be due, according to Davide, to an Autoconf setting which automatically searches for versions of the needed libraries in your system despite the specific options given to configure. Then, it would compile the internal hdf5, then find an external netcdf, then try to compile netcdf-fortran creating various conflicts. There might be no easy solution for this.

Issue [2] was just due to the fact that the configure didn't find the hdf5.mod file in the external include directory, which prevented use of both hdf5 and netcdf. Recompiling carefully the external libraries with the same compilers used for yambo and enabling fortran and parallel compilation for hdf5 fixed the problem.

Best,
Daniele


Code: Select all

NETCDFF_LIB="-L/usr/local/lib -lnetcdff"
NETCDF_LIB="-L/usr/local/lib -lnetcdf"
HDF5_LIB="-L/usr/local/lib -lhdf5_fortran -lhdf5_hl -lhdf5"
#
NETCDF_INC="/usr/local/include"
NETCDFF_INC="/usr/local/include"
HDF5_INC="/usr/local/include"
LIBXC_PATH=/Users/daniele/codes/yambo/branches/4.5/lib/external/gfortran/mpifort
EXT_LIB="/Users/daniele/codes/yambo/branches/4.5/lib/external/gfortran/mpifort/lib"
EXT_PATH="/Users/daniele/codes/yambo/branches/4.5/lib/external"

./configure \
--with-netcdf-libs="$NETCDF_LIB" --with-netcdf-includedir="$NETCDF_INC" \
--with-netcdff-libs="$NETCDFF_LIB" --with-netcdff-includedir="$NETCDFF_INC" \
--with-hdf5-libs="$HDF5_LIB" --with-hdf5-includedir="$HDF5_INC" \
--with-libxc-path="$LIBXC_PATH" \
--with-blas-libs="-L$EXT_LIB -lblas" \
--with-lapack-libs="-L$EXT_LIB -llapack" \
--with-extlibs-path="$EXT_PATH"

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jun 08, 2020 8:55 am
by DavidPolito93
Dear Daniele,

thank you for your rapid reply! :)

However I still find an error. This times it stops when compiling the netcdf:

Code: Select all

ld: warning: ignoring file ../liblib/.libs/libnetcdf.a, file was built for archive which is not the architecture being linked (x86_64): ../liblib/.libs/libnetcdf.a
Undefined symbols for architecture x86_64:
  "_nc_close", referenced from:
      _close_netcdf in genlib.o
  "_nc_create", referenced from:
      _define_netcdf in genlib.o
  "_nc_def_dim", referenced from:
      _define_netcdf in genlib.o
  "_nc_def_var", referenced from:
      _define_netcdf in genlib.o
  "_nc_enddef", referenced from:
      _define_netcdf in genlib.o
  "_nc_inq_libvers", referenced from:
      _main in main.o
  "_nc_put_att_double", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_att_float", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_att_int", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_att_schar", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_att_short", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_att_text", referenced from:
      _define_netcdf in genlib.o
  "_nc_put_vara_double", referenced from:
      _load_netcdf in load.o
  "_nc_put_vara_float", referenced from:
      _load_netcdf in load.o
  "_nc_put_vara_int", referenced from:
      _load_netcdf in load.o
  "_nc_put_vara_schar", referenced from:
      _load_netcdf in load.o
  "_nc_put_vara_short", referenced from:
      _load_netcdf in load.o
  "_nc_put_vara_text", referenced from:
      _load_netcdf in load.o
  "_nc_set_fill", referenced from:
      _define_netcdf in genlib.o
  "_nc_strerror", referenced from:
      _define_netcdf in genlib.o
      _close_netcdf in genlib.o
      _check_err in genlib.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [ncgen3] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [package-ready-stamp] Error 2
make: *** [ext-libs] Error 2
Indeed, I did as you suggested. So I provided the addresses of the precompiled libraries in my Mac (I used macport to install them):

Code: Select all

NETCDFF_LIB="-L/opt/local/lib -lnetcdff"
NETCDF_LIB="-L/opt/local/lib -lnetcdf"
HDF5_LIB="-L/opt/local/lib -lhdf5_fortran -lhdf5_hl -lhdf5"
NETCDF_INC="/opt/local/include"
NETCDFF_INC="/opt/local/include"
HDF5_INC="/opt/local/include"
LIBXC_PATH="/Users/davide/yambo-master/lib/external/gfortran/mpifort"
EXT_LIB="/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib"
EXT_PATH="/Users/davide/yambo-master/lib/external"
I checked and in such folders I do have them:

Code: Select all

libnetcdf_c++.a , libnetcdff.a , libhdf5.a , libhdf5_cpp.a , libhdf5_hl.a , libhdf5_hl_cpp.a
hdf5.h , hdf5_hl.h , netcdf.h (etc.)
#
./configure --with-netcdf-libs="$NETCDF_LIB" --with-netcdf-includedir="$NETCDF_INC" --with-netcdff-libs="$NETCDFF_LIB" --with-netcdff-includedir="$NETCDFF_INC" --with-hdf5-libs="$HDF5_LIB" --with-hdf5-includedir="$HDF5_INC" --with-libxc-path="$LIBXC_PATH" --with-blas-libs="-L$EXT_LIB -lblas" --with-lapack-libs="-L$EXT_LIB -llapack" --with-extlibs-path="$EXT_PATH" --with-iotk-path="/Users/davide/qe-6.5/S3DE/iotk"
And the configure file this time is:

Code: Select all

checking for vim... vim
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking for malloc.h... (cached) no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking whether lstat correctly handles trailing slash... no
checking whether stat accepts an empty string... no
checking whether make sets $(MAKE)... yes
checking for the size of a pointer... 8 bytes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking build system type... i686-apple-darwin16.7.0
checking host system type... i686-apple-darwin16.7.0
checking for GNU make... make
checking for ar... ar
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking if the current OS is supported... yes
configure: WIDESETUP: using build_os="apple"
configure: WIDESETUP: using F90SUFFIX=".f90"
configure: WIDESETUP: using AR="ar"
configure: WIDESETUP: using AR_FLAGS="-ru"
checking for Fortran flag to compile .f90 files... none
checking for gfortran kind and version... gfortran GNU Fortran (GCC) 5.2.0 unknown
checking for specific gfortran flags... -O3 -g -mtune=native
checking for specific Open-MP flags... -fopenmp
checking for specific gcc flags... -O2
checking for specific unoptimized flags... -O0 -g -mtune=native
checking for specific NETCDF flags... -DgFortran
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0 -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin14/5.2.0/../../.. -lgfortran -lquadmath -lm
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for external C routine (test) naming scheme... test_
checking for Fortran flag needed to accept free-form source... none
checking fortran 90 modules inclusion flag... -I
configure: testing C-preprocessor gcc -E -P -D_apple
checking if C precompiler works on C source... yes
configure: testing FC-preprocessor gfortran -E -P -cpp
checking if FC precompiler works on FC source... yes
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking if Fortran 77 compiler gfortran works... yes
checking for mpiifort... no
checking for mpifort... mpifort
checking for a working mpif.h... yes
checking for mpifort... no
checking for mpifort... mpifort
checking for mpiicc... no
checking for mpicc... mpicc
checking for a working mpi.h... yes
checking for MPI version... Open MPI v4.0.1, package: Open MPI, ident: 4.0.1, repo rev: v4.0.1, Mar 26, 2019
checking for /opt/local/include/openmpi-mp/mpif.h... yes
checking how to get verbose linking output from mpifort... -v
checking for Fortran 77 libraries of mpifort...  -L/opt/local/lib -L/opt/local/lib/openmpi-mp -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin16/7.5.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin16/7.5.0/../../.. -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lquadmath -lm
checking for caxpy in -L/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib -lblas... yes
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking for cheev in -L/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib -llapack... yes
checking for dlaran_ in -L/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib -llapack... no
checking for FFT... checking for FFT... Internal FFTW3
checking for dlopen in -ldl... yes
checking for deflate in -lz ... yes
checking for deflate in -lsz... no
checking for dlopen in -ldl... (cached) yes
checking for curl_version in -lcurl... yes
checking for cos in -lm... yes
checking for NetCDF Library using -L/opt/local/lib -lnetcdf... yes
checking for HDF5 using -L/opt/local/lib -lhdf5_fortran -lhdf5_hl -lhdf5... checking for internal NETCDF+HDF5 library... to be compiled
checking for IOTK in /Users/davide/qe-6.5/S3DE/iotk... yes
checking for ETSF_IO Library... no
checking for libxc... Compatible external LibXC not found/specified. Internal to be compiled.
configure: creating ./config.status
config.status: creating config/setup
config.status: creating config/Makefile
config.status: creating config/report
config.status: creating src/wf_and_fft/sgfft.F
config.status: creating sbin/make_makefile.sh
config.status: creating sbin/objects_store.sh
config.status: creating driver/codever.h
config.status: creating driver/editor.h
config.status: creating src/external_c/.objects
config.status: creating include/c_defs.h
#
# [VER] 4.5.0 r.163
# 
# - GENERAL CONFIGURATIONS -
# 
# [SYS] apple@i686
# [SRC] /Users/davide/yambo-master
# [BRN] @Y_BRANCH@
# [TGT] /Users/davide/yambo-master
# [BIN] /Users/davide/yambo-master/bin
# [LIB] /Users/davide/yambo-master/lib/external
#
# [EDITOR] vim
# [ MAKE ] make
#
# [-] Double precision
# [X] Keep object files
# [X] Run-Time timing profile 
# [-] Run-Time memory profile 
#
# - SCRIPTS -
#
# [-] YDB: Yambo DataBase
# [-] YAMBOpy: Yambo Python scripts
# 
# - PARALLEL SUPPORT -
#
# [X] MPI
# [-] OpenMP
# 
# - LIBRARIES [E=external library; I?=internal library (c=to be compiled / f=found already compiled); X=system default; -=not used;] -
#
# > I/O: (NETCDF with large files support) 
#
# [ E ] IOTK    : /Users/davide/qe-6.5/S3DE/iotk/src/libiotk.a (QE hdf5-support)
#                 -I/Users/davide/qe-6.5/S3DE/iotk/src
# [ - ] ETSF_IO :  
#                  
# [ Ic] NETCDF  : /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libnetcdff.a /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libnetcdf.a
#                 -I/Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/include -I/Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/include
# [ Ic] HDF5    : /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libhdf5hl_fortran.a /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libhdf5_fortran.a /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libhdf5_hl.a /Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/lib/libhdf5.a -lz -lm -ldl -lcurl
#                 -I/Users/davide/yambo-master/lib/external/gfortran/mpifort/v4/serial/include
#
# > MATH: (Internal FFTW3) 
#
# [ Ic] FFT       : /Users/davide/yambo-master/lib/external/gfortran/mpifort/lib/libfftw3.a
#                   -I/Users/davide/yambo-master/lib/external/gfortran/mpifort/include/
# [ E ] BLAS      : -L/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib -lblas
# [ E ] LAPACK    : -L/Users/davide/yambo-master/lib/external/gfortran/mpifort/lib -llapack
# [ - ] SCALAPACK :  
# [ - ] BLACS     : 
# [ - ] PETSC     :  
#                    
# [ - ] SLEPC     :  
#                    
#
# > OTHERs
#
# [ Ic] LibXC     : /Users/davide/yambo-master/lib/external/gfortran/mpifort/lib/libxcf90.a /Users/davide/yambo-master/lib/external/gfortran/mpifort/lib/libxc.a
#                   -I/Users/davide/yambo-master/lib/external/gfortran/mpifort/include
# [ E ] MPI       : -L/opt/local/lib/openmpi-mp -lmpi 
#                   -I/opt/local/include/openmpi-mp 
#
# - COMPILERS -
#
# FC kind = gfortran GNU Fortran (GCC) 5.2.0
# MPI kind= Open MPI v4.0.1, package: Open MPI, ident: 4.0.1, repo rev: v4.0.1, Mar 26, 2019
#
# [ CPP ] gcc -E -P -D_apple -D_HDF5_LIB -D_MPI -D_FFTW       -D_TIMING    -D_P2Y_QEXSD_HDF5
# [ FPP ] gfortran -E -P -cpp -D_HDF5_LIB -D_MPI -D_FFTW       -D_TIMING   
# [ CC  ] mpicc -O2 -D_C_US -D_FORTRAN_US
# [ FC  ] mpifort -O3 -g -mtune=native    
# [ FCUF] -O0 -g -mtune=native 
# [ F77 ] mpifort -O3 -g -mtune=native 
# [ F77U] -O0 -g -mtune=native 
# [Cmain] 
#
Davide

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jun 08, 2020 11:35 am
by Daniele Varsano
Dear Davide,
Unfortunately for some reason the architecture is not recognized, I solved the problem by using homebrew netcdf avoiding to compile them by hand. Maybe Fulvio can give you advise on that.
Daniele

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jun 08, 2020 1:06 pm
by palful
Ciao Davide,

I see that even in your latest attempt the netcdf external libraries are not recognized. We should try and link them and see what happens.

In my case, the problem was broadly related to the fact that the hdf5.mod file was missing in /opt/local/include, which caused the configure to reject both netcdf and hdf5.

Since everything in your system is installed with macports (this is also my case), I post below a list of operations that I performed which solved the problem for me.
Beware that it includes (re)installing compilers (a certain version of them) and all their dependencies.
Also: some of the operations in the list might be redundant/unneeded to solve the issue (I didn't try to recompile yambo after every single one of them), if you are able to figure out a more efficient route please let me know! :)

So these are the steps I followed:
[1] Decided to use macports (which installs stuff in /opt/local)
[2] Uninstalled hdf5, netcdf, netcdf-fortran, gccX that I had previously installed with macports
[3] Installed gcc9 (sudo port install gcc9 +gfortran)
[4] Installed openmpi-gcc9 (sudo port install openmpi-gcc9)
[5] Used the commands "sudo port select --set gcc mp-gcc9" and "sudo port select --set mpi opempi-gcc9-fortran" and then also added /opt/local/bin to my PATH in the .profile file. All of this is to make sure that gcc, gfotran, mpicc when you configure yambo actually point to the gcc9 compilers I just installed and not some default Mac stuff.
[6] Installed hdf5 with the correct options. This is the crucial step to make it work: "sudo port install hdf5 +gfortran +openmpi"
[7] Installed netcdf ("sudo port install netcdf +gfortran +netcdf4 +openmpi") and netcdf-fortran ("sudo port install netcdf-fortran +gfortran +openmpi") with similar options.
[8] Reinstalled libxc ("sudo port install libxc") to make it work with gcc9, otherwise it would be broken in the yambo configure.
[9] Reinstalled Quantum Espresso giving to the configure the correct flags for compilers especially for the newly compiled hdf5. This is necessary because iotk needs to be compiled with hdf5 support, otherwise yambo will not accept it.
[10] Finally, updated my install.sh script for yambo (that contains all the options to configure - I can post it if you want to compare with yours) and ran the configure.

And here a streamlined list of the specific commands for quick reference:

Code: Select all

sudo port uninstall netcdf-fortran
sudo port uninstall netcdf
sudo port uninstall hdf5
sudo port install gcc9 +fortran
sudo port install openmpi-gcc9
sudo port select --set gcc mp-gcc9
sudo port select --set mpi openmpi-gcc9-fortran
Edit .profile:

Code: Select all

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
Then back at it:

Code: Select all

sudo port install hdf5 +gfortran +openmpi +hl
sudo port install netcdf +gfortran +openmpi +netcdf4
sudo port install netcdf-fortran +gfortran +openmpi
sudo port install libxc
Compile quantum espresso in its directory (needed otherwise yambo will throw an hdf5-related iotk error during compilation...):

Code: Select all

./configure CC=gcc MPIF90=mpif90 LIBDIRS="/opt/local/lib" \
            --with-hdf5="/opt/local/lib"
Finally compile yambo

I hope this can be helpful. Feel free to reply if something is unclear, and let us know if it works!

Cheers,
Fulvio

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jun 22, 2020 2:05 pm
by DavidPolito93
Dear Fulvio,

sorry for my belated answer, but I didn't manage to do it before!
Unfortunately, I was not able to compile it yet... all of the steps before have been done successfully, but still Yambo doesn't find the libraries... I don't know at this point...

Anyway, on the other hand I managed to compile it on the cluster! So I think I'll use it there :)

But I will try to see if I can force the compilation somehow, if I mange I will let you know!

Thank you all again for your support :)

Davide

-----------------------------------------------------
PhD student in Physics XXXIII cycle
Representative of the PhD students in Physics
Applied Science and Technology department (DiSAT)
Politecnico di Torino
Corso Duca degli Abruzzi, 24
10129 Torino ITALY
------------------------------------------------------

Re: Compilation error of Yambo on Mac OSX

Posted: Fri Aug 07, 2020 3:52 pm
by svenreichardt
Dear Davide,

In case you are still having errors during the compilation on your Mac, you could try following the procedure laid out in Fulvio's post above, but instead of installing the "gfortran" variant of the libraries with MacPorts, try installing the gcc8 variant (i.e., replace +gfortran with +gcc8 in Fulvio's code snippets).
This solved the problem for me, as for some reason Fulvio's solution didn't happen to work on my Mac.

After reading the description of the port variants in MacPorts, I got the impression that "gfortran" triggers compilation with the gfortran from gcc10, and that somehow never worked for me.
So I cleanly uninstalled everything (libraries, QuantumEspresso, yambo) and installed everything from scratch as recommended by Fulvio in his post above, making sure to always install the gcc8 variant for every single port/library, which finally worked in the end.

In case it helps, here are the configure scripts I used for the QuantumEspresso and yambo compilations:

Configure QuantumEspresso 6.5:

Code: Select all

./configure FC=mpif90 CC=mpicc \
  BLAS_LIBS="-L/opt/local/lib -lopenblas" \
  LAPACK_LIBS="-L/opt/local/lib -lopenblas" \
  FFT_LIBS="-L/opt/local/lib -lfftw3" \
  --with-hdf5="/opt/local"
Configure yambo 4.5.2:

Code: Select all

./configure FC=gfortran MPIFC=mpif90 CC=gcc MPICC=mpicc \
  --without-editor \
  --with-iotk-path="/Users/sven.reichardt/Software/qe-6.5/iotk" \
  --with-hdf5-path="/opt/local" \
  --with-netcdf-path="/opt/local" \
  --with-libxc-path="/opt/local" \
  --with-fft-path="/opt/local" \
  --with-blas-libs="-L/opt/local/lib -lopenblas" \
  --with-lapack-libs="-L/opt/local/lib -lopenblas"
Hope that helps you!

Re: Compilation error of Yambo on Mac OSX

Posted: Sun Jun 13, 2021 10:13 am
by sitangshu
Hi!

Using the last nice snippets, I tried to install yambo 5.0.2 on my mac:
1. It seems that gcc9 or gcc8 never worked for me. Instead gcc11 worked.
2. I tried to install QE6.5, didn't work with gcc11. QE6.6 partly worked, fortunately iotk library is resolved.
3. Coming back to yambo 5.0.2, all the dependencies are are now resolved. I configured with this (log file attached):
$ ./configure FC=gfortran MPIFC=mpif90 CC=gcc MPICC=mpicc --without-editor --with-iotk-path=/Users/sitangshu/software/q-e-qe-6.6/iotk --with-hdf5-path=/opt/local --with-netcdf-path=/opt/local --with-libxc-path=/opt/local --with-fft-path=/opt/local --with-blas-libs=-L/opt/local/lib -lopenblas --with-lapack-libs=-L/opt/local/lib -lopenblas

Most of the binaries are now got installed in the bin. But at the end, a catastrophe happened while the binary ypp_rt was being made:

Code: Select all

>>>[Making el-ph]<<<
<command-line>: warning: ISO C99 requires whitespace after the macro name
Saving objects in .objects__lock_HDF5_LIB_HDF5_IO_FFTW_TIMING_YPP_ELPH
cd /Users/sitangshu/software/yambo-5.0.2/ypp/el-ph; /Users/sitangshu/software/yambo-5.0.2/sbin/moduledep.sh  > /Users/sitangshu/software/yambo-5.0.2/ypp/el-ph/make.dep
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
	ar -m [-TLsv] archive file ...
	ar -m [-abiTLsv] position archive file ...
	ar -p [-TLsv] archive [file ...]
	ar -q [-cTLsv] archive file ...
	ar -r [-cuTLsv] archive file ...
	ar -r [-abciuTLsv] position archive file ...
	ar -t [-TLsv] archive [file ...]
	ar -x [-ouTLsv] archive [file ...]
make[2]: *** [arcreate] Error 1
make[1]: *** [ypp_rt] Error 2
ypp_rt build failed
Any solution?

Regards,
Sitangshu

Re: Compilation error of Yambo on Mac OSX

Posted: Mon Jan 24, 2022 11:35 am
by Davide Sangalli
This should have been fixed with this commit:
https://github.com/yambo-code/yambo/com ... a4bdc1c11c

Best,
D.