Windows' Installation

Submitted by ikoval3 on Mon, 05/13/2013 - 16:19

Hi everyone,

I tried to install LIGGGHTS on my Window computer.
The only installation tutorial that I found is http://techblog.richtisoft.de/?p=31 where it is required to use the Visual Studio's macros. BUT, the macros were removed from the last version of Visual Studio (http://www.infoq.com/news/2011/10/VS-Macros). I tried to fix this problem by creating adds-in out of the existing LIGGGHTS' macro (http://stackoverflow.com/questions/12027485/alternative-to-macros-in-vis...) but this I do not have the same toolbar as the 2012 version of VS.

Does anyone have a suggestion or recommendation for me?
Thanks in advance.

richti83's picture

richti83 | Mon, 05/13/2013 - 18:56

Why not to use VS2008 ? I think there will be more problems with a never IDE and the old projectfiles ...

I think the macro just reloads the file-tree, so you could try to do this by hand:
delete all cpp and header files from build tree, add everything from /LIGGGHTS-PUBLIC/src/ folder BUT not what's included in the subfolders.
Than add _USE_MATH_DEFINES compilerflag to the commandline and change the two mentioned code-snippets and run build.

I could provide a precompiled 2.3.2 binary for 64bit with all compiler-optimazion ON, if if there would be a little donation to my blog :-)

A Work-a-round could be:
open the vsproject in VS2008, run the macro to refresh the file-list and whatever the macro does, save the project and re-open it with VS2012. I'll try this and report about the result in my blog.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ckloss's picture

ckloss | Tue, 05/14/2013 - 12:54

Hi ikoval3,

we're aware of the problem with macros and VS. We know how to fix this and it's on our list, but I don't think it's going to happen very soon (not on top of list since we ourselves don't need it)

best,
Christoph

ikoval3 | Tue, 05/14/2013 - 17:46

Hi all,

@ Ritchi83 : I choose the solution of using VS 2008 which is free for students! (See Dreamspark)
Still thank you à lot!
@ ckloss : Ok. I think that almost nobody uses Windows!

A have one more question :
How LIGGGHTS is supposed to run : Does it suppose to run with a window's terminal, or with VS? Because when I build the solution on C++, there are many mistakes :
- It does not know a 'sleep' parameter, which occurs 10 time.
- It does not recognize 'M-PI' which is tried to fixe by writing '#define USE_MATH_DEFINES' right below "#include "math.h" as it is said in the tutorial (http://techblog.richtisoft.de/?p=31)

Do you know how to fix it? It is required to fix this, or can LIGGGHTS runs withou LAMMMPS? I mean, does the process start in VS, or in Linux (Because I know that how it works in Linux)

Thank in advance,
Igor

richti83's picture

richti83 | Tue, 05/14/2013 - 21:22

Hi Igor & all Windows Fans,

1st: good news: I pushed a fork of 2.3.2 Public for Windows here: https://github.com/richti83/LIGGGHTS-PUBLIC.git
I hope it includes all neccessary changes in source- and projectfile.

In Detail (if someone needs to set up the project from scratch) I did the following steps:
1.) opened the original file in VS 2008, started the macro, refreshed the source-tree (as described in my blog)
2.) saved the project, closed VS 2008
3.) opened & converted the projectfile in VS 2012
4.) added /D _USE_MATH_DEFINES to Project Properties->Command Line (this declares M_PI as ~3.1415... :-)
5.) changed some compiler-variant code lines (see diffs in src/*.cpp here: https://github.com/richti83/LIGGGHTS-PUBLIC/commit/33e339be30b5945d01117...) @Chris: could you think about not to use variable array-size defintions ? The vc++ doesnt like them :-( (in Fact PGI, Intel, GCC does not complain about these lines, but hey its made in redmond ...)
6.) added 64bit FFTW2dll.lib to ..\LIGGGHTS-PUBLIC\src\WINDOWS\extra\fftw2\ because the original shipped seems to be 32 bit and doesn't link against x64. (if you can not use the git repo: google for fftw2 and build it in Visual Studio)
7.) build and watched for errors
8.) after successfull build add FFTW2dll.dll to ..\LIGGGHTS-PUBLIC\src\WINDOWS\x64\Release\
(8.2 if lammps.exe will not start, crahes with 0x000007c error or something bad: install mpich2 and/or copy mpich2.dll mpich2mpi.dll mpich2nemesis.dll to ..\LIGGGHTS-PUBLIC\src\WINDOWS\x64\Release\ make sure the dll's are 64bit
9.) Add the path to lammps.exe and all the dll stuff to your PATH environment variable
10.) open a commandline (start->search->cmd) and type lammps
Hopefully you will be greeted with "LIGGGHTS (Version LIGGGHTS-PUBLIC 2.3.2, compiled 2013-03-29-16:39:37 by ckloss
based on LAMMPS 20 Apr 2012)" (sorry, the refresh-version.h-macro is not available, edit version.h by hand instead :-))
11.) in windows world there is one big difference: the lammps.exe < inputskrip.lmp does not work, instead you need to type lammps.exe -in in.movingwall

For Postprocessing visit my blog at techblog.richtisoft.de

Best,
Christian

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ikoval3 | Wed, 05/15/2013 - 19:56

I thank you very much for your precise answer.
I got the "LIGGGHTS (Version LIGGGHTS-PUBLIC 2.3.2, compiled 2013-03-29-16:39:37 by ckloss based on LAMMPS 20 Apr 2012)", but when I wrote "lammps.exe -in in.movingwall", I got
"ERROR on proc 0: Cannot open input script in.movingwall <..\lammps.cpp:258>"
What does it mean, and what should I do?

richti83's picture

richti83 | Wed, 05/15/2013 - 21:31

Well,

you need to cd to the folder where "in.movingwall" is stored :-) (normaly \LIGGGHTS-PUBLIC\examples\LIGGGHTS\Tutorials_public\movingMeshGran\"
and to be precise it should be:
lammps.exe -in in.movingMeshGran
to start the moving-mesh example.
The Syntax is: liggghts.exe -in INPUTSKRIPTNAME
Some hints to have it easy to postprocess:
Download Paraview,
Download ReaderPlugins for liggghts-dumpfiles: http://techblog.richtisoft.de/wp-content/uploads/2012/12/liggghts_reader...
change the following line

dump dmp all custom 300 post/dump*.meshGran id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

to

dump dmp all custom 300 post/dump*.liggghts id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

You will get a lot of dump*.stl and dump*.liggghts files in the folder "\LIGGGHTS-PUBLIC\examples\LIGGGHTS\Tutorials_public\movingMeshGran\post\", open it in Paraview and enjoy.
best,
Christian

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ikoval3 | Thu, 05/16/2013 - 17:03

Well,

I run the program yesterday and it worked with the in.sph_1 example. But, I tried with the in.packing example (That is what I work on), and I got an error message from "Microsoft Visual C++ Debug Library" telling me that
"Program : C:\...\Debug_STUBS\LAMMPS.exe
Module : C:\...\Debug_STUBS\LAMMPS.exe
File :

Run-Time Check Failure #3 - The variable 'delta' is being used without being initialized"
although there is no delta variable

ikoval3 | Thu, 05/16/2013 - 17:41

I'm really sorry for all this frequent questions but your answer are really straightforward and usefull!
I add the 'liggghts-reader' macro to paraview but it doesn't change anything in the readers and I cannot open a *.liggghts file.

I thank you a lot for all your answers! I'll post my entire steps to make it work for future Window's users if they need (Even if your Window's process is perfect).

richti83's picture

richti83 | Sat, 05/18/2013 - 16:29

you need to add the "liggghts_reader.dll" as Plugin not as macro. Launch paraview, Menü->Tools->Manage Plugins->Load New and load the downloaded dll’s. Make sure you set the flag to [x] AutoLoad.
at the bottom of this post you'll find an actual reader-plugin:
http://techblog.richtisoft.de/?p=27
(you don't need to compile it from source for Paraview 3.98.X)

The updateButton.py is a macro which triggers the openfile process (but therefore the reader plugin needs to be loaded).

About the crash: I've no Idea where this comes from.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

richti83's picture

richti83 | Tue, 05/21/2013 - 21:23

I merged to master (2.3.4 as of today) and added some missing LOC to avoid memory leaks with the new inserted pointer structures.
Here is the repository:
git clone https://github.com/richti83/LIGGGHTS-PUBLIC.git
and here is a precompiled win32
https://github.com/richti83/LIGGGHTS-PUBLIC/tree/master/src/WINDOWS/win3...
and a precompiled win64
https://github.com/richti83/LIGGGHTS-PUBLIC/tree/master/src/WINDOWS/x64/...

greetings,
Christian

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ikoval3 | Fri, 05/24/2013 - 22:52

I send you the way I installed LIGGGHTS. If you see some mistake, let me know. Obviously, some steps was incomprehensible for me, such as the installation of MPI2H but i put it in my description.

LIGGGHTS – Windows Installation

1) (On the Internet) Download and execute MPI2H
2) (On the Internet) Download FFT2W (Probably the 64 bits version)
3) (On the internet) Download msysgit and execute GitBash
4) (In a GitBash terminal) Write ‘git clone git://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git’
5) Open LIGGGHTS-PUBLIC/src/Windows/LAMMMPS.vcproj in Visual Studio 2008 (or previous version which allows macros)
6) (In Visual Studio 2008) Load LAAMPS solution (LAMMPS.sln)
7) (In the Visual Studio 2008) Select menu ‘Tools/macro/Load Macro Project’ and load the file src/WINDOWS/LAMMPS.vsmacros
8) (In Visual Studio 2008) In the ‘Macro Explorer’, on the right panel, open LAMMPS > LAMMPS_settings
9) (In Visual Studio 2008) Double click on ‘ManagePackages’
10) A new window for running macro is opened now. Check [x] Refresh file list in src
11) (In Visual Studio 2008) Save the project
12) Close Visual Studio 2008 and open the LAMMPS project a 2010 or 1012 version (You can keep on working on Visual studio 2008)
13) (In Visual Studio 2010/2012) Add /D _USE_MATH_DEFIENS to Project Properties > Command line
14) (On the Internet) Download Notepad ++
15) Change the files as said here : https://github.com/richti83/LIGGGHTS-PUBLIC/commit/33e339be30b5945d01117... with Notepad ++
16) (In Visual Studio 20010/12)Build and watch for errors. Correct the more you can
17) (In the Download folder) Find FFTW2dll.lib and add it to ../LIGGGHTS-PUBLIC/src/Windows/extra/fftw2
18) Add the path to lammps.exe and to ffftw2dll to your PATH environment variables
19) (In Visual Studio 2010/2012) Build and watch for errors. No more errors should be left. If so, correct them all.
20) (In Visual Studio 2010/2012) When the project’s building successes, close Visual Studio.
21) (In Windows Explorer) Find a LIGGGHTS’s example (..\LIGGGHTS-PUBLIC\examples\LIGGGHTS\Tutorials_public), open the in.’name_of_the_example’ with Notepad or the bloc-notes and change the line ‘dump …’ to ‘dump dmp all custom 1000 post/dump*.liggghts id type x y z radius vx vy vz fx fy fz omegax omegay omegaz’
22) In the example folder, you should have or create a ‘post’ folder
23) (In a windows terminal) Run LAMMPS, firstly by trying ‘lammps.exe’ . You should get ‘LIGGGHTS (Version LIGGGHTS-PUBLIC 2.3.2, compiled 20**-**-**-16:39:37 by ckloss based on LAMMPS 20 Apr 2012’. If you don’t, you missed something before. Depending on the ERROR message, correct it.
24) (In a windows terminal) You can run your example by writing ‘lammps.exe –in in.‘name_of_the_example’ (You have to run it from the folder which contains your example).
22.2) In the packing example, you should have to replace ‘delta’ to ‘sqrt(deltasq)’ in neighbor.cpp, line 1257.

25) If everything went well, you should have a lot of files in the post folder called dump*.’name_of_your_example_ where * is a number.
26) (On the Internet) For the post process, download Paraview
27) (On the Internet) Download a liggghts files reader http://techblog.richtisoft.de/wp-content/uploads/2012/12/liggghts_reader...
28) (In Paraview) Go in Tools > Manage Plugins .. Load your liggghts_reader file and make it auto-load by clicking the little cross on the left side of the name
29) (In Paraview) Go in File > Open and open your dump..liggghts files
30) Enjoy

You can read more about how to use LIGGGHTS in ..\LIGGGHTS-PUBLIC\doc, beginning with Manual.pdf.
Further information:
- http://techblog.richtisoft.de/?p=31
- http://cfdem.dcs-computing.com/?q=node/1641