#TODO maybe incomplete script, see https://github.com/pytorch/pytorch/blob/main/docs/libtorch.rst#building-libtorch-using-cmake [source] git = "https://github.com/pytorch/pytorch" branch = "release/2.3" [build] template = "custom" script = """ mkdir pytorch-build cd pytorch-build COOKBOOK_CONFIGURE="cmake" COOKBOOK_CONFIGURE_FLAGS=( -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING=True -DCMAKE_EXE_LINKER_FLAGS="-static" -DCMAKE_INSTALL_PREFIX="/" -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" -DCMAKE_SYSTEM_NAME=Generic -DCMAKE_SYSTEM_PROCESSOR="$(echo "${TARGET}" | cut -d - -f1)" -DCMAKE_VERBOSE_MAKEFILE=On -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX:PATH=../pytorch-install ../pytorch "${COOKBOOK_SOURCE}" ) cookbook_configure """