- Algorithms
- Data Structures
- Non-linear Data Structure
- Basic
- Trees
- Binary Search Tree (BST)
- Based on loop [No augmentation, no extra field
parent
]
- Based on loop [No augmentation, no extra field
- Binary Search Tree (BST)
- Trees
- Complex (based on basic)
- Trees
- Heap / Binary Heap
- Red-Black Tree
- Based on loop
- AVL Tree
- Trees
- Basic
- Non-linear Data Structure
- ...
Open project directory in CLion
Required tools:
- CMake
- Ninja
- Development Environment (Toolchain):
- Mingw-builds on Windows
- MSVC tools (cl, lm, windbg, ...) environment:([x64/x86/...] Native Tools Command Prompt for VS [20**]) - Supplied with Visual Studio. on Windows
- GNU Compiler Collection (gcc, g++, ld, gdb, ...) on *nix operating systems.
- LLVM Compiler Infrastructure (clang, clang++, lld, lldb, ...) on *nix operating systems.
- Download mingw with seh-ucrt-rt or seh-msvcrt-rt support from Mingw-builds subsection. Example: x86_64-13.1.0-release-win32-seh-ucrt-rt_v11-rev1.7z
- Unpack downloaded mingw archive.
- Add the path to mingw/bin folder in Windows environment variable "PATH" (for user and system).
Replace [...] on you paths and names.
- [project root directory] = root directory of this project wich you pulled (git clone).
- [ninja root directory] = path where ninja.exe is located.
- [configuration directory] = usually something like: "[project root directory]/build/x64-win-debug-mingw"
Configure project
[Note]: You can use CMake arguments like
- -DCMAKE_C_COMPILER
- -DCMAKE_CXX_COMPILER
- -DCMAKE_LINKER
- -DCMAKE_VERBOSE_MAKEFILE=ON - Verbose ninja, makefile, etc... or set in CMakeList.txt or use -v on build
- ...
to specify paths for tools.
cmake
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_LINKER=ld
-DCMAKE_MAKE_PROGRAM="[ninja root directory]/ninja.exe"
-G Ninja
-S "[project root directory]"
-B "[configuration directory]"
[NOTE]: For verbose ninja, makefile, etc... just use argument -v on build: cmake.exe --build ...mybuild/x64-win-debug-mingw --target all -j 6 -v
Build configuration
cmake --build "[configuration directory]" --target all -j 6
Clean
cmake --build "[configuration directory]" --target clean -j 6
Run all unit tests
ctest --test-dir "[configuration directory]"
or
ctest --extra-verbose --test-dir "[configuration directory]"
Example run only BubbleSort.
"[configuration directory]\src\Algorithms\Sort\BubbleSort\BubbleSort.exe"
If you build project for some another processor architecture you can get error like: "is not able to compile a simple test program."
Solution: Uncomment some of this lines in root CMakeLists.txt
# Fix cmake compile test "is not able to compile a simple test program."
# set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
# or
# set(CMAKE_C_COMPILER_WORKS 1)
# set(CMAKE_CXX_COMPILER_WORKS 1)
ーーーーーーーーーーーーーーーーーーーーーーーーー