The example codes provided here demonstrate the use of of various xSDK libraries in tandem to solve problems of interest. Each of the library folders has one or more examples codes that are built of that library and utilize code integrations with other xSDK libraries. Running these example codes and examining the output is a good way to better understand how these libraries can work together. The code samples are a good place to start for new projects. More details about the examples can be found in the README.md files in the library subfolders. For more information on the xSDK see https://xsdk.info/.
These examples were tested and verified against [email protected].
These examples are currently in the repo but will not be enabled in the xsdk-examples spack package until we release a new version of the xSDK. They can still be built using CMake directly.
The examples can be installed along with the xSDK utilizing the Spack package.
spack install xsdk-examples
To install with CUDA support,
spack install xsdk-examples+cuda cuda_arch=<arch>
Since xsdk-examples
depends on the xsdk
Spack package, Spack will also install xsdk
. In some cases, it may be easier to install the xsdk
package (separately) following https://xsdk.info/download/ prior to the xsdk-examples
package.
Alternatively the examples can be built and installed with CMake directly:
git clone https://github.com/xsdk-project/xsdk-examples
cmake -DCMAKE_PREFIX_PATH=/path/to/libraries -DENABLE_CUDA=<TRUE|FALSE> -DENABLE_HIP=<TRUE|FALSE> -S xsdk-examples/ -B xsdk-examples/builddir
cd xsdk-examples/builddir
make
make install
Note, that to build with HIP support CMake must be used directly.
xsdk-examples is setup to use ctest
. Each example in the repository is tested with at least a set of default options. If CMake is used to build xsdk-examples, the tests can be run from the build directory (builddir
above):
ctest .
or
make test
Details on how to run each example code manually (and with different options) can be found in each example folder's README.md file.