STCE Chair Software Lab Description
You need to have CMake and OpenMPI installed. If you want to format the code, you also need to have ClangFormat installed. For testing, we use Google Test, but you don't need to install it.
sudo apt-get install cmake
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev
sudo apt-get install clang-format
sudo apt-get install valgrind valgrind-mpiTo compile, run the tests, and install:
make
make test
sudo make installHere is a full list of the available commands:
make build # Same as make
make run
make debug
make test
make test_verbose
make install
make uninstall
make format
make cleanWe use vcpkg as a package manager. Follow the instructions on the GitHub page to install it. Then you can install the required packages with:
vcpkg installClangFormat is already configured in the .clang-format file and will
automatically be used by CLion. You can use this
setup to configure CLion to
use OpenMPI.
Install the clang-format extension and configure it according to the extension's instructions. Also, install the CMake Tools extension and GDB.
sudo apt-get install gdb.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "CMake build",
"command": "sh",
"args": ["cmd/build.sh"],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Build and Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/cologra",
"cwd": "${workspaceFolder}",
"externalConsole": false,
"showDisplayString": true,
"preLaunchTask": "CMake build",
"stopAtEntry": false,
"miDebuggerPath": "/usr/bin/gdb"
}
]
}When trying to run on the cluster, I got the following error:
build/src/cologra_cli: symbol lookup error: build/src/cologra_cli: undefined symbol: __libm_feature_flagTo fix this, I compiled using GCCcore/.11.3.0 instead of the standard
compiler. To unload the Intel compiler, use:
module unload intel-compilers/2022.1.0