Skip to content

Commit

Permalink
Merge conda recipes to the central repository
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 10, 2023
1 parent c0f1f85 commit 4f9e512
Show file tree
Hide file tree
Showing 16 changed files with 542 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# N.B. Only works with git client 1.7.2+
* text=auto

# All bat files should keep CRLF line endings
*.bat text eol=crlf

# Some XML files are slightly larger than the allowed limit but they
# should compress well
*.xml hooks.MaxObjectKiB130902=2048
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ repos:
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^conda/recipes

- repo: https://github.com/mantidproject/pre-commit-hooks.git
rev: 82e4b72a17c058d99f510771e3f531fb98c3fe73
Expand Down
66 changes: 66 additions & 0 deletions conda/recipes/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
c_compiler:
- gcc # [linux]
- clang # [osx]
- vs2019 # [win]
c_compiler_version: # [unix]
- 13 # [osx]
- 10 # [linux]
cxx_compiler:
- gxx # [linux]
- clangxx # [osx]
- vs2019 # [win]
cxx_compiler_version: # [unix]
- 13 # [osx]
- 10 # [linux]
llvm_openmp: # [osx]
- 13 # [osx]

python:
- 3.8

boost:
- 1.77

numpy:
- 1.19

matplotlib:
- 3.5.*

openssl:
- 1.1.1l.*

setuptools:
- 48.0.*

sphinx:
- 5.1.1

sphinx_bootstrap_theme:
- 0.8.1

qt:
- 5.12.*

tbb:
- 2020.2.*

hdf5:
- 1.10.*

occt:
- 7.5.*

gsl:
- 2.7

ipykernel:
- <6

pin_run_as_build:
boost:
max_pin: x.x

# Otherwise it will find the wrong sdk, currently working on 10.10 as that is what Anaconda/conda-build does.
CONDA_BUILD_SYSROOT:
- /opt/MacOSX10.10.sdk # [osx]
21 changes: 21 additions & 0 deletions conda/recipes/mantid/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mkdir build && cd build

cmake ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCONDA_BUILD=True ^
-DCONDA_ENV=True ^
-DENABLE_PRECOMMIT=OFF ^
-DENABLE_DOCS=OFF ^
-DWORKBENCH_SITE_PACKAGES=%SP_DIR% ^
-DMANTID_FRAMEWORK_LIB=BUILD ^
-DMANTID_QT_LIB=OFF ^
-DCPACK_PACKAGE_SUFFIX="" ^
-DENABLE_WORKBENCH=OFF ^
..

if errorlevel 1 exit 1
cmake --build . --config Release
cmake --build . --config Release --target install
if errorlevel 1 exit 1
28 changes: 28 additions & 0 deletions conda/recipes/mantid/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -ex

mkdir build
cd build

cmake \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DHDF5_ROOT=$PREFIX \
-DOpenSSL_ROOT=$PREFIX \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DENABLE_DOCS=OFF \
-DWORKBENCH_SITE_PACKAGES=$SP_DIR \
-DENABLE_PRECOMMIT=OFF \
-DCONDA_BUILD=True \
-DCONDA_ENV=True \
-DUSE_PYTHON_DYNAMIC_LIB=OFF \
-DMANTID_FRAMEWORK_LIB=BUILD \
-DMANTID_QT_LIB=OFF \
-DCPACK_PACKAGE_SUFFIX="" \
-DENABLE_WORKBENCH=OFF \
-GNinja \
../

ninja
ninja install
77 changes: 77 additions & 0 deletions conda/recipes/mantid/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{% set data = load_setup_py_data() %}

package:
name: mantid
version: {{ data.get('version', '0.0.0') }}

source:
path: ../../../

build:
number: 0
run_exports:
- {{ pin_subpackage('mantid', max_pin='x.x.x') }}

requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- llvm-openmp # [osx]
- libgomp # [linux]
- ninja # [unix]
- cmake
- git
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- {{ cdt('libx11-devel') }} # [linux]
- {{ cdt('xorg-x11-proto-devel') }} # [linux]
host:
- boost {{ boost }}
- eigen
- gsl {{ gsl }}
- h5py
- hdf5 {{ hdf5 }}
- jemalloc # [unix]
- jsoncpp
- librdkafka
- lib3mf # [win]
- muparser
- nexus
- numpy {{ numpy }}
- occt {{ occt }}
- python {{ python }}
- poco
- tbb-devel {{ tbb }}
- zlib
- pip
- openssl {{ openssl }}
- versioningit
run:
- {{ pin_compatible("boost", max_pin="x.x") }}
- {{ pin_compatible("gsl", max_pin="x.x") }}
- h5py
- {{ pin_compatible("hdf5", max_pin="x.x") }}
- lib3mf # [win]
- nexus
- {{ pin_compatible("numpy") }}
- {{ pin_compatible("occt", max_pin="x.x.x") }}
- python
- python-dateutil
- pyyaml
- scipy
- openssl {{ openssl }}
- euphonic=0.6.*
- toml

about:
home: https://github.com/mantidproject/mantid
license: GPL-3.0-or-later
summary: Mantid provides a framework that supports high-performance computing and visualisation of materials science data.
description: Mantid provides a framework that supports high-performance computing and visualisation of materials science data. To use the optional plotting sub package you must pip install matplotlib 3.1.3 to ensure correct compatibility.

extra:
recipe-maintainers:
- thomashampson
- sf1919
- martyngigg
9 changes: 9 additions & 0 deletions conda/recipes/mantid/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Turn off network required things that the framework does
from mantid.kernel import ConfigService
ConfigService["UpdateInstrumentDefinitions.OnStartup"] = "0"
ConfigService["usagereports.enabled"] = "0"
ConfigService["CheckMantidVersion.OnStartup"] = "0"

import mantid.simpleapi as sapi

assert "Load" in dir(sapi)
2 changes: 2 additions & 0 deletions conda/recipes/mantiddocs/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Support for building this package on windows has not been added yet."
exit 1
61 changes: 61 additions & 0 deletions conda/recipes/mantiddocs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -ex

# QtHelp docs build needs to start a QApplication so we need an X server on Linux
XVFB_SERVER_NUM=101

function run_with_xvfb {
if [[ $OSTYPE == "linux"* ]]; then
# Use -e because a bug on RHEL7 means --error-file produces an error:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=337703;msg=2
# Use -noreset because of an X Display bug caused by a race condition in xvfb:
# https://gitlab.freedesktop.org/xorg/xserver/-/issues/1102
xvfb-run -e /dev/stderr --server-args="-core -noreset -screen 0 640x480x24" \
--server-num=${XVFB_SERVER_NUM} $@
else
eval $@
fi
}

function terminate_xvfb_sessions {
if [[ $OSTYPE == "linux"* ]]; then
echo "Terminating any existing Xvfb sessions"

# Kill Xvfb processes
killall Xvfb || true

# Remove Xvfb X server lock files
rm -f /tmp/.X${XVFB_SERVER_NUM}-lock || true
fi
}

mkdir build
cd build

cmake \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DMANTID_FRAMEWORK_LIB=SYSTEM \
-DMANTID_QT_LIB=SYSTEM \
-DENABLE_WORKBENCH=OFF \
-DENABLE_DOCS=ON \
-DDOCS_DOTDIAGRAMS=ON \
-DDOCS_SCREENSHOTS=ON \
-DDOCS_MATH_EXT=sphinx.ext.imgmath \
-DDOCS_PLOTDIRECTIVE=ON \
-DPACKAGE_DOCS=ON \
-DENABLE_PRECOMMIT=OFF \
-DCONDA_BUILD=True \
-DCONDA_ENV=True \
-DUSE_PYTHON_DYNAMIC_LIB=OFF \
-DQt5_DIR=$BUILD_PREFIX/lib/cmake/qt5 \
-DCPACK_PACKAGE_SUFFIX="" \
-GNinja \
../

cmake --build .
run_with_xvfb cmake --build . --target docs-qthelp
terminate_xvfb_sessions
cmake --build . --target install
55 changes: 55 additions & 0 deletions conda/recipes/mantiddocs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% set data = load_setup_py_data() %}

package:
name: mantiddocs
version: {{ data.get('version', '0.0.0') }}

source:
path: ../../../

source:
url: https://github.com/mantidproject/mantid/archive/{{ git_commit }}.tar.gz
sha256: 80ff0d522229ea55e155e7c131acb948d92cb464e5422e66b8d4d13efaeac561

build:
noarch: generic
number: 0
ignore_run_exports_from:
- {{ compiler('cxx') }}
- python

requirements:
build:
- {{ compiler("cxx") }}
- ninja # [unix]
- cmake
- git
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- {{ cdt('libx11-devel') }} # [linux]
- {{ cdt('xorg-x11-proto-devel') }} # [linux]
host:
- python
- setuptools {{ setuptools }}
- sphinx {{ sphinx }}
- sphinx_bootstrap_theme
- mantidqt {{ version }}

# there are no run requirements as it's just pure html

test:
files:
- share/doc/index.html
- share/doc/mantid.png

about:
home: https://github.com/mantidproject/mantid
license: GPL-3.0-or-later
summary: The QtHelp documentation for mantid

extra:
recipe-maintainers:
- thomashampson
- sf1919
- martyngigg
22 changes: 22 additions & 0 deletions conda/recipes/mantidqt/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
mkdir build && cd build

cmake ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_LIBDIR=%LIBRARY_LIB% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCONDA_BUILD=True ^
-DCONDA_ENV=True ^
-DENABLE_PRECOMMIT=OFF ^
-DENABLE_DOCS=OFF ^
-DWORKBENCH_SITE_PACKAGES=%SP_DIR% ^
-DMANTID_FRAMEWORK_LIB=SYSTEM ^
-DMANTID_QT_LIB=BUILD ^
-DCPACK_PACKAGE_SUFFIX="" ^
-DENABLE_WORKBENCH=OFF ^
-DUSE_PRECOMPILED_HEADERS=OFF ^
..

if errorlevel 1 exit 1
cmake --build . --config Release
cmake --build . --config Release --target install
if errorlevel 1 exit 1
29 changes: 29 additions & 0 deletions conda/recipes/mantidqt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -ex

mkdir build
cd build

cmake \
${CMAKE_ARGS} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DHDF5_ROOT=$PREFIX \
-DOpenSSL_ROOT=$PREFIX \
-DENABLE_DOCS=OFF \
-DWORKBENCH_SITE_PACKAGES=$SP_DIR \
-DENABLE_PRECOMMIT=OFF \
-DCONDA_BUILD=True \
-DCONDA_ENV=True \
-DUSE_PYTHON_DYNAMIC_LIB=OFF \
-DMANTID_FRAMEWORK_LIB=SYSTEM \
-DMANTID_QT_LIB=BUILD \
-DENABLE_WORKBENCH=OFF \
-DQt5_DIR=$PREFIX/lib/cmake/qt5 \
-DCPACK_PACKAGE_SUFFIX="" \
-GNinja \
../

ninja
ninja install
Loading

0 comments on commit 4f9e512

Please sign in to comment.