CmPA / iPic3D

Particle-in-Cell code using the implicit moment method
72 stars 56 forks source link

build/exec should contain everything needed to run iPic3D #48

Open alecjohnson opened 10 years ago

alecjohnson commented 10 years ago

This specification was written in consultation with Jorge Amaya.

cmake supports the ability to compile in a separate directory without modifying the original source tree. By convention this directory is called build.

We envision that everything needed to run ("execute") iPic3D be placed in build/exec: the executable (iPic3D) and the configuration ".inp" file. (Formerly this directory was called "build/work", but this name seems less clear. We prefer not to call it "build/run", because one might consider "run" to refer to an individual simulation.) The executable will be called "build/exec/iPic3D". (Formerly it was called "iPIC3D", but we are trying to be consistent about capitalization.)

murci3lag0 commented 10 years ago

To clear some of the nomenclature:

Let's call $IPICHOME the directory were the code sources are located. This should be a clone of the GitHub repository. In such case the CMake configuration file will be $IPICHOME/CMakeLists.txt

Now, let's call $IPICTARGET the directory where the user wants to build the code. Why is it different than the 'home' directory? Because, sometimes we need to compile the code in different locations, for example when using a cluster the runs would be performed in the 'scratch' disks instead of the 'home' disks. This is called out of source build.

To compile the code should be done:

cd $IPICTARGET
ccmake $IPICHOME
make

ccmake will allow to select some compilation options, like parallel HDF5 compilation, MIC compilation or coupling with BATS-R-US.

The make command will create the $IPICTARGET/lib directory containing the compilation of the library, and the $IPICTARGET/exec directory containing the binary executable file and all the required files to perform a simulation as presented by @alecjohnson.