Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions recipes/dmri-amico/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo [blas] >> site.cfg
echo library = blas >> site.cfg
echo library_dir = "%PREFIX%"\Library\lib >> site.cfg
echo include_dir = "%PREFIX%"\include >> site.cfg

echo [lapack] >> site.cfg
echo library = lapack >> site.cfg
echo library_dir = "%PREFIX%"\Library\lib >> site.cfg
echo include_dir = "%PREFIX%"\include >> site.cfg

"%PYTHON%" -m pip install --no-deps --ignore-installed .
12 changes: 12 additions & 0 deletions recipes/dmri-amico/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

echo "[blas]" >> site.cfg
echo "library = blas" >> site.cfg
echo "library_dir = $PREFIX/lib" >> site.cfg
echo "include_dir = $PREFIX/include" >> site.cfg
echo "[lapack]" >> site.cfg
echo "library = lapack" >> site.cfg
echo "library_dir = $PREFIX/lib" >> site.cfg
echo "include_dir = $PREFIX/include" >> site.cfg

${PYTHON} -m pip install . --no-deps -vv
61 changes: 61 additions & 0 deletions recipes/dmri-amico/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{% set name = "dmri-amico" %}
{% set version = "2.0.1" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 08fe9fe14554656fcfe9862dcdbb40f5cf9fc1cb9af5685435190110b83f1902

# allow separate libraries for lapack / blas, rather than
# assuming a single library, i.e. openblas, for both. See
# https://github.com/daducci/AMICO/pull/179
patches:
- setup.py.patch

build:
number: 0

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- python # [build_platform != target_platform]
- cython # [build_platform != target_platform]
host:
- cython
- libblas
- liblapack
- python
- pip
- spams-cython
run:
- dipy
- dmri-dicelib
- h5py >=3
- python
- numpy
- scipy
- threadpoolctl

test:
imports:
- amico
commands:
- python -c "import amico; amico.setup()"

about:
home: https://pypi.org/project/dmri-amico/
license: LicenseRef-DICE-lab
license_file: LICENSE
summary: Implementation of the linear framework for Accelerated Microstructure Imaging via Convex Optimization (AMICO) described in Daducci, Alessandro, et al. 2015
dev_url: https://github.com/daducci/AMICO/

extra:
recipe-maintainers:
- daducci
- nightwnvol
- pauldmccarthy
27 changes: 27 additions & 0 deletions recipes/dmri-amico/setup.py.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/setup.py b/setup.py
index 1c5ed51b..43583678 100644
--- a/setup.py
+++ b/setup.py
@@ -25,13 +25,15 @@ if not isfile('site.cfg'):
exit(1)
config = ConfigParser()
config.read('site.cfg')
-try:
- libraries.extend([config['openblas']['library']])
- library_dirs.extend([config['openblas']['library_dir']])
- include_dirs.extend([config['openblas']['include_dir']])
-except KeyError as err:
- print(f'\033[31mKeyError: cannot find the {err} key in the site.cfg file. See the site.cfg.example file for documentation\033[0m')
- exit(1)
+
+for lib in ('blas', 'lapack', 'openblas'):
+ if lib in config:
+ libraries.extend([config[lib]['library']])
+ library_dirs.extend([config[lib]['library_dir']])
+ include_dirs.extend([config[lib]['include_dir']])
+if len(libraries) == 0:
+ print(f'\033[31mKeyError: cannot find LAPACK/BLAS/OpenBLAS paths in the site.cfg file. See the site.cfg.example file for documentation\033[0m')
+ exit(1)

if sys.platform.startswith('win32'):
extra_compile_args.extend(['/std:c++14', '/fp:fast'])
51 changes: 51 additions & 0 deletions recipes/dmri-dicelib/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{% set name = "dmri-dicelib" %}
{% set version = "1.0.3" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 5a2e315e2bebed0cbf19e300a2328827903d77086824ae8f04b0410f65585cc2

build:
number: 0
script: {{ PYTHON }} -m pip install . --no-deps -vv

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- python # [build_platform != target_platform]
- cython # [build_platform != target_platform]
- numpy # [build_platform != target_platform]
host:
- cython
- numpy
- pip
- python
run:
- dipy
- h5py >=3
- {{ pin_compatible('numpy') }}
- python
- scipy

test:
imports:
- dicelib

about:
home: https://pypi.org/project/dmri-dicelib/
license: LicenseRef-DICE-lab
license_file: LICENSE
summary: Various algorithms developed by the DICE lab to process/manipulate diffusion MRI objects, e.g. streamlines, tractograms etc.
dev_url: https://pypi.org/project/dmri-dicelib/

extra:
recipe-maintainers:
- daducci
- nightwnvol
- pauldmccarthy