>=lammps-20150213 fails to build

Hi,

using gcc-4.8.3, glibc-2.19 I get a compiler error starting with the
13. Feb version:

g++ -g -O3 -DLAMMPS_GZIP -I../STUBS -c ../fix_ave_chunk.cpp
../fix_ave_chunk.cpp: In member function âvirtual void
LAMMPS_NS::FixAveChunk::end_of_step()â:
../fix_ave_chunk.cpp:934:35: error: âftruncateâ was not declared in this scope
       ftruncate(fileno(fp),fileend);
                                   ^
Makefile:102: recipe for target 'fix_ave_chunk.o' failed

The attached patch fixes this.

Thanks,

nick

--- lammps-13Feb15/src/fix_ave_chunk.cpp 2015-02-13
09:53:48.000000000 -0700
+++ lammps-13Feb15-new/src/fix_ave_chunk.cpp 2015-02-18
16:05:03.000000000 -0700
@@ -24,6 +24,8 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
+#include <unistd.h>
+#include <sys/types.h>

using namespace LAMMPS_NS;
using namespace FixConst;

Hi,

Hi,

using gcc-4.8.3, glibc-2.19 I get a compiler error starting with the
13. Feb version:

g++ -g -O3 -DLAMMPS_GZIP -I../STUBS -c ../fix_ave_chunk.cpp
../fix_ave_chunk.cpp: In member function âvirtual void
LAMMPS_NS::FixAveChunk::end_of_step()â:
../fix_ave_chunk.cpp:934:35: error: âftruncateâ was not declared in this scope
       ftruncate(fileno(fp),fileend);
                                   ^
Makefile:102: recipe for target 'fix_ave_chunk.o' failed

The attached patch fixes this.

I am using

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/[email protected] f3b2605a-c512-4ea7-a41b-209d697bcdaa

and adding "#include <unistd.h>" is enough to build properly. It fails without
it.

(using Debian, gcc 4.9.2, Open MPI 1.6.5)

Please find a more complete patch below:

--- lammps-13Feb15/src/fix_ave_chunk.cpp 2015-02-13
09:53:48.000000000 -0700
+++ lammps-13Feb15-new/src/fix_ave_chunk.cpp 2015-02-19
09:16:22.000000000 -0700
@@ -11,6 +11,9 @@
    See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

+#include <unistd.h>
+#include <sys/types.h>

Please find a more complete patch below:

if you start fixing things like long int -> off_t, you better do this
throughout the code consistently.

furthermore, if you know a way to convince steve that include files
for system header should use angular brackets instead of double
quotes, i would like to know it. i have tried for many years in
different ways and so far have not had any success.

axel.

Please find a more complete patch below:

if you start fixing things like long int -> off_t, you better do this
throughout the code consistently.

Well that would be ideal, I agree.

furthermore, if you know a way to convince steve that include files
for system header should use angular brackets instead of double
quotes, i would like to know it. i have tried for many years in
different ways and so far have not had any success.

You have my support on that as well :slight_smile: