Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sylph #50691

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions recipes/sylph/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
# We set CARGO_HOME because we don't pass on HOME to conda-build, thus rendering the default "${HOME}/.cargo" defunct.
export CARGO_NET_GIT_FETCH_WITH_CLI=true CARGO_HOME="$(pwd)/.cargo"

# build statically linked binary with Rust
RUST_BACKTRACE=1 cargo install --verbose --path . --root $PREFIX
TARGET_CPUS=("x86-64" "x86-64-v2" "x86-64-v3" "x86-64-v4")

for TARGET_CPU in "${TARGET_CPUS[@]}"; do
# build statically linked binary with Rust
RUST_BACKTRACE=1 RUSTFLAGS="-C target-cpu=${TARGET_CPU}" cargo install --verbose --path . --root $PREFIX
mv ${PREFIX}/bin/sylph ${PREFIX}/bin/_sylph_${TARGET_CPU}
done


cp "${RECIPE_DIR}/sylph" "${PREFIX}/bin/sylph"
chmod +x "${PREFIX}/bin/sylph"
7 changes: 5 additions & 2 deletions recipes/sylph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package:
version: {{ version }}

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

Expand All @@ -31,6 +31,9 @@ about:
license_file: LICENSE

extra:
identifiers:
- biotools:sylph
- doi:10.1101/2023.11.20.567879
recipe-maintainers:
- bluenote-1577

- fplazaonate
21 changes: 21 additions & 0 deletions recipes/sylph/sylph
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -eu

SYLPH_VERSION="sylph 0.6.1"
HAS_SSE2=$([ "$(_sylph_x86-64 --version 2>/dev/null)" = "${SYLPH_VERSION}" ] && echo 0 || echo 1)
HAS_SSE4_2=$([ "$(_sylph_x86-64-v2 --version 2>/dev/null)" = "${SYLPH_VERSION}" ] && echo 0 || echo 1)
HAS_AVX2=$([ "$(_sylph_x86-64-v3 --version 2>/dev/null)" = "${SYLPH_VERSION}" ] && echo 0 || echo 1)
HAS_AVX512=$([ "$(_sylph_x86-64-v4 --version 2>/dev/null)" = "${SYLPH_VERSION}" ] && echo 0 || echo 1)

if [ ${HAS_AVX512} -eq 0 ]; then
_sylph_x86-64-v4 "$@"
elif [ ${HAS_AVX2} -eq 0 ]; then
_sylph_x86-64-v3 "$@"
elif [ ${HAS_SSE4_2} -eq 0 ]; then
_sylph_x86-64-v2 "$@"
elif [ ${HAS_SSE2} -eq 0 ]; then
_sylph_x86-64 "$@"
else
echo "Unsupported CPU" && exit 1
fi
Loading