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 diamond recipe #51515

Merged
merged 1 commit into from
Oct 21, 2024
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
33 changes: 17 additions & 16 deletions recipes/diamond/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#!/bin/bash

sed -i.bak 's/-march=native/-march=x86-64/' CMakeLists.txt
rm -rf *.bak

mkdir build
cd build
if [[ `uname` == "Darwin" ]]; then
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
else
export CONFIG_ARGS=""
fi

cmake -S. -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid overriding optimization flags in CXXFLAGS

Conda-build sets appropriate optimization flags in CXXFLAGS. Adding -O3 may conflict with these settings and affect portability. It's recommended not to override optimization levels explicitly.

Apply this diff:

 -DCMAKE_CXX_FLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
+-DCMAKE_CXX_FLAGS="${CXXFLAGS} -I${PREFIX}/include" \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -I${PREFIX}/include" \

-DWITH_ZSTD=ON \
-DZSTD_LIBRARY="${PREFIX}/lib/libzstd.a" \
-DZSTD_INCLUDE_DIR="${PREFIX}/include" \
-DBLAST_LIBRARY_DIR="${PREFIX}/lib/ncbi-blast+" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Do not override CMAKE_OSX_DEPLOYMENT_TARGET

Setting CMAKE_OSX_DEPLOYMENT_TARGET to an empty string may lead to macOS compatibility issues. Conda-build manages this variable appropriately. It's best to rely on the defaults provided by the build environment.

Apply this diff:

 -DCMAKE_OSX_DEPLOYMENT_TARGET="" \

Committable suggestion was skipped due to low confidence.

"${CONFIG_ARGS}"

cmake .. \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_LIBRARY_PATH="$PREFIX" \
-DWITH_ZSTD=on \
-DZSTD_LIBRARY=$PREFIX/lib/libzstd.a \
-DZSTD_INCLUDE_DIR=$PREFIX/include/ \
-DBLAST_LIBRARY_DIR=$PREFIX/lib/ncbi-blast+ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=""

cmake --build . --config Release --target install

# Reference link:
# https://github.com/conda/conda-recipes/blob/master/boost/build.sh
cmake --build build --target install -v
18 changes: 10 additions & 8 deletions recipes/diamond/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source:
sha256: {{ sha256 }}

build:
number: 1
number: 2
run_exports:
- {{ pin_subpackage('diamond', max_pin="x") }}

Expand All @@ -23,24 +23,26 @@ requirements:
host:
- zlib
- zstd-static
run:
- zlib

test:
commands:
- diamond --help 2>&1 > /dev/null

about:
home: https://github.com/bbuchfink/diamond
license: GPL-3.0-or-later
home: "https://github.com/bbuchfink/diamond"
license: "GPL-3.0-or-later"
license_family: GPL3
license_file: LICENSE
summary: Accelerated BLAST compatible local sequence aligner
doc_url: https://github.com/bbuchfink/diamond/wiki
summary: "Accelerated BLAST compatible local sequence aligner."
doc_url: "https://github.com/bbuchfink/diamond/wiki"
dev_url: "https://github.com/bbuchfink/diamond"

extra:
identifiers:
- biotools:Diamond
- biotools:diamond
- usegalaxy-eu:bg_diamond
- usegalaxy-eu:bg_diamond_makedb
- usegalaxy-eu:bg_diamond_view
- doi:10.1038/s41592-021-01101-x
additional-platforms:
- osx-arm64
Expand Down