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

Add Cloudspades #51399

Merged
merged 26 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6da07a5
add cloudspades
pdimens Oct 15, 2024
9c352db
Rename recipes/spades/cloudspades/meta.yaml to recipes/cloudspades/me…
pdimens Oct 15, 2024
a75105d
rm flags, better versioning, rm arm
pdimens Oct 15, 2024
3fd1c6b
Merge branch 'master' into cloudspades
pdimens Oct 15, 2024
0745483
rm aarch
pdimens Oct 15, 2024
ac115e9
fix build
pdimens Oct 15, 2024
8e74a52
add ignore exports, link to the license file directly
pdimens Oct 15, 2024
b548ac9
fix constraint
pdimens Oct 15, 2024
2045d43
fix license path
pdimens Oct 15, 2024
e8c704e
simplify tests b/c cloudspades acts different
pdimens Oct 15, 2024
ad59ff4
Merge branch 'master' into cloudspades
pdimens Oct 15, 2024
3d88e6f
skip osk. make life easier
pdimens Oct 15, 2024
57b00e9
add proper test
pdimens Oct 15, 2024
4f2d95b
add gz
pdimens Oct 15, 2024
6692969
try building with less threads
mencian Oct 16, 2024
9260860
fix tests
mencian Oct 16, 2024
0399e25
edit test command
mencian Oct 16, 2024
a373b6b
do not build on aarch64/arm64
mencian Oct 16, 2024
817a88b
Merge branch 'master' into cloudspades
mencian Oct 16, 2024
af16fd4
add case for Darwin
mencian Oct 16, 2024
871a400
Merge branch 'master' into cloudspades
mencian Oct 16, 2024
140ff1c
Merge branch 'master' into cloudspades
mencian Oct 16, 2024
f1a7429
edit case
mencian Oct 16, 2024
a443735
Merge branch 'master' into cloudspades
mencian Oct 16, 2024
73936dd
Add "-D_LIBCPP_DISABLE_AVAILABILITY" for OSX
martin-g Oct 16, 2024
083460a
skip osx x86_64 for now
mencian Oct 16, 2024
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
43 changes: 43 additions & 0 deletions recipes/cloudspades/0001-change-verbosity-remove-expr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff -Naur a/assembler/spades_compile.sh b/assembler/spades_compile.sh
--- a/assembler/spades_compile.sh 2024-05-26 14:36:40
+++ b/assembler/spades_compile.sh 2024-05-27 13:00:03
@@ -37,10 +37,10 @@ check_whether_OPTARG_is_an_integer() {
}

# return the argument first character
-str_head() { echo "$(expr substr "$1" 1 1)"; }
+str_head() { echo "${1::1}"; }
Comment on lines +8 to +9
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

Fix incorrect parameter expansion syntax in str_head function

The new implementation of str_head() uses ${1::1} to extract the first character, but this syntax is invalid in bash. The correct syntax should be ${1:0:1}.

Apply this diff to fix the syntax error:

-str_head() { echo "${1::1}"; }
+str_head() { echo "${1:0:1}"; }
📝 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
-str_head() { echo "$(expr substr "$1" 1 1)"; }
+str_head() { echo "${1::1}"; }
-str_head() { echo "$(expr substr "$1" 1 1)"; }
+str_head() { echo "${1:0:1}"; }


# return the argument without the first character
-str_tail() { echo "$(expr substr "$1" 2 $((${#1}-1)))"; }
+str_tail() { echo "${1:1}"; }

print_help() {
echo
@@ -221,11 +221,21 @@ else
ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS -DSPADES_BUILD_INTERNAL=OFF"
fi

-cd "$WORK_DIR"
-cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$PREFIX" $ADDITIONAL_FLAGS "$BASEDIR/src"
-make -j $AMOUNT_OF_THREADS
-make install
-cd "$PREFIX"
+if [[ `uname` == "Darwin" ]]; then
+ export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER"
+ export CFLAGS="${CFLAGS} -Wunused-command-line-argument"
+ export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
+else
+ export CONFIG_ARGS=""
+fi
+
+cd "${WORK_DIR}"
+cmake -S "${BASEDIR}/src" -B . -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="${CXX}" \
+ -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_C_COMPILER="${CC}" \
+ -DCMAKE_C_FLAGS="${CFLAGS}" "${ADDITIONAL_FLAGS}" \
+ "${CONFIG_ARGS}"
+cmake --build . --target install -j "${AMOUNT_OF_THREADS}" -v

if [ $RUN_TESTS = "y" ]; then
cd "$BASEDIR"
20 changes: 20 additions & 0 deletions recipes/cloudspades/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e -o pipefail -x

export LIBRARY_PATH="${PREFIX}/lib"
export INCLUDE_PATH="${PREFIX}/include"
export CFLAGS="${CFLAGS} -O3 -fcommon"
export CXXFLAGS="${CFLAGS} -O3 -fcommon -I${PREFIX}/include -D_LIBCPP_DISABLE_AVAILABILITY"

case $(uname) in
Linux)
THREADS="-rj${CPU_COUNT}"
;;
Darwin)
THREADS=""
;;
esac

cd assembler
PREFIX="${PREFIX}" bash spades_compile.sh "${THREADS}" -DSPADES_ENABLE_PROJECTS="all"
54 changes: 54 additions & 0 deletions recipes/cloudspades/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% set name = "cloudspades" %}
{% set version = "3.16.0" %}
{% set sha256 = "5972a76722fadf9527675fea3884a03ca864b153b8de9dd94532b1b797de04aa" %}

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

source:
url: https://github.com/ablab/spades/archive/refs/tags/cloudspades-0.1.tar.gz
sha256: {{ sha256 }}
pdimens marked this conversation as resolved.
Show resolved Hide resolved

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

requirements:
build:
- {{ compiler('cxx') }}
- cmake
- make
- pkg-config
host:
- libgomp # [linux]
- llvm-openmp # [osx]
- zlib
- bzip2
run:
- libgomp # [linux]
- llvm-openmp # [osx]
- python >=3.8

test:
commands:
- spades.py --version 2>&1 | grep {{ version }}
- metaspades.py --version 2>&1 | grep {{ version }}
- spades-kmercount -h 2>&1 | grep spades-kmercount
- spades-gmapper 2>&1 | grep spades-gmapper
- spades-gbuilder 2>&1 | grep spades-gbuilder

pdimens marked this conversation as resolved.
Show resolved Hide resolved
about:
home: "https://github.com/ablab/spades"
license: "GPL-2.0-only"
license_family: GPL
license_file: 'assembler/LICENSE'
summary: "A module of the SPAdes assembler aimed at genome assembly from linked read technologies (10x, Tellseq, Haplotagging)."
dev_url: "https://github.com/ablab/spades/tree/cloudspades-0.1"
doc_url: "https://github.com/ablab/spades/tree/cloudspades-ismb"
pdimens marked this conversation as resolved.
Show resolved Hide resolved

extra:
recipe-maintainers:
- pdimens
Comment on lines +1 to +54
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

Overall assessment: Well-structured recipe with critical issues to address

The Cloudspades recipe is generally well-written and follows Conda packaging best practices. It includes comprehensive metadata, appropriate build instructions, well-defined requirements, and thorough test commands.

However, there are critical issues that need to be addressed before the recipe can be included in the Bioconda repository:

  1. Version mismatch: The package version (3.16.0) doesn't match the source URL tag (cloudspades-0.1). This needs to be resolved to ensure consistency and prevent potential build issues.

  2. Test commands: The version checks in the test commands need to be updated once the version mismatch is resolved. Additionally, the test commands could be made more robust by checking exit statuses and including a comprehensive test suite run.

  3. Documentation URL: The doc_url points to a different tag (cloudspades-ismb) than the dev_url and source URL. This inconsistency should be resolved.

Once these issues are addressed, the recipe should be ready for inclusion in the Bioconda repository. Please review and update the highlighted sections to ensure consistency and correctness throughout the recipe.

Would you like assistance in resolving these issues or implementing the suggested improvements?

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)