Skip to content

Commit

Permalink
Merge pull request #11 from LIHPC-Computational-Geometry/documentation
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
lelandaisb committed Sep 19, 2023
2 parents 9898bb3 + f904697 commit aaf87be
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 8 deletions.
11 changes: 5 additions & 6 deletions dockerfiles/Dockerfile.spack-mgx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ 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 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 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 &&\
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 &&\
Expand All @@ -41,7 +39,8 @@ 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 py-pytest &&\
spack add mgx +doc ~smooth3d^vtk-maillage~opengl2+qt &&\
spack install --no-checksum &&\
rm -rf /spack/var/spack/cache/*
#==========================================
21 changes: 19 additions & 2 deletions meshing/packages/mgx/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -57,7 +58,22 @@ class Mgx(CMakePackage):
depends_on('lima')
# depends_on('experimentalroom')
depends_on('pkgconfig', type=('build'))


depends_on("texlive scheme='small'", when="+doc")
depends_on("py-breathe", when="+doc")
depends_on("[email protected]", when="+doc")
depends_on("[email protected]", 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= [
self.define_from_variant('USE_DKOC', 'dkoc'),
Expand All @@ -77,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:
Expand Down
32 changes: 32 additions & 0 deletions meshing_supersede/packages/libxpm/package.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit aaf87be

Please sign in to comment.