Building ChaNGa - N-BodyShop/changa GitHub Wiki

Building ChaNGa is usually a two stage process. First you must build the Charm++ compiler including the necessary libraries, then the Charm++ compiler is used to build ChaNGa itself.

Generic build instructions are on this page. For detailed instructions for a specific machine, see Machine Specific Build Instructions.

Table of Contents

Build Charm++ with ChaNGa libraries

Charm needs to be built first. If it is not, build it with the build script in the top level of the charm distribution. Typically, a command like build charm++ netlrts-linux-x86_64 will build the charm++ compiler for a 64 bit Linux machine. However, ChaNGa uses a couple of Charm libraries that may not be built by default. To be sure that these are built, use the command

./build ChaNGa netlrts-linux-x86_64 --with-production
(for example on a 64 bit linux cluster with production optimizations) to build all these libraries.

Build ChaNGa itself

Now go into the changa directory, set the environment variable CHARM_DIR to point at the root of your charm distribution and run configure. (Note that if the copy of charm is put into the "ChaNGa" directory, or the directory above, then the CHARM_DIR variable need not be set.) To echo a list of compile flags with descriptions, run ./configure --help. This will configure the Makefile in both the changa and structures directory. make should then produce the charmrun and ChaNGa executables.

Gas Cooling

Configure ChaNGa with ./configure --enable-cooling=cosmo (for cooling with cosmological primordial abundances).

Use ./configure --help to see other configuration options.

Problems with Building

In version 3.2 you may get an error message:

In file included from DataManager.cpp:6:
ParallelGravity.h:501: error: ‘CkCheckpointStatusMsg’ has not been declared
The issue is that you have an outdated version of charm++. Update your version of charm++ to at least 6.7.1.

Another version skew error is:

In file included from DataManager.cpp:6:
ParallelGravity.h:14:20: error: comlib.h: No such file or directory
In file included from DataManager.cpp:6:
ParallelGravity.h:141: error: "ComlibInstanceHandle" does not name a type
In this case, your charm++ version is newer than your ChaNGa version. Update to a newer version of ChaNGa.

One common problem with MPI builds is that at the link stage, many messages of the form

machine.c:(.text+0xa5): undefined reference to `ompi_mpi_comm_world'
are printed.

This indicates that the MPI libraries are not being found. Try adding a "-lmpi" to the LDLIBS variable in the Makefile:

LDLIBS += $(STRUCTURES_PATH)/libTipsy.a -lmpi

Testing and Performance

ChaNGa has been tested and benchmarked on a number of platforms. Benchmarks are posted under ChaNGa Benchmarks.

⚠️ **GitHub.com Fallback** ⚠️