Skip to content

Commit

Permalink
Add recipe for mrtrix3 (#53168)
Browse files Browse the repository at this point in the history
* Add recipe for mrtrix3

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Add dummy test command

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Update recipes/mrtrix3/meta.yaml

* Pass CXX as an env var to ./configure

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try with temporary symlinks for gcc and g++ that are foundable in PATH

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Move cdt(...) requirements to `build:`

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Use `ARCH=native` because otherwise it uses `aarch64` for ARM64 and breaks

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Move all requirements from host to build

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Add host dependency to libxcb

```
13:50:54 BIOCONDA INFO (OUT) $BUILD_PREFIX/bin/../lib/gcc/x86_64-conda-linux-gnu/13.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libxcb.so.1, needed by $BUILD_PREFIX/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/../lib/libX11.so.6, not found (try using -rpath or -rpath-link)
```

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Add host dependency to xcb-util-renderutil too

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Move xsb requirements to `build`, next to all other X requirements

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try by moving all `host` reqs to `build`

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* eigen needs to be in `host` to be findable

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Debug libxcb

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Add libxcb for all requirements

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try finding libxcb with -rpath

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Export RPATH too

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try with RPATH looking in BUILD_PREFIX

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try with full path to libxcb.so.1

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Try without full path to libxcb.so/dylib. Leave only -lxcb

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Disable the build for OSX due to new kind of issues with libxcb

Add a test command

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

---------

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g authored Jan 15, 2025
1 parent 7523d4f commit ba4539e
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
24 changes: 24 additions & 0 deletions recipes/mrtrix3/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -x

export RPATH="${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -idirafter ${PREFIX}/include"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib -lxcb"
export LINKFLAGS="-L${PREFIX}/lib -lxcb"
export LINKLIB_FLAGS="${LINKFLAGS}"
export EIGEN_CFLAGS="-idirafter ${PREFIX}/include/eigen3"

mkdir -p "${PREFIX}"/{bin,lib,share}

ln -s ${CC} ${CONDA_PREFIX}/bin/gcc
ln -s ${CXX} ${CONDA_PREFIX}/bin/g++

ARCH=native CFLAGS="${CXXFLAGS}" ./configure -conda -openmp || (cat configure.log && exit 123)

./build

cp -r bin lib share "${PREFIX}"

unlink ${CONDA_PREFIX}/bin/g++
unlink ${CONDA_PREFIX}/bin/gcc
70 changes: 70 additions & 0 deletions recipes/mrtrix3/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{% set name = "mrtrix3" %}
{% set version = "3.0.4" %}

package:
name: {{ name }}
version: {{ version }}

source:
url: https://github.com/MRtrix3/mrtrix3/archive/refs/tags/{{ version }}.tar.gz
sha256: f1d1aa289cfc3e46e3a8eca93594b23d061c6d50a0cd03727433a7e2cd14f71a

build:
skip: True # [osx]
number: 0
run_exports:
- {{ pin_subpackage(name, max_pin='x') }}

requirements:
build:
- {{ compiler('cxx') }}
- pkg-config
- {{ cdt('xorg-x11-proto-devel') }} # [linux]
- {{ cdt('libx11-devel') }} # [linux]
- {{ cdt('libxext-devel') }} # [linux]
- {{ cdt('libxrender-devel') }} # [linux]
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-libegl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libxau-devel') }} # [linux]
- {{ cdt('libselinux-devel') }} # [linux]
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxdamage-devel') }} # [linux]
- {{ cdt('libxfixes') }} # [linux]
- {{ cdt('libxfixes-devel') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- {{ cdt('libxxf86vm-devel') }} # [linux]
- qt >=5.15
- python
- libgomp # [linux]
- llvm-openmp # [osx]
host:
- eigen >=3.2
- libtiff >=4.0
- zlib
- fftw >=3.0
- libxcb
run:
- qt >=5.15
- zlib
- libtiff >=4.0
- fftw >=3.0

test:
commands:
- mrconvert --help

about:
home: https://www.mrtrix.org
license: MPL-2.0
license_family: MOZILLA
license_file: LICENCE.txt
summary: A set of tools to perform various advanced diffusion MRI analyses,
including constrained spherical deconvolution (CSD), probabilistic tractography,
track-density imaging, and apparent fibre density
dev_url: https://github.com/MRtrix3/mrtrix3
doc_url: https://www.mrtrix.org/documentation/

extra:
additional-platforms:
- linux-aarch64

0 comments on commit ba4539e

Please sign in to comment.