recompiling lammps on Windows 8.1

Hello everyone,

I posted a similar message yesterday, where I had a bunch of errors while compiling LAMMPS. I'm on a different machine now (using Windows 8.1 as the subject line says) and still having trouble, but in different ways. I need to use a slightly modified 'pair_coul_dsf.cpp' file (in the src folder), which is why I want to recompile it myself instead of using a pre-made executable. The modified file uses the actual error function instead of an approximation. I have a feeling I'm a little confused about exactly how to build LAMMPS myself, so if I say something here that's incorrect, I'd really appreciate somebody clearing it up for me. As I understand it from this page: http://lammps.sandia.gov/doc/Section_start.html#start_2_6, to build on Windows, you need to use cygwin to go to C:\(...)\src\MAKE\MACHINES and run the Makefile.cygwin makefile. I have CMake and cygwin installed on my computer with the appropriate folders added to my path, but I had no luck in running it. I used the!
  command:

$ make -f Makefile.cygwin

in the cygwin prompt, and got the following error:

Makefile.cygwin:72: Makefile.package.settings: No such file or directory
Makefile.cygwin:73: Makefile.package: No such file or directory
make: *** No rule to make target 'Makefile.package'. Stop.

I'm in unfamiliar territory and don't understand what I would need to do to correct this. I also tried to compile LAMMPS by doing it the same way I tried on the Mac, by going to the STUBS folder, typing 'make', 'cd ..', and then 'make serial', but that also failed. The output began with a bunch of lines that said "command not found", followed by a long list of things that appeared to work okay, and then it ended with:

In file included from ../pointers.h:24:0,
                 from ../read_data.h:24,
                 from ../read_data.cpp:19:
../read_data.cpp: In member function 'void LAMMPS_NS::ReadData::header()':
../lmptype.h:89:19: error: 'INT64_MAX' was not declared in this scope
#define MAXBIGINT INT64_MAX
                   ^
../read_data.cpp:727:43: note: in expansion of macro 'MAXBIGINT'
   if (atom->natoms < 0 || atom->natoms >= MAXBIGINT ||
                                           ^
Makefile:102: recipe for target 'read_data.o' failed
make[1]: *** [read_data.o] Error 1
make[1]: Leaving directory '/cygdrive/c/LAMMPS/lammps-9Dec14/src/Obj_serial'
Makefile:94: recipe for target 'serial' failed
make: *** [serial] Error 2

Further down on the Getting Started page I linked above, in the "Building for Windows" section under "packages that require extra libraries", it says I need to run makefiles in each folder in the lib folder, but I tried to do that (from the Windows command prompt) also without success. I used the suggested commands given in the README.txt files, but it didn't work. The instructions page says I may need to tailor each makefile to my particular machine, and I don't have any idea how to do that.

I apologize if anything I'm doing is senseless - I feel a little lost. Any push in the right direction would be greatly appreciated. Thanks in advance!

Regards,
Nathan

Hello everyone,

I posted a similar message yesterday, where I had a bunch of errors while compiling LAMMPS. I'm on a different machine now (using Windows 8.1 as the subject line says) and still having trouble, but in different ways. I need to use a slightly modified 'pair_coul_dsf.cpp' file (in the src folder), which is why I want to recompile it myself instead of using a pre-made executable. The modified file uses the actual error function instead of an approximation. I have a feeling I'm a little confused about exactly how to build LAMMPS myself, so if I say something here that's incorrect, I'd really appreciate somebody clearing it up for me. As I understand it from this page: http://lammps.sandia.gov/doc/Section_start.html#start_2_6, to build on Windows, you need to use cygwin to go to C:\(...)\src\MAKE\MACHINES and run the Makefile.cygwin makefile. I have CMake and cygwin installed on my computer with the appropriate folders added to my path, but I had no luck in running it. I used the!
  command:

$ make -f Makefile.cygwin

that is not how compilation of LAMMPS works. the installation
instructions say it clearly. you must have misread something. cygwin
is not the only option, mingw works as well. finally, cmake is not
used by LAMMPS.

in the cygwin prompt, and got the following error:

Makefile.cygwin:72: Makefile.package.settings: No such file or directory
Makefile.cygwin:73: Makefile.package: No such file or directory
make: *** No rule to make target 'Makefile.package'. Stop.

I'm in unfamiliar territory and don't understand what I would need to do to correct this. I also tried to compile LAMMPS by doing it the same way I tried on the Mac, by going to the STUBS folder, typing 'make', 'cd ..', and then 'make serial', but that also failed. The output began with a bunch of lines that said "command not found", followed by a long list of things that appeared to work okay, and then it ended with:

LAMMPS requires a unix-like environment and thus you need more than
the compiler, but also a number of typical unix commands that are used
to generate some files, e.g. to automatically update some files used
during the build. these are a unix shell (e.g. bash) and commands
like: diff, grep, sed, test, ls, tr, and so on.

In file included from ../pointers.h:24:0,
                 from ../read_data.h:24,
                 from ../read_data.cpp:19:
../read_data.cpp: In member function 'void LAMMPS_NS::ReadData::header()':
../lmptype.h:89:19: error: 'INT64_MAX' was not declared in this scope
#define MAXBIGINT INT64_MAX
                   ^
../read_data.cpp:727:43: note: in expansion of macro 'MAXBIGINT'
   if (atom->natoms < 0 || atom->natoms >= MAXBIGINT ||
                                           ^
Makefile:102: recipe for target 'read_data.o' failed
make[1]: *** [read_data.o] Error 1
make[1]: Leaving directory '/cygdrive/c/LAMMPS/lammps-9Dec14/src/Obj_serial'
Makefile:94: recipe for target 'serial' failed
make: *** [serial] Error 2

this one is due to limitations in cygwin. it can be avoided by using
the define -DLAMMPS_SMALLSMALL

axel.

Thanks for your help, Dr. Kohlmeyer. I managed to compile LAMMPS in cygwin, but I think I must have messed up something else. There is an issue with installing the RIGID package, which I need to run my simulation. I'm trying to simulate rigid water with a 'fix shake' command and it gives me the 'invalid fix style' error. I do have the RIGID package installed and I installed it before compiling LAMMPS, which I verified by typing 'make package-status' and see that it's installed. But when I run './lmp_foo -h' in the command prompt, 'shake' does not appear under the available fix styles. I did see a few warnings go by when doing these things though. Here are the details:

Before I started, I did 'make clean-all' in /src and 'make clean' in /STUBS. Then in /src I did 'make yes-RIGID', after which I got this output:

Installing package RIGID
../Install.sh: line 15: cmp: command not found
../Install.sh: line 15: cmp: command not found
../Install.sh: line 15: cmp: command not found
...

where I added '...' to indicate that it continues. I don't know if that's bad, but afterwards, it seemed to be installed. I tried 'make package-status', which gave me:

...
Package.sh: line 25: cmp: command not found
  src/pair_lj_cut_tip4p_cut.h and MOLECULE/pair_lj_cut_tip4p_cut.h are different
Package.sh: line 25: cmp: command not found
  src/pair_tip4p_cut.h and MOLECULE/pair_tip4p_cut.h are different
Installed NO: package MPIIO
Installed NO: package OPT
Installed NO: package PERI
Installed NO: package POEMS
Installed NO: package QEQ
Installed NO: package REAX
Installed NO: package REPLICA
Installed YES: package RIGID
Package.sh: line 25: cmp: command not found
  src/compute_erotate_rigid.cpp and RIGID/compute_erotate_rigid.cpp are different
Package.sh: line 25: cmp: command not found
  src/compute_ke_rigid.cpp and RIGID/compute_ke_rigid.cpp are different
...

So I got a bunch of those lines that said 'command not found' followed by the notification that some files are different. That may be my problem, but I don't know what to do about it. So I went back into /STUBS and typed 'make', 'cd ..', and then 'make foo' which calls my own makefile that I saved in the 'MINE' folder. I used the Makefile.serial as a template and only changed the name and the line:

LMP_INC = -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL

according to Dr. Kohlmeyer's advice. (I also tried using FFTW2 lower down but couldn't get it to work so now it's left blank.) running 'make foo' produced mostly problem-free output except for:

...
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL -I../STUBS -c ../neigh_half_multi.cpp
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL -I../STUBS -c ../variable.cpp
../variable.cpp: In member function ‘double LAMMPS_NS::Variable::collapse_tree(LAMMPS_NS::Variable::Tree*)’:
../variable.cpp:2189:38: warning: overflow in implicit constant conversion [-Woverflow]
           if (istep > ivalue2) istep = 9.0e18;
                                      ^
../variable.cpp:2192:18: warning: overflow in implicit constant conversion [-Woverflow]
     } else istep = 9.0e18;
                  ^
../variable.cpp: In member function ‘double LAMMPS_NS::Variable::eval_tree(LAMMPS_NS::Variable::Tree*, int)’:
../variable.cpp:2488:38: warning: overflow in implicit constant conversion [-Woverflow]
           if (istep > ivalue2) istep = 9.0e18;
                                      ^
../variable.cpp:2491:18: warning: overflow in implicit constant conversion [-Woverflow]
     } else istep = 9.0e18;
                  ^
../variable.cpp: In member function ‘int LAMMPS_NS::Variable::math_function(char*, char*, LAMMPS_NS::Variable::Tree**, LAMMPS_NS::Variable::Tree**, int&, double*, int&)’:
../variable.cpp:2974:40: warning: overflow in implicit constant conversion [-Woverflow]
             if (istep > ivalue2) istep = 9.0e18;
                                        ^
../variable.cpp:2977:20: warning: overflow in implicit constant conversion [-Woverflow]
       } else istep = 9.0e18;
                    ^
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL -I../STUBS -c ../dump_custom.cpp
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL -I../STUBS -c ../fft3d.cpp
g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_SMALLSMALL -I../STUBS -c ../compute_cna_atom.cpp
...

But if finished without throwing an error, and created an executable. I ran my executable with my input file and it complained about my fix shake command. Here's the output for './lmp_foo -h':

...
* Fix styles

adapt addforce ave/atom ave/correlate ave/histo
ave/spatial ave/time aveforce balance box/relax
deform drag dt/reset enforce2d external
gravity heat indent langevin lineforce
momentum move nph nph/sphere npt
npt/sphere nve nve/limit nve/noforce nve/sphere
nvt nvt/sllod nvt/sphere planeforce press/berendsen
print property/atom qeq/comb recenter restrain
setforce spring spring/rg spring/self store/force
store/state temp/berendsen temp/csvr temp/rescale tmd
tune/kspace vector viscous wall/harmonic wall/lj1043
wall/lj126 wall/lj93 wall/reflect wall/region
...

What am I doing wrong to install the RIGID package? Thanks.

Regards,
Nathan

The error message you get clearly shows that you are missing the cmp program, another standard unix shell command.