From e5db91f88826482793671683c5a61e06e57dcff0 Mon Sep 17 00:00:00 2001 From: davidcortesortuno Date: Fri, 11 Feb 2022 23:18:50 +0100 Subject: [PATCH 1/2] Added config files to make a flatpak package --- ....github.computationalmodelling.Fidimag.yml | 73 +++++++++++++++++++ flatpak/requirements.txt | 4 + 2 files changed, 77 insertions(+) create mode 100644 flatpak/io.github.computationalmodelling.Fidimag.yml create mode 100644 flatpak/requirements.txt diff --git a/flatpak/io.github.computationalmodelling.Fidimag.yml b/flatpak/io.github.computationalmodelling.Fidimag.yml new file mode 100644 index 00000000..50de153d --- /dev/null +++ b/flatpak/io.github.computationalmodelling.Fidimag.yml @@ -0,0 +1,73 @@ +# Some refs: https://github.com/flathub/org.octave.Octave/blob/master/org.octave.Octave.yaml +app-id: io.github.computationalmodelling.Fidimag +runtime: org.freedesktop.Platform +runtime-version: '21.08' +sdk: org.freedesktop.Sdk +modules: + + - name: openblas + no-autogen: true + make-args: + - DYNAMIC_ARCH=1 + - DYNAMIC_OLDER=1 + - FC=gfortran + - NO_LAPACKE=1 + - TARGET=GENERIC + - USE_OPENMP=1 ## OpenMP off by default, this hack skips 'test_fork' which crashes on i386 + make-install-args: + - PREFIX=/app + sources: + - type: archive + url: https://github.com/xianyi/OpenBLAS/archive/v0.3.19.tar.gz + sha256: 947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562 + x-checker-data: + type: anitya + project-id: 2540 + url-template: https://github.com/xianyi/OpenBLAS/archive/v$version.tar.gz + + - name: sundials + buildsystem: cmake + builddir: true + sources: + - type: archive + path: "sundials-2.6.2.tar.gz" + config-opts: + - -DBUILD_STATIC_LIBS=OFF + - -DBUILD_SHARED_LIBS=ON + - -DEXAMPLES_ENABLE=OFF + - -DLAPACK_ENABLE=ON + - -DOPENMP_ENABLE=ON + + - name: fftw + buildsystem: autotools + builddir: true + sources: + - type: archive + path: "fftw-3.3.8.tar.gz" + config-opts: + - --quiet + - --enable-shared + - --enable-openmp + + - name: python_deps + buildsystem: simple + build-commands: + - python3 -m pip install --prefix=/app --no-deps cython numpy scipy + build-options: + build-args: + - --share=network + + - name: fidimag_install + buildsystem: simple + build-commands: + - python3 -m ../setup.py build_ext --inplace -j2 + build-options: + build-args: + - --share=network + sources: + - type: git + url: https://github.com/computationalmodelling/fidimag + tag: v3.0 + +finish-args: + - --filesystem=home:rw diff --git a/flatpak/requirements.txt b/flatpak/requirements.txt new file mode 100644 index 00000000..b4de0ad7 --- /dev/null +++ b/flatpak/requirements.txt @@ -0,0 +1,4 @@ +setuptools_scm +numpy +scipy +cython From 871bc225c7a0d842350ccfb2a90ec0864c63ce68 Mon Sep 17 00:00:00 2001 From: davidcortesortuno Date: Fri, 11 Feb 2022 23:36:08 +0100 Subject: [PATCH 2/2] Tuning flatpak deps and fidimag build --- flatpak/io.github.computationalmodelling.Fidimag.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flatpak/io.github.computationalmodelling.Fidimag.yml b/flatpak/io.github.computationalmodelling.Fidimag.yml index 50de153d..2f04efec 100644 --- a/flatpak/io.github.computationalmodelling.Fidimag.yml +++ b/flatpak/io.github.computationalmodelling.Fidimag.yml @@ -3,6 +3,10 @@ app-id: io.github.computationalmodelling.Fidimag runtime: org.freedesktop.Platform runtime-version: '21.08' sdk: org.freedesktop.Sdk +build-options: + env: + PATH: /app/bin:/usr/bin + PYTHON: python3 modules: - name: openblas @@ -60,7 +64,7 @@ modules: - name: fidimag_install buildsystem: simple build-commands: - - python3 -m ../setup.py build_ext --inplace -j2 + - python3 -m setup.py build_ext --inplace -j2 build-options: build-args: - --share=network @@ -71,3 +75,5 @@ modules: finish-args: - --filesystem=home:rw + - --env=LD_LIBRARY_PATH=/app/lib +# - --env=PYTHONPATH=/app/lib