LIGGGHTS 3.6.0 compilation error

Submitted by MiRa on Wed, 01/18/2017 - 10:37

Hello everyone,

when trying to compile the newly released 3.6.0 on my 64 bit Ubuntu, I get the following error message:

In file included from ../dump_mesh.cpp:43:0:
../dump:mesh.h:52:29: fatal error: vtkSmartPointer.h: cannot find file or folder
compilation terminated.

I tried to compile using:

make clean-all
make fedora

Furthermore, I unsuccessfully tried to compile using:
make clean-all
make auto

Does anyone know what the problem could be?

Best regards,
MiRa

aaigner's picture

aaigner | Wed, 01/18/2017 - 11:30

Hello MiRa!

I fixed the problem with this hotfix.
Just pull and recompile and everything should work.

I am sorry for that inconvenience.
Kind regards,
Andreas

MiRa | Wed, 01/18/2017 - 12:09

Hi Andreas,

thank you for your quick response. Now the compilation worked.

Kind regards,
MiRa

z3490628 | Tue, 08/22/2017 - 07:34

Hi all,

I have tried to install 3.6.0 into my ubuntu16.04. When I try to type "make fedora" in my /src directory, it displayed (Makefile:87: recipe for target 'fedora' failed
make: *** [fedora] Error 1). Can you please help me with that?

Thanks,
Josh

arnom's picture

arnom | Tue, 08/22/2017 - 09:20

It is strongly recommended that you use 3.7.0 and then use "make auto" in your /src directory. It should work out of the box if you follow the documentation (2.2)

DCS team member & LIGGGHTS(R) core developer

z3490628 | Tue, 08/22/2017 - 10:21

Hi Arnom,

Yea, I have realised that and I have used "make auto". If I have to add those commands like "-DLAMMPS_JPEG -DLAMMPS_PNG" as mentioned in 2.2.3 step 4. Which makefile shall I edit? Makefile.mpi or Makefile.serial?

Thanks,
Josh

arnom's picture

arnom | Tue, 08/22/2017 - 15:43

If you have used "make auto" successfully before I suggest that you modify your Makefile.user. There you will find a MPI_CCFLAGS_USR variable where you can append stuff like -DLAMMPS_JPEG. (Note that if you want really -DLAMMPS_JPEG then just switch USE_JPG to "ON" in Makefile.user

DCS team member & LIGGGHTS(R) core developer

z3490628 | Tue, 08/22/2017 - 17:30

Hi Arnom,

After I have made all the changes, do I have to use the command 'make clean-all' and then followed by 'make auto' again? As the document mentioned I have to re-compile it if I made the -D change.

Thanks,
Josh

govind | Wed, 08/09/2017 - 16:29

Hi,

I am compiling in debug mode with command "make ubuntuVTK_debug" but it doesn't result instead giving an error :

/usr/bin/ld: dump_mesh.o: undefined reference to symbol '_ZN20vtkPolyDataAlgorithm9GetOutputEv'
//usr/lib/x86_64-linux-gnu/libvtkCommonExecutionModel-6.2.so.6.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:95: recipe for target '../lmp_ubuntuVTK_debug' failed
make[1]: *** [../lmp_ubuntuVTK_debug] Error 1
make[1]: Leaving directory '/home/dhiraj/LIGGGHTS-PUBLIC-master/src/Obj_ubuntuVTK_debug'
Makefile:87: recipe for target 'ubuntuVTK_debug' failed

Can anyone help me to sort out this issue? I want to debug the LIGGGHTS code.

Govind

j-kerbl's picture

j-kerbl | Thu, 08/10/2017 - 13:51

Hi Govind,

please check that the VTK libraries in the two Makefiles are the same. Compare LIGGGHTS-PUBLIC/src/MAKE/Makefile.ubuntuVTK and LIGGGHTS-PUBLIC/src/MAKE/Makefile.ubuntuVTK_debug .

Cheers,
Josef

govind | Thu, 08/17/2017 - 07:22

VTK libraries in Makefile.ubuntuVTK and Makefile.ubuntuVTK_debug are not same. Even by making same it throws the same error.

Govind

govind | Sat, 08/19/2017 - 15:20

Here is the makefile.ubuntu_debug

# ubuntuVTK_debug = Ubuntu 15.04, mpic++, OpenMPI-1.6

SHELL = /bin/sh

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = mpic++
CCFLAGS = -g -O2 \
-funroll-loops -fstrict-aliasing -Wall -Wextra -Wno-uninitialized -pg
SHFLAGS =
DEPFLAGS = -M

LINK = mpic++
LINKFLAGS = -O2 -pg
LIB = -lstdc++
SIZE = size

ARCHIVE = ar
ARFLAGS = -rcsv
SHLIBFLAGS = -shared

# ---------------------------------------------------------------------
# LAMMPS-specific settings
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"

# LAMMPS ifdef settings, OPTIONAL
# see possible settings in doc/Section_start.html#2_2 (step 4)

LMP_INC = -DLAMMPS_GZIP -DLAMMPS_VTK -DLIGGGHTS_DEBUG

# MPI library, REQUIRED
# see discussion in doc/Section_start.html#2_2 (step 5)
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC =
MPI_PATH =
MPI_LIB =

# FFT library, OPTIONAL
# see discussion in doc/Section_start.html#2_2 (step 6)
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC =
FFT_PATH =
FFT_LIB =

# JPEG and/or PNG library, OPTIONAL
# see discussion in doc/Section_start.html#2_2 (step 7)
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library

JPG_INC =
JPG_PATH =
JPG_LIB =

# VTK library, OPTIONAL
# INC = path for VTK header files
# PATH = path for VTK library
# LIB = name of VTK library

VTK_INC = -I/usr/include/vtk-6.2
VTK_PATH =
VTK_LIB = -lvtkCommonCore-6.2 -lvtkIOCore-6.2 -lvtkParallelCore-6.2 -lvtkIOParallel-6.2 -lvtkParallelMPI-6.2 -lvtkCommonDataModel-6.2 -lvtkIOLegacy-6.2 -lvtkIOXML-6.2

# ---------------------------------------------------------------------
# build rules and dependencies
# no need to edit this section

include Makefile.package.settings
include Makefile.package

EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(VTK_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(VTK_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(VTK_LIB) $(PKG_SYSLIB)

# Path to src files

vpath %.cpp ..
vpath %.h ..

# Link target

$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
$(SIZE) $(EXE)

# Library targets

lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)

shlib: $(OBJ)
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
$(OBJ) $(EXTRA_LIB) $(LIB)

# Compilation rules

%.o:%.cpp
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<

%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@

# Individual dependencies

DEPENDS = $(OBJ:.o=.d)
sinclude $(DEPENDS)

govind | Sun, 08/20/2017 - 23:50

Things are okay now. I have settled the debug mode

Thanks
Govind

PRATBHARAT94 | Fri, 11/18/2022 - 10:20

Hello Everyone,
Although, I am able to compile liggghts without shared object, but when I am trying to compile it as shared library,
I am getting the following error:
/usr/bin/ld: /usr/local/lib/libvoro++.a(container.o): relocation R_X86_64_PC32 against symbol `_ZN4voro14container_baseD2Ev' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:1391: recipe for target 'shlib' failed
make[1]: *** [shlib] Error 1
make[1]: Leaving directory '/home/pratyush/LIGGGHTS-PUBLIC-master/src/Obj_auto'
Makefile.shlib:62: recipe for target 'auto' failed
make: *** [auto] Error 2
Can you please help me out?
Thanks in advance !!
Pratyush