= PEPC tutorial = == Trunk version file content == The following directories and files are of particular interest. * '''./pepc-b/''' [[BR]] the source code of the PEPC-B front end is located here * ''pepcb.f90'' [[BR]] this is the main file, containing the program's workflow * '''./pepc-e/''' [[BR]] simple stand-alone frontend for electrostatics/benchmark Coulomb problems * '''./lpepcsrc/''' [[BR]] this directory contains the source code of the PEPC library, upon which all PEPC front-end applications are based * '''./sl_pepc/'''[[BR]] sorting library used by pepc * '''./makefiles/'''[[BR]] predefined compilation options and variables for some architectures: * IBM Power6 jump * IBM !BlueGene/P jugene * Intel Nehalem cluster juropa * '''./job-scripts/'''[[BR]] some example submission scripts are located here * '''./bin/'''[[BR]] contains compiled binaries and other useful tools & scripts * ''./makefile'' [[BR]] this make file calls the makefiles contained in the source subdirectories. Three targets are currently available: * pepcb - compiles the PEPC library and the PEPC-B front end, and generates an executable ''./pepcb'' * pepce - compiles the PEPC library and the PEPC-E front end, and generates an executable ''./pepce'' * clean - cleans up == how to compile == 1. The compilation step is basically to create a ''./makefile.defs'' file. One of the files in '''./makefiles/''' can be used directly, by setting a symbolic link to one of them, or as a starting point for specific needs or new architectures. The file ''./makefile.defs'' must contain the following variables: || '''variable''' || '''example''' || '''function''' || || MACH || JUROPA-JSC || architecture name, used just for output || || RANLIB || ranlib || ranlib execution command || || MAKE || gmake || GNU make execution command || || AR || xiar || ar execution command || || ARFLAGS || -rs || flags to generate an archive || || CPP || /usr/lib/cpp || c preprocessor execution command || || CPPFLAGS || -P -C || c preprocessor flags, omit line numbering, leave program comments || || FCPRE || scalasca -instrument || fortran compiler precommand, e.g. for scalasca instrumentation || || FC || mpif90 || fortran 90 compiler || || FFLAGS || -O2 -ipo -axSSE4.2 || fortran 90 compiler options || || CCPRE || || c compiler precommand || || CC || mpicc || c compiler || || CFLAGS || -O2 || c compiler options || || LDPRE || || linker precommand || || LD || mpif90 || linker command || || LDFLAGS || || linker (tuning) options || || LDLIBS || -lpapi || additional libraries to link with || || RM || rm -rf || remove command || || EXECNAME ||../pepc || name of the executable, with respect to the '''./pepc-b/''' directory || Example: {{{ ln -s makefiles/makefile.defs.juropa makefile.defs }}} 2. Adapt the ''./makefile.defs'' file and do {{{ make pepcb }}} The executable will be placed either in the install directory or in '''./bin/'''. 3. Now go to [wiki:trunk/getting_started] to learn how to run PEPC.