LIGGGHTS installation error

Submitted by sourav0921 on Fri, 11/11/2022 - 16:02

Trying to install LIGGGHTS on ubuntu 22.04 with VTK version 7.1. I also checked the opnmpi version which is latest version

But I am facing the following error

Creating list of contact models completed.
make[1]: Entering directory '/home/joy/LIGGGHTS/LIGGGHTS-PUBLIC/src/Obj_auto'
mpicxx -funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -O2 -std=c++17 -fPIC -I/usr/include/vtk-7.1 -DLAMMPS_VTK -DSUPERQUADRIC_ACTIVE_FLAG -DNONSPHERICAL_ACTIVE_FLAG -c ../compute_pair_gran_local.cpp
In file included from ../granular_pair_style.h:47,
from ../pair_gran_proxy.h:58,
from ../compute_pair_gran_local.cpp:50:
../utils.h: In function ‘std::string LIGGGHTS::Utils::int_to_string(int)’:
../utils.h:70:12: error: invalid ‘static_cast’ from type ‘std::__cxx11::basic_ostringstream’ to type ‘std::ostringstream&’ {aka ‘std::__cxx11::basic_ostringstream&’}
70 | return static_cast< std::ostringstream & >(( std::ostringstream() << std::dec << a ) ).str();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1399: compute_pair_gran_local.o] Error 1
make[1]: Leaving directory '/home/joy/LIGGGHTS/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

Not able to figure out why this is happening. Please help me

mschramm | Sun, 11/13/2022 - 21:49

Error is the following line
return static_cast< std::ostringstream & >(( std::ostringstream() << std::dec << a ) ).str();

This has been updated on the latest release to work for freebsd and other distros. It is now replaced with the following.
std::ostringstream ss;
ss << std::dec << a;
return ss.str();

Please do a git pull to update your copy as other changes were also done.