I am trying to make g_elpot (https://jugit.fz-juelich.de/computational-neurophysiology/g_elpot) and got the following error:
g++ -O3 -Wno-unused -funroll-all-loops -std=c++11 -fopenmp -I/usr/local/gromacs/include -I/usr/local/fftw/include -c -o dx.o dx.cpp
dx.cpp: In function ‘void write_dx_file(real*, real*, int*, real (*)[3], const char*, unit_t)’:
dx.cpp:41:33: error: ‘isnan’ was not declared in this scope
if (isnan(grid_values[i]))
^
dx.cpp:41:33: note: suggested alternative:
In file included from /usr/local/gromacs/include/gromacs/math/vectypes.h:40:0,
from dx.h:3,
from dx.cpp:1:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
isnan(_Tp __x)
^
<builtin>: recipe for target 'dx.o' failed
make: *** [dx.o] Error 1
I am using g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 and cmake version 3.14.0.
My Makefile is:
# Generated automatically from Makefile.in by configure.
#
# This is a Gromacs 3.0 template makefile for your own utility programs.
#
# Copy this file to whatever directory you are using for your own
# software and add more targets like the template one below.
#
# If you are using gmake it is relatively straightforward to add
# an include based on environment variables (like previous Gromacs versions)
# to select compiler flags and stuff automatically, but below it is static:
#
# Variables set by the configuration script:
LIBS = -lgromacs -lfftw3f -lm -fopenmp
LDFLAGS = -L/usr/local/gromacs/lib -L/usr/local/fftw/lib
CPPFLAGS = -I/usr/local/gromacs/include -I/usr/local/fftw/include
CXXFLAGS = -O3 -Wno-unused -funroll-all-loops -std=c++11 -fopenmp
CXX = g++
LD = $(CXX)
g_elpot: g_elpot.o elmap_grid.o spline_interpolation.o fitting.o dx.o spme_grid.o convergence_check.o frame.o result.o units.o molecule.o memory_check.o debug.o
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
I was trying to run g_elpot and wanted to install it and ran into this issue while running make