diff --git a/recipes/minimac4/build.sh b/recipes/minimac4/build.sh new file mode 100644 index 0000000000000..d3b62199c6ca3 --- /dev/null +++ b/recipes/minimac4/build.sh @@ -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="csg-devel@umich.edu" \ + .. + +make || exit 1 +make install || exit 1 +make CTEST_OUTPUT_ON_FAILURE=1 test || exit 1 +echo "Minimac4 installation completed successfully" + +cd .. || exit 1 diff --git a/recipes/minimac4/meta.yaml b/recipes/minimac4/meta.yaml new file mode 100644 index 0000000000000..889e9cbc3f5d8 --- /dev/null +++ b/recipes/minimac4/meta.yaml @@ -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."