Building XGC with GNU Make¶
The GNU make environment used by XGC consists of
A platform-independent makefile (
[repo name]/Makefile
)An auxiliary file (
[repo name]/build/rules.mk
) defining the make targets (e.g. xgc-es, xgc-em, xgca,…)An auxiliary file (
[repo name]/build/defs.mk
) defining the names of the object (.o) files required for building the targets defined in[repo name]/build/rules.mk
An auxiliary file for defining preprocessor macros at compile time (
[repo name]/build/xgc_flags.mk
)A platform specific makefile (
[repo name]/build/make.inc.{platform}
) that holds all settings that are specific to the targeted computing system (e.g. location of libraries, etc.)
The files Makefile
, rules.mk
, defs.mk
, and make.inc.{platform}
are unlikely to need frequent modifications. If you feel that something needs to be modified in those files, discuss with senior developers. The file xgc_flags.mk
is for you to change when you compile XGC, but do not push any modifications to this file to the repository. Preprocessor options that are always defined should be in Makefile
.
If you add a platform specific makefile for a new system, start from make.inc.generic
and adhere to the style set forth in this template. If your system uses a package manager such as “module” at NERSC, ALCF, and OLCF, copy+paste a list of the modules you loaded to the start of the new platform specific makefile.
Instructions for building XGC¶
Look for an existing make configuration for your target platform (–>
make.inc.{platform}
) in the folder “build
” or adjust and renamemake.inc.generic
for your platform.Set debugging options and target platform by
export XGC_PLATFORM={platform}
export DEBUG={0|1}
or
DEBUG={0|1} XGC_PLATFORM={platform} make ...
Adjust
build/xgc_flags.mk
if you want to use any optional compile time options (pre-processor macros).Select the directory by either prepending
PREFIX={path}
to the make command or by exportPREFIX={path}
before running make. If omitted, the default settingPREFIX=$(PWD)/xgc_build
will be used.Compile XGC by running
[DEBUG={0|1} XGC_PLATFORM={platform} PREFIX={path}] make {target}
where{target}
is one ofxgc-es
: XGC1 electrostaticxgc-es-gpu
: XGC1 electrostatic with GPU supportxgc-es-vec
: XGC1 with MVX512 optimizationxgc-em
: XGC1 electromagnetic (kinetic-fluid hybrid)xgca
: XGCa (axisymmetric)xgca-gpu
: XGCa with GPU supportxgca-vec
: XGCa with MVX512 optimization