Skip to content

Commit

Permalink
Add Minimac4 (#52011)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisLeNezet authored Nov 8, 2024
1 parent 51df3ab commit 663add1
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
49 changes: 49 additions & 0 deletions recipes/minimac4/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
set -euo pipefail

echo "Building Minimac4 version ${PKG_VERSION}"

# Set CXXFLAGS to include the correct path to lzma.h and LDFLAGS to include the path to liblzma
export CXXFLAGS="-I${PREFIX}/include -I${PREFIX}/lib"
export LDFLAGS="-L${PREFIX}/lib -llzma"
CMAKE_MAKE_PROGRAM="$(which make)"
CMAKE_C_COMPILER="${CC}"
CMAKE_CXX_COMPILER="${CXX}"

export CMAKE_MAKE_PROGRAM
export CMAKE_C_COMPILER
export CMAKE_CXX_COMPILER

# Set up dependencies and directories
if [ ! -f ./requirements.txt ]; then
echo "Error: requirements.txt not found"
exit 1
fi
cget ignore xz || exit 1
cget install -f ./requirements.txt || exit 1

cmake --version
mkdir -p build || exit 1
cd build || exit 1

cmake \
-DBUILD_TESTS=1 \
-DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} \
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} \
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCPACK_GENERATOR="STGZ" \
-DCPACK_PACKAGE_CONTACT="[email protected]" \
..

make || exit 1
make install || exit 1
make CTEST_OUTPUT_ON_FAILURE=1 test || exit 1
echo "Minimac4 installation completed successfully"

cd .. || exit 1
41 changes: 41 additions & 0 deletions recipes/minimac4/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% set version = "4.1.6" %}

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

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

source:
url: https://github.com/statgen/Minimac4/archive/refs/tags/v{{ version }}.tar.gz
sha256: 0bce8d6edbf5d5d944b19c4e36403d0bc1d18f2d6003d88e01086488c3eb9333

requirements:
build:
- make
- cmake >=3.24
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cget
host:
- bcftools >=1.20
- zlib
- savvy ==2.1.0
- xz
run:
- cget

test:
commands:
- minimac4 --help
- minimac4 --version

about:
home: https://github.com/statgen/Minimac4
license: GPL-3.0-or-later
license_file: LICENSE
summary: "Computationally efficient genotype imputation"
description: "Minimac4 is a lower memory and more computationally efficient implementation of the genotype imputation algorithms in minimac/mininac2/minimac3."

0 comments on commit 663add1

Please sign in to comment.