Dear Maintainer,
please consider building lfortran with jupyter backend support.
the patch to do this is:
***
diff --git a/debian/lfortran.install b/debian/lfortran.install
index 9960ec2..ef02be8 100644
--- a/debian/lfortran.install
+++ b/debian/lfortran.install
@@ -1,6 +1,6 @@
usr/bin/lfortran
-#/usr/share/jupyter/kernels/fortran/kernel.json
-#/usr/share/jupyter/kernels/fortran/logo-svg.svg
+usr/share/jupyter/kernels/fortran/kernel.json
+usr/share/jupyter/kernels/fortran/logo-svg.svg
usr/share/lfortran/*
usr/lib/*/*.mod /usr/lib/${DEB_HOST_MULTIARCH}/fortran/lfortran-mod-0/
share/lfortran/lfortran-completion.bash /usr/share/bash-completion/completions/
diff --git a/debian/rules b/debian/rules
index a1e9227..e4042d9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,9 +13,6 @@ BUILDDIR=debian/build
execute_before_dh_auto_clean:
rm -fr $(BUILDDIR) version
-# -DWITH_XEUS=yes for Jupyter kernel support
-# not currently compiling ?
-
ARCH_FLAGS=$(if $(filter $(DEB_TARGET_ARCH), riscv64), -march=rv64gc -mabi=lp64d,)
@@ -38,7 +35,7 @@ override_dh_auto_configure:
-DWITH_FMT=yes \
-DWITH_BFD=yes \
-DLLVM_DIR=/usr/lib/llvm-21/cmake \
- -DWITH_XEUS=no \
+ -DWITH_XEUS=yes \
-DWITH_KOKKOS=no \
-DWITH_MLIR=yes \
-DCMAKE_Fortran_MODULE_DIRECTORY=/usr/lib/$(DEB_HOST_MULTIARCH)/fortran/lfortran-mod-0 \
***
Also, it would be nice to have the newest lfortran in stable-backports.
I actually built this package on debian-stable using llvm-19 (since the stable-backports version of llvm-21 is currently missing the openmp library).
The additional changes needed to build on debian stable (and this is what I actually tested) are:
***
diff --git a/debian/control b/debian/control
index 838d672..df15d7c 100644
--- a/debian/control
+++ b/debian/control
@@ -11,11 +11,10 @@ Build-Depends: debhelper-compat (= 13),
python3,
libfmt-dev,
libedit-dev,
- libsframe-dev,
- llvm-21-dev [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
+ llvm-19-dev [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
libunwind-dev [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
- libmlir-21-dev [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
- mlir-21-tools [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
+ libmlir-19-dev [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
+ mlir-19-tools [!armhf !hurd-i386 !sparc64 !powerpc !alpha !hppa !loong64 !m68k !sh4 !x32],
libjsoncpp-dev,
binutils-dev,
libiberty-dev,
@@ -33,7 +32,7 @@ Architecture: any
Provides: fortran-compiler, lfortran-mod-0
Built-Using: ${Built-Using}
Depends: ${misc:Depends}, ${shlibs:Depends}, liblfortran-runtime0 ( = ${binary:Version}),
- clang-21,
+ clang-19,
python3:any ,
liblfortran-dev ( = ${binary:Version}),
Description: Modern interactive LLVM-based Fortran compiler
diff --git a/debian/lfortran.install b/debian/lfortran.install
index 9960ec2..ef02be8 100644
--- a/debian/lfortran.install
+++ b/debian/lfortran.install
@@ -1,6 +1,6 @@
usr/bin/lfortran
-#/usr/share/jupyter/kernels/fortran/kernel.json
-#/usr/share/jupyter/kernels/fortran/logo-svg.svg
+usr/share/jupyter/kernels/fortran/kernel.json
+usr/share/jupyter/kernels/fortran/logo-svg.svg
usr/share/lfortran/*
usr/lib/*/*.mod /usr/lib/${DEB_HOST_MULTIARCH}/fortran/lfortran-mod-0/
share/lfortran/lfortran-completion.bash /usr/share/bash-completion/completions/
diff --git a/debian/patches/series b/debian/patches/series
index 2e69332..9e38819 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,7 @@
# shared-zlib.patch
# static zstd is needed for BFD if LLVM not used
# shared-zstd.patch
-clang-21.patch
+# clang-21.patch
static-bfd.patch
cmake-version.patch
build-script.patch
diff --git a/debian/rules b/debian/rules
index a1e9227..a7375de 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,9 +13,6 @@ BUILDDIR=debian/build
execute_before_dh_auto_clean:
rm -fr $(BUILDDIR) version
-# -DWITH_XEUS=yes for Jupyter kernel support
-# not currently compiling ?
-
ARCH_FLAGS=$(if $(filter $(DEB_TARGET_ARCH), riscv64), -march=rv64gc -mabi=lp64d,)
@@ -37,12 +34,12 @@ override_dh_auto_configure:
-DWITH_LSP=yes \
-DWITH_FMT=yes \
-DWITH_BFD=yes \
- -DLLVM_DIR=/usr/lib/llvm-21/cmake \
- -DWITH_XEUS=no \
+ -DLLVM_DIR=/usr/lib/llvm-19/cmake \
+ -DWITH_XEUS=yes \
-DWITH_KOKKOS=no \
-DWITH_MLIR=yes \
-DCMAKE_Fortran_MODULE_DIRECTORY=/usr/lib/$(DEB_HOST_MULTIARCH)/fortran/lfortran-mod-0 \
- -DCMAKE_PREFIX_PATH=/usr/lib/llvm-21/lib/cmake/mlir
+ -DCMAKE_PREFIX_PATH=/usr/lib/llvm-19/lib/cmake/mlir
override_dh_gencontrol:
@@ -57,7 +54,7 @@ override_dh_auto_test:
@echo Bypass tests on this build
override_dh_shlibdeps:
- dh_shlibdeps -l/usr/lib/llvm-21/lib -- --ignore-missing-info
+ dh_shlibdeps -l/usr/lib/llvm-19/lib -- --ignore-missing-info
override_dh_dwz:
@echo "DWZ fails on .debug_attr sections in some archs; don't use"
***
cheers, daniel