Mint build

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
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Mint build

Post by mgoldey »

I could use a hand sorting out what is going wrong with my build here.

I built and linked using the makefile at end, but the resulting executable does not work. Should be a trivial fix, but I don't understand how I'm linking against a dynamic library for pthreads, and I can't find a static one.

Error is as follows

Code: Select all

[qbox] <cmd>species oxygen O_HSCV_PBE-1.0.xml</cmd>
  SpeciesCmd: defining species oxygen as O_HSCV_PBE-1.0.xml
*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0x8
[ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f1fb5b30340]
[ 1] ../../src/qb() [0x4319c0]
[ 2] ../../src/qb() [0x42a5a9]
[ 3] ../../src/qb() [0x47d292]
[ 4] ../../src/qb() [0x479ec2]
[ 5] ../../src/qb() [0x414f3d]
[ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f1fb43f9ec5]
[ 7] ../../src/qb() [0x415fdf]
*** End of error message ***
XERCES, FFTW, LAPACK, SCALAPACK, BLACS installed via apt-get in Linux Mint, Intel MKL included, mpicxx references gnu compilers

Code: Select all

PLTOBJECTS = readTSC.o

CXX = mpicxx
LD = mpicxx

PLTFLAGS = -DUSE_MPI -DSCALAPACK -DADD_
PLTFLAGS += -DUSE_XERCES
PLTFLAGS += -DUSE_FFTW -DPTHREAD
PLTFLAGS += -D_LARGEFILE64_SOURCE  -D_FILE_OFFSET_BITS=64 -DAPP_NO_THREADS -DXML_USE_NO_THREADS

INCLUDE = -I/usr/include

CXXFLAGS= -O3 $(INCLUDE) $(PLTFLAGS) $(DFLAGS) -g -openmp  -pthread

LDFLAGS = $(LIBPATH) $(LIBS) -g
LIBPATH =

LIBS =  -Bstatic -L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64  \
         -lmkl_sequential -lmkl_core -lmkl_blacs_openmpi_lp64   \
         -lmkl_lapack95_lp64 -lm -lpthread -static-libgcc \
         -lfftw \
         -lxerces-c -luuid
Last edited by mgoldey on Wed Sep 24, 2014 3:16 am, edited 1 time in total.
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Re: Mint build

Post by mgoldey »

GDB has isolated where this is occurring.

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
Species::initialize (this=this@entry=0xa56580, rcpsval=rcpsval@entry=1.5) at Species.C:65
65	  const int np = vps_[0].size();
fgygi
Site Admin
Posts: 150
Joined: Tue Jun 17, 2008 7:03 pm

Re: Mint build

Post by fgygi »

A few questions:
Which version of Xerces-C does apt-get install?
Is it essential to make a static build?
Is the Intel compiler available on that platform?
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Re: Mint build

Post by mgoldey »

fgygi wrote:A few questions:
Which version of Xerces-C does apt-get install?
Is it essential to make a static build?
Is the Intel compiler available on that platform?
It's Xerces-C 3.1
No, dynamic should be fine.
Intel compilers are available.
fgygi
Site Admin
Posts: 150
Joined: Tue Jun 17, 2008 7:03 pm

Re: Mint build

Post by fgygi »

Try to add the following macro definition to the makefile:

Code: Select all

-DXERCESC_3
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Re: Mint build

Post by mgoldey »

Solution found:
Using intel compilers, with fftw as installed by apt-get
XERCES-C 2.8 compiled under $XERCESCROOT
using

Code: Select all

cd $XERCESCROOT/src/xercesc
./runConfigure -plinux -cicc -xicpc -minmem -nsocket -tnative -rpthread -l-m64 -z-m64 -b64 -s
Adding to .bashrc

Code: Select all

export XERCESCROOT=$HOME/Programs/xerces-c-src_2_8_0
export OMPI_CC=icc
export OMPI_CXX=icpc
Makefile is

Code: Select all

 PLTOBJECTS = readTSC.o

 XERCESCDIR = $(XERCESCROOT)
 FFTWDIR =/usr

 CXX=mpicxx
 LD=$(CXX)

 OPT = -O3  -ipo
 OMP = -openmp

 PLTFLAGS += $(OPT) $(OMP) -DIA32 -DUSE_FFTW -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

 INCLUDE = -I$(FFTWDIR)/include -I$(XERCESCDIR)/include

 CXXFLAGS= -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

 LIBPATH = -L$(XERCESCDIR)/lib -L$(FFTWDIR)/lib  -L$(MKLROOT)/lib/intel64

 LIBS =  $(OMP) -lxerces-c  -lfftw \
         -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_core \
         -lmkl_intel_thread -lmkl_blacs_openmpi_lp64 -lpthread -lm

 LDFLAGS = $(LIBPATH) $(LIBS)
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Re: Mint build

Post by mgoldey »

Updated for 1.60.4, change -DUSE_FFTW to -DUSE_FFTW3

Code: Select all

 PLTOBJECTS = readTSC.o

 XERCESCDIR = $(XERCESCROOT)
 FFTWDIR =/usr

 CXX=mpicxx
 LD=$(CXX)

 OPT = -O3  -ipo
 OMP = -openmp

 PLTFLAGS += $(OPT) $(OMP) -DIA32 -DUSE_FFTW3 -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

 INCLUDE = -I$(FFTWDIR)/include -I$(XERCESCDIR)/include

 CXXFLAGS= -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

 LIBPATH = -L$(XERCESCDIR)/lib -L$(FFTWDIR)/lib  -L$(MKLROOT)/lib/intel64

 LIBS =  $(OMP) -lxerces-c  -lfftw \
         -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_core \
         -lmkl_intel_thread -lmkl_blacs_openmpi_lp64 -lpthread -lm

 LDFLAGS = $(LIBPATH) $(LIBS)
mgoldey
Posts: 14
Joined: Tue Sep 23, 2014 10:26 pm

Re: Mint build

Post by mgoldey »

Updated for 1.62.3, intel 16.0.0.

I ran into some odd conflicts between intelmpi and openmpi, primarily in linking and running (MKL couldn't find the MPI libraries necessary). Embarrassingly, I am unsure quite how I resolved these conflicts, but the following Makefile compiles, links, and runs fine.

Code: Select all

 PLTOBJECTS = readTSC.o

 XERCESCDIR = $(XERCESCROOT)
 FFTWDIR =/opt/fftw3
 MPIDIR=/opt/openmpi
 CXX=mpicxx
 LD=$(CXX)


 OPT = -O3  
 OMP = -qopenmp -liomp5

 PLTFLAGS += $(OPT) $(OMP) -DIA32 -DUSE_FFTW3 -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

 INCLUDE = -I$(FFTWDIR)/include -I$(XERCESCDIR)/include -I${MKLROOT}/include

 CXXFLAGS= -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

 LIBPATH = -L$(XERCESCDIR)/lib -L$(FFTWDIR)/lib  -L$(MKLROOT)/lib/intel64 -L$(MPIDIR)/lib

 LIBS =  $(OMP) -lxerces-c  -lfftw3  \
		 -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 \
		 -lmkl_cdft_core -lmkl_intel_lp64 -lmkl_core \
		 -lmkl_intel_thread -lmkl_blacs_intelmpi_lp64 -lpthread -lm         
 LDFLAGS = $(LIBPATH) $(LIBS)
Post Reply