Failed compilation with the latest public version on Mac

Submitted by yidongxia on Fri, 11/04/2016 - 17:08

I obtained LIGGGHTS-PUBLIC from GitHub, where the latest commit is

#################################################################
commit f7be0a1370ccdd5f315a36cd9842c320035557aa
Author: Andreas Aigner
Date: Tue Sep 6 11:59:15 2016 +0200

Added missing sphinx configuration and makefile for documentation
#################################################################

When I did "make openmpi", the compilation failed with the following error message:

#################################################################
../fix_nve_sphere.cpp:98:36: error: use of undeclared identifier 'atof'
CAddRhoFluid_ = atof(arg[iarg]);
#################################################################

BTW, I also found a few header files were modified after I did "make openmpi"; see

#################################################################
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified: style_atom.h
modified: style_cohesion_model.h
modified: style_compute.h
modified: style_contact_model.h
modified: style_dump.h
modified: style_fix.h
modified: style_pair.h
modified: style_rolling_model.h
modified: style_sph_kernel.h
modified: version_liggghts.h
#################################################################

I do not understand why those files were changed.

Thanks in advance for any help on my problem!

Daniel Lester | Mon, 06/19/2017 - 13:16

I am experiencing the same error whilst compiling serial liggghts on mac:

../fix_nve_sphere.cpp:98:36: error: use of undeclared identifier 'atof'
CAddRhoFluid_ = atof(arg[iarg]);
^
1 error generated.
make[1]: *** [fix_nve_sphere.o] Error 1

any suggestions would be most welcome!

aaigner's picture

aaigner | Mon, 06/19/2017 - 18:25

Hi!

Try to add a
#include <stdlib.h>
at the beginning of the file fix_nve_sphere.cpp

Best wishes
Andreas