Personal vcpkg registry, triplets, and toolchain files.
The following packages are supported
- boulderdash: Simple gridworld environment implementation of Boulderdash/Emerald Mine style games.
- craftworld: A modified implementation of the Craftworld environment from Modular Multitask Reinforcement Learning with Policy Sketches.
- libpolicyts: Library for policy tree search algorithms and auxiliary utilities.
- sokoban: Implementation of Sokoban.
- tinytensor: Multi-dimensional array + automatic differentiation library with CUDA acceleration.
- tsp: Implementation of the TSP environment in a gridworld.
Create your vcpkg project
vcpkg new --applicationTo add tuero/vcpkg-registry as a git registry to your vcpkg project:
"registries": [
...
{
"kind": "git",
"repository": "https://github.com/tuero/vcpkg-registry",
"reference": "master",
"baseline": "<COMMIT_SHA>",
"packages": [
"boulderdash",
"craftworld",
"libpolicyts",
"sokoban",
"tsp",
"tinytensor",
"tsp"
]
}
]
...where <COMMIT_SHA> is the 40-character git commit sha in the registry's repository (you can find
this by clicking on the latest commit here and looking
at the URL.
You can also find the latest <COMMIT_SHA> by entering the following:
git ls-remote https://github.com/tuero/vcpkg-registry HEADCopy one of the ports/ files and make a new directory for the package.
To get the SHA512, remove the package if it exists, try to add it again
with a SHA512 0,
and look at the error message to get the SHA512.
vcpkg remove MY_PACKAGE
vcpkg install MY_PACKAGE --overlay-ports=./portsThen, update the versions database (below)
Run the following
vcpkg --x-builtin-ports-root=./ports --x-builtin-registry-versions-dir=./versions x-add-version --all --verboseThe default vcpkg toolchains do not respect the CC and CXX environment variables.
I've copied those defaults, but made the following changes:
- Respects
CC,CXX, andFC - Disables cross compiling
When using GCC on OSX, libstdc++ expects quick_exit/at_quick_exit to be visible in the SDK headers, which requires _DARWIN_C_SOURCE.
The OSX toolchain sets this when using GCC.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93469
Additionally, libpolicyts uses the environment variable LIBTORCH_ROOT to libtorch
(usually from a conda environment),
but this is not part of the vcpkg pacakge ABI by default.
This is usually done in the triplets, which can put environment variables into the ABI,
which is what the included triplets do.
I've made versions for Linux/OSX (arm64), with both dynamic and static linking.
To use these toolchains/triplets, set the following cache variables (preferably in CMakePresets.json)
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets",
"VCPKG_TARGET_TRIPLET": "x64-linux-static",
"VCPKG_HOST_TRIPLET": "x64-linux-static",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/cmake/toolchains/linux-toolchain.cmake"
}To use the toolchain directly when invoking cmake:
cmake --toolchain <PATH>/toolchains/<FILE>.cmake <ARGS> ..