Skip to content

WIP: init debian package generation via cpack#561

Draft
jfdev001 wants to merge 1 commit intoCambridge-ICCS:mainfrom
jfdev001:jfrazier/499-debian-package
Draft

WIP: init debian package generation via cpack#561
jfdev001 wants to merge 1 commit intoCambridge-ICCS:mainfrom
jfdev001:jfrazier/499-debian-package

Conversation

@jfdev001
Copy link
Contributor

@jfdev001 jfdev001 commented Mar 1, 2026

Towards #499

Work in progress, just opening PR to show ongoing effort. Definitely not shippable yet.

Adds some basic cpack logic has been added to generate a debian package for FTorch. I have been able to successfully generate a debian package on an x86_64 Ubuntu 24.04 LTS machine. You can try out the debian package generation via the following commands:

git clone git@github.com:jfdev001/FTorch.git
cd FTorch
git checkout -b jfrazier/499-debian-package origin/jfrazier/499-debian-package
export Torch_DIR=<your path to cpu torch installation here> # gpu torch has not been tried
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cd build 
cpack -G DEB --config CPackConfig.cmake 

You can then inspect the generated debian package with dpkg. E.g.,

dpkg -e FTorch-1.0.0-amd64.deb

outputs DEBIAN/control which contains

Architecture: amd64
Depends: libc6 (>= 2.32), libgcc-s1 (>= 3.0), libgfortran5 (>= 8), libstdc++6 (>= 5.2)
Description: Fortran interface to PyTorch models
 FTorch is a library for calling PyTorch machine learning models directly
 from Fortran code. It enables coupling TorchScript models trained in PyTorch
 to existing Fortran applications without requiring Python at runtime.
Maintainer: Jared Frazier (cscidev001@gmail.com)
Package: ftorch
Priority: optional
Section: devel
Version: 1.0.0
Installed-Size: 296

Similarly,

dpkg -c FTorch-1.0.0-amd64.deb

outputs

drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/include/
-rw-r--r-- root/root     14079 2026-02-26 11:15 ./usr/include/ctorch.h
drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/include/ftorch/
-rw-r--r-- root/root     10342 2026-02-26 14:56 ./usr/include/ftorch/ftorch.mod
-rw-r--r-- root/root       393 2026-02-26 14:56 ./usr/include/ftorch/ftorch_devices.mod
-rw-r--r-- root/root      3404 2026-02-26 14:56 ./usr/include/ftorch/ftorch_model.mod
-rw-r--r-- root/root     10593 2026-02-26 14:56 ./usr/include/ftorch/ftorch_tensor.mod
-rw-r--r-- root/root      2037 2026-02-26 14:56 ./usr/include/ftorch/ftorch_test_utils.mod
-rw-r--r-- root/root       454 2026-02-26 14:56 ./usr/include/ftorch/ftorch_types.mod
drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/lib/
drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/lib/cmake/
drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/lib/cmake/FTorch/
-rw-r--r-- root/root      1255 2026-02-26 14:56 ./usr/lib/cmake/FTorch/FTorchConfig.cmake
-rw-r--r-- root/root       888 2026-02-26 14:56 ./usr/lib/cmake/FTorch/FTorchTargets-release.cmake
-rw-r--r-- root/root      4074 2026-02-26 14:56 ./usr/lib/cmake/FTorch/FTorchTargets.cmake
-rw-r--r-- root/root    226560 2026-02-26 14:56 ./usr/lib/libftorch.so
drwxrwxr-x root/root         0 2026-02-26 14:56 ./usr/lib/pkgconfig/
-rw-r--r-- root/root       321 2026-02-26 14:56 ./usr/lib/pkgconfig/ftorch.pc

TODO:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant