From cd5969d0a6cdadff467884c118c82ae3d4ea02af Mon Sep 17 00:00:00 2001 From: Benoit LELANDAIS Date: Wed, 13 Sep 2023 10:35:52 +0200 Subject: [PATCH 1/5] First test to build doc with Spack --- dockerfiles/Dockerfile.spack-mgx | 13 +++++++++---- meshing/packages/mgx/package.py | 9 ++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dockerfiles/Dockerfile.spack-mgx b/dockerfiles/Dockerfile.spack-mgx index 2ffb6ad..dc34811 100644 --- a/dockerfiles/Dockerfile.spack-mgx +++ b/dockerfiles/Dockerfile.spack-mgx @@ -21,10 +21,9 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #========================================== # 04/23: graphviz, sphinx and pip added. Used by mgx documentation RUN apt update &&\ - apt install -y build-essential cmake python3 python3-distutils python3-venv unzip zip curl git libxt-dev libgl-dev gfortran autoconf pkg-config lsb-release file &&\ - apt install -y graphviz sphinx pip &&\ + apt install -y build-essential cmake python3 python3-distutils unzip zip curl git libxt-dev libgl-dev gfortran autoconf pkg-config lsb-release file &&\ + apt install -y graphviz &&\ apt clean &&\ - pip install -U pytest &&\ rm -rf /var/lib/apt/lists/* #========================================== RUN git clone --depth=1 -b v${SPACK_VERSION} https://github.com/spack/spack.git &&\ @@ -41,7 +40,13 @@ RUN source /spack/share/spack/setup-env.sh &&\ RUN source /spack/share/spack/setup-env.sh &&\ spack env create meshing-env &&\ spack env activate meshing-env &&\ - spack add mgx~smooth3d^vtk-maillage~opengl2+qt &&\ + spack add texlive +full &&\ + spack add py-breathe &&\ + spack add py-sphinx@6.2.1 &&\ + spack add py-sphinx-rtd-theme &&\ + spack add py-sphinx-copybutton &&\ + spack add py-pytest &&\ + spack add mgx +doc ~smooth3d^vtk-maillage~opengl2+qt &&\ spack install --no-checksum &&\ rm -rf /spack/var/spack/cache/* #========================================== diff --git a/meshing/packages/mgx/package.py b/meshing/packages/mgx/package.py index a68a73c..32fa85e 100644 --- a/meshing/packages/mgx/package.py +++ b/meshing/packages/mgx/package.py @@ -23,6 +23,7 @@ class Mgx(CMakePackage): # 2023/06/02 - BL: Waiting for a GitHub smooth3d version, True ==> False variant('smooth3d', default=False, description='Utilisation de la bibliotheque de lissage volumique Smooth3D') variant('triton2', default=True, description='Utilisation du mailleur tetraedrique Tetgen') + variant('doc', default=False, description='Installation de la documentation utilisateur') version('2.2.4', sha256='09753f649955dcbcfed4debf13c06fb143d369da71c9ce000f7ae0c9478282e4') version('2.2.3', sha256='10d3942a650af103bc22f00ccb915470bac4f50c8b43432fcf913db8855f8be1') @@ -57,7 +58,13 @@ class Mgx(CMakePackage): depends_on('lima') # depends_on('experimentalroom') depends_on('pkgconfig', type=('build')) - + + depends_on("texlive +full", when="+doc") + depends_on("py-breathe", when="+doc") + depends_on("py-sphinx", when="+doc") + depends_on("py-sphinx-rtd-theme", when="+doc") + depends_on("py-sphinx-copybutton", when="+doc") + def cmake_args(self): args= [ self.define_from_variant('USE_DKOC', 'dkoc'), From b3eda61d882384d10297da72134cd1a8d84f2356 Mon Sep 17 00:00:00 2001 From: Benoit LELANDAIS Date: Wed, 13 Sep 2023 12:05:53 +0200 Subject: [PATCH 2/5] Install doc update --- dockerfiles/Dockerfile.spack-mgx | 5 ++--- meshing/packages/mgx/package.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dockerfiles/Dockerfile.spack-mgx b/dockerfiles/Dockerfile.spack-mgx index dc34811..4d5063e 100644 --- a/dockerfiles/Dockerfile.spack-mgx +++ b/dockerfiles/Dockerfile.spack-mgx @@ -21,8 +21,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #========================================== # 04/23: graphviz, sphinx and pip added. Used by mgx documentation RUN apt update &&\ - apt install -y build-essential cmake python3 python3-distutils unzip zip curl git libxt-dev libgl-dev gfortran autoconf pkg-config lsb-release file &&\ - apt install -y graphviz &&\ + apt install -y build-essential cmake python3 python3-distutils unzip zip curl git libxt-dev libgl-dev gfortran autoconf pkg-config lsb-release file graphviz &&\ apt clean &&\ rm -rf /var/lib/apt/lists/* #========================================== @@ -40,7 +39,7 @@ RUN source /spack/share/spack/setup-env.sh &&\ RUN source /spack/share/spack/setup-env.sh &&\ spack env create meshing-env &&\ spack env activate meshing-env &&\ - spack add texlive +full &&\ + spack add texlive scheme=full &&\ spack add py-breathe &&\ spack add py-sphinx@6.2.1 &&\ spack add py-sphinx-rtd-theme &&\ diff --git a/meshing/packages/mgx/package.py b/meshing/packages/mgx/package.py index 32fa85e..9116d42 100644 --- a/meshing/packages/mgx/package.py +++ b/meshing/packages/mgx/package.py @@ -59,7 +59,7 @@ class Mgx(CMakePackage): # depends_on('experimentalroom') depends_on('pkgconfig', type=('build')) - depends_on("texlive +full", when="+doc") + depends_on("texlive scheme='full'", when="+doc") depends_on("py-breathe", when="+doc") depends_on("py-sphinx", when="+doc") depends_on("py-sphinx-rtd-theme", when="+doc") From 2576f0c6ef517632f41753667dca6f8048272f8e Mon Sep 17 00:00:00 2001 From: Benoit LELANDAIS Date: Thu, 14 Sep 2023 09:00:14 +0200 Subject: [PATCH 3/5] Bug fix --- dockerfiles/Dockerfile.spack-mgx | 9 ++------- meshing/packages/mgx/package.py | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/dockerfiles/Dockerfile.spack-mgx b/dockerfiles/Dockerfile.spack-mgx index 4d5063e..162fa0f 100644 --- a/dockerfiles/Dockerfile.spack-mgx +++ b/dockerfiles/Dockerfile.spack-mgx @@ -19,7 +19,7 @@ SHELL ["/bin/bash", "-c"] ENV TZ=Europe/Paris RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #========================================== -# 04/23: graphviz, sphinx and pip added. Used by mgx documentation +# 04/23: graphviz added for mgx documentation RUN apt update &&\ apt install -y build-essential cmake python3 python3-distutils unzip zip curl git libxt-dev libgl-dev gfortran autoconf pkg-config lsb-release file graphviz &&\ apt clean &&\ @@ -27,7 +27,7 @@ RUN apt update &&\ #========================================== RUN git clone --depth=1 -b v${SPACK_VERSION} https://github.com/spack/spack.git &&\ git clone --depth=1 https://github.com/LIHPC-Computational-Geometry/spack_recipes.git &&\ - cp spack_recipes/config/packages.yaml /spack/etc/spack/ + cp /spack_recipes/config/packages.yaml /spack/etc/spack/ RUN source /spack/share/spack/setup-env.sh &&\ spack repo add ./spack_recipes/meshing &&\ @@ -39,11 +39,6 @@ RUN source /spack/share/spack/setup-env.sh &&\ RUN source /spack/share/spack/setup-env.sh &&\ spack env create meshing-env &&\ spack env activate meshing-env &&\ - spack add texlive scheme=full &&\ - spack add py-breathe &&\ - spack add py-sphinx@6.2.1 &&\ - spack add py-sphinx-rtd-theme &&\ - spack add py-sphinx-copybutton &&\ spack add py-pytest &&\ spack add mgx +doc ~smooth3d^vtk-maillage~opengl2+qt &&\ spack install --no-checksum &&\ diff --git a/meshing/packages/mgx/package.py b/meshing/packages/mgx/package.py index 9116d42..fff776a 100644 --- a/meshing/packages/mgx/package.py +++ b/meshing/packages/mgx/package.py @@ -59,9 +59,9 @@ class Mgx(CMakePackage): # depends_on('experimentalroom') depends_on('pkgconfig', type=('build')) - depends_on("texlive scheme='full'", when="+doc") + depends_on("texlive scheme='minimal'", when="+doc") depends_on("py-breathe", when="+doc") - depends_on("py-sphinx", when="+doc") + depends_on("py-sphinx@6.2.1", when="+doc") depends_on("py-sphinx-rtd-theme", when="+doc") depends_on("py-sphinx-copybutton", when="+doc") From ba759f2378b11c331375005f66afbe0759886ca2 Mon Sep 17 00:00:00 2001 From: Benoit LELANDAIS Date: Tue, 19 Sep 2023 14:10:28 +0200 Subject: [PATCH 4/5] Coming from Spack develop branch and to remove if Spack version > 0.20.1 --- meshing_supersede/packages/libxpm/package.py | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meshing_supersede/packages/libxpm/package.py diff --git a/meshing_supersede/packages/libxpm/package.py b/meshing_supersede/packages/libxpm/package.py new file mode 100644 index 0000000..bbdad61 --- /dev/null +++ b/meshing_supersede/packages/libxpm/package.py @@ -0,0 +1,32 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Libxpm(AutotoolsPackage, XorgPackage): + """libXpm - X Pixmap (XPM) image file format library.""" + + homepage = "https://cgit.freedesktop.org/xorg/lib/libXpm" + xorg_mirror_path = "lib/libXpm-3.5.12.tar.gz" + + version("3.5.12", sha256="2523acc780eac01db5163267b36f5b94374bfb0de26fc0b5a7bee76649fd8501") + version("3.5.11", sha256="53ddf924441b7ed2de994d4934358c13d9abf4828b1b16e1255ade5032b31df7") + version("3.5.10", sha256="f73f06928a140fd2090c439d1d55c6682095044495af6bf886f8e66cf21baee5") + version("3.5.9", sha256="23beb930e27bc7df33cb0f6dbffc703852297c311b7e20146ff82e9a51f3e358") + version("3.5.8", sha256="06472c7fdd175ea54c84162a428be19c154e7dda03d8bf91beee7f1d104669a6") + version("3.5.7", sha256="422fbb311c4fe6ef337e937eb3adc8617a4320bd3e00fce06850d4360829b3ae") + + depends_on("gettext") + depends_on("libx11") + + depends_on("xproto") + depends_on("pkgconfig", type="build") + depends_on("util-macros", type="build") + + def flag_handler(self, name, flags): + if name == "ldflags" and "intl" in self.spec["gettext"].libs.names: + flags.append("-lintl") + return env_flags(name, flags) From f9046975fad131c2ce6b6dc2efe8b75c6cd594c1 Mon Sep 17 00:00:00 2001 From: Benoit LELANDAIS Date: Tue, 19 Sep 2023 14:25:17 +0200 Subject: [PATCH 5/5] Documentation integration --- meshing/packages/mgx/package.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/meshing/packages/mgx/package.py b/meshing/packages/mgx/package.py index fff776a..669d893 100644 --- a/meshing/packages/mgx/package.py +++ b/meshing/packages/mgx/package.py @@ -59,11 +59,20 @@ class Mgx(CMakePackage): # depends_on('experimentalroom') depends_on('pkgconfig', type=('build')) - depends_on("texlive scheme='minimal'", when="+doc") + depends_on("texlive scheme='small'", when="+doc") depends_on("py-breathe", when="+doc") - depends_on("py-sphinx@6.2.1", when="+doc") - depends_on("py-sphinx-rtd-theme", when="+doc") + depends_on("py-sphinx@5.3.0", when="+doc") + depends_on("py-sphinx-rtd-theme@0.5.1", when="+doc") depends_on("py-sphinx-copybutton", when="+doc") + + def setup_build_environment(self, env): + if ('doc' in self.spec.variants): + python_version = str(self.spec['python'].version).split('.') + python_dir = "python" + python_version[0] + "." + python_version[1] + + sphinx_path = self.spec['py-sphinx'].prefix + sphinx_pythonpath = join_path(sphinx_path, 'lib', python_dir, 'site-packages') + env.prepend_path('PYTHONPATH', sphinx_pythonpath) def cmake_args(self): args= [ @@ -84,11 +93,12 @@ def cmake_args(self): self.define('DKOC_LICENCE', 'unavailable') ] + if ('doc' in self.spec.variants): + args.append('-DSPHINX_WARNINGS_AS_ERRORS=OFF') if self.spec.satisfies('%intel'): args.append('-DCMAKE_CXX_FLAGS="-std=c++11"') - if self.spec['python'].version < Version('3'): args.append('-DUSE_PYTHON_3:BOOL=OFF') else: