Problem in installation of Qbox in Ubuntu 20.04

Qbox installation issues
Forum rules
You must be a registered user to post in this forum. Registered users may also post new topics if they consider that their subject do not correspond to any topic already present on the forum.
Post Reply
rajorshi
Posts: 1
Joined: Fri May 13, 2022 9:17 am

Problem in installation of Qbox in Ubuntu 20.04

Post by rajorshi »

Dear All,

I am trying to install Qbox code in my Ubuntu 20.04 machine and g++ - 9.4.0. I am using the gcc_atlas.mk build file provided in the build directory. I have installed all the libraries required and have provided the paths to them in the .mk file. However, I still get the following error-

/usr/bin/ld: /home/rajorshi/Downloads/scalapack-2.2.0/libscalapack.a(pxerbla.o): undefined reference to symbol '_gfortran_transfer_integer_write@@GFORTRAN_8'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgfortran.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:65: qb] Error 1

The .mk file I have used is as follows:

# gcc_atlas.mk
PLT=Linux_x8664
SCALAPACKDIR = $(HOME)/Downloads/scalapack-2.2.0
XERCESCDIR=$(HOME)/Downloads/xerces-c-3.2.3/src/.libs
ATLASDIR=/usr/lib/x86_64-linux-gnu/atlas

PLTOBJECTS = readTSC.o
SVN_VER :=$(shell svnversion -n)
DFLAGS += -DSVN_VERSION='"$(SVN_VER)"'

CXX=mpicxx
LD=$(CXX)

PLTFLAGS += -DIA32 -D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 -DUSE_MPI -DSCALAPACK -DADD_ \
-DAPP_NO_THREADS -DXML_USE_NO_THREADS -DUSE_XERCES \
-DMPICH_IGNORE_CXX_SEEK

# FFT must be FFTW2, FFTW3, ESSL or NOLIB
FFT=FFTW2

ifeq ($(FFT),FFTW2)
PLTFLAGS += -DUSE_FFTW2
PLTFLAGS += -DFFTWMEASURE
FFTWDIR=$(HOME)/Downloads/fftw-2.1.5/fftw
FFTWINCLUDEDIR=$(FFTWDIR)
FFTWLIBDIR=$(FFTWDIR)/.libs
INCLUDE += -I$(FFTWINCLUDEDIR)
LIBPATH += -L$(FFTWLIBDIR)
LIBS += -lfftw
endif

ifeq ($(FFT),FFTW3)
PLTFLAGS += -DUSE_FFTW3
PLTFLAGS += -DFFTWMEASURE
#PLTFLAGS += -DFFTW_TRANSPOSE
PLTFLAGS += -DFFTW3_2D
FFTWDIR=$(HOME)/software/fftw/fftw-3.3.4
FFTWINCLUDEDIR=$(FFTWDIR)/api
FFTWLIBDIR=$(FFTWDIR)/.libs
INCLUDE += -I$(FFTWINCLUDEDIR)
LIBPATH += -L$(FFTWLIBDIR)
LIBS += -lfftw3
endif

ifeq ($(FFT),ESSL)
$(error ESSL library not available)
endif

ifeq ($(FFT),NOLIB)
PLTFLAGS += -DFFT_NOLIB
endif

INCLUDE += -I$(XERCESCDIR)/include

CXXFLAGS= -g -O3 -Wunused -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

LIBPATH += -L$(XERCESCDIR)/lib \
-L$(ATLASDIR) -L$(SCALAPACKDIR) -L/usr/lib64

LIBS += -lpthread -lxerces-c -lscalapack -llapack -lf77blas -latlas

LDFLAGS = $(LIBPATH) $(LIBS)

Can anyone help me solve this issue ? I thank you in advance
fgygi
Site Admin
Posts: 167
Joined: Tue Jun 17, 2008 7:03 pm

Re: Problem in installation of Qbox in Ubuntu 20.04

Post by fgygi »

Hello,

From the error message, it seems that it misses symbols from the gfortran library. It may be resolved by adding -lgfortran to your link line, after "-latlas".

In case this is still not working, I include below another arch file that was used on an Ubuntu platform. The packages to be installed are listed at the beginning of the file.

Please let me know if you still have problems.

Francois

Code: Select all

#-------------------------------------------------------------------------------
#
# Copyright (c) 2008-2019 The Regents of the University of California
#
# This file is part of Qbox
#
# Qbox is distributed under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
# See the file COPYING in the root directory of this distribution
# or <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------------
#
#  ubuntu.mk
#
#-------------------------------------------------------------------------------
# Prerequisites: 
# On a Ubuntu-18.04.1 LTS system, install the following packages:
# sudo apt-get install libxerces-c-dev
# sudo apt-get install libopenmpi-dev openmpi-bin
# sudo apt-get install liblapack-dev
# sudo apt-get install fftw3 libfftw3-dev
# sudo apt-get install libscalapack-openmpi-dev
# sudo apt-get install uuid-dev
#
#-------------------------------------------------------------------------------
 PLT=Linux_x8664
#-------------------------------------------------------------------------------

 PLTOBJECTS = readTSC.o

 CXX=mpicxx
 LD=$(CXX)

 PLTFLAGS += -DIA32 -D_LARGEFILE_SOURCE \
             -D_FILE_OFFSET_BITS=64 -DUSE_MPI -DSCALAPACK -DADD_ \
             -DAPP_NO_THREADS -DXML_USE_NO_THREADS -DUSE_XERCES \
             -DXERCESC_3 -DMPICH_IGNORE_CXX_SEEK -DUSE_UUID

# FFT must be FFTW2, FFTW3, ESSL or NOLIB
 FFT=FFTW3

ifeq ($(FFT),FFTW2)
 PLTFLAGS += -DUSE_FFTW2
#PLTFLAGS += -DFFTWMEASURE
#FFTWDIR=$(HOME)/software/fftw/Linux_x8664/fftw-2.1.5/fftw
#FFTWINCLUDEDIR=$(FFTWDIR)
#FFTWLIBDIR=$(FFTWDIR)/.libs
#INCLUDE += -I$(FFTWINCLUDEDIR)
#LIBPATH += -L$(FFTWLIBDIR)
 LIBS += -lfftw
endif

ifeq ($(FFT),FFTW3)
 PLTFLAGS += -DUSE_FFTW3
#PLTFLAGS += -DFFTWMEASURE
#PLTFLAGS += -DFFTW_TRANSPOSE
 PLTFLAGS += -DFFTW3_2D
#FFTWDIR=$(HOME)/software/fftw/fftw-3.3.4
#FFTWINCLUDEDIR=$(FFTWDIR)/api
#FFTWLIBDIR=$(FFTWDIR)/.libs
#INCLUDE += -I$(FFTWINCLUDEDIR)
#LIBPATH += -L$(FFTWLIBDIR)
 LIBS += -lfftw3
endif

ifeq ($(FFT),ESSL)
$(error ESSL library not available)
endif

ifeq ($(FFT),NOLIB)
 PLTFLAGS += -DFFT_NOLIB
endif

 CXXFLAGS= -g -O3 -Wunused -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)
 LIBS += -lpthread -lxerces-c -lscalapack-openmpi -llapack -lblas -luuid
 LDFLAGS = $(LIBPATH) $(LIBS)

#-------------------------------------------------------------------------------
Post Reply