Skip to content

Commit

Permalink
adding RDEVAL (#52070)
Browse files Browse the repository at this point in the history
* initial attempt

* adding make as a dependency

* new hash

* adding test

* fixing build.sh

* using version with submodules

* adding zlib

* updates

* update

* foo

* quote

* u

* a

* patch

* zlib

* zlib

* foo

* clean up recipe

* clean up patches

* Update build.sh

* add gfalibs patch

* Update meta.yaml

* Update meta.yaml

* add gfalibs patch

* edit foo.patch

* Update foo.patch

* edit foo.patch

* edit foo.patch

* Update build.sh

---------

Co-authored-by: Richard C. Burhans <[email protected]>
Co-authored-by: mencian <[email protected]>
Co-authored-by: Joshua Zhuang <[email protected]>
  • Loading branch information
4 people authored Nov 13, 2024
1 parent 4b4d896 commit 278e2c1
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 0 deletions.
14 changes: 14 additions & 0 deletions recipes/rdeval/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o xtrace

cd "$SRC_DIR"

export CXXFLAGS="$CXXFLAGS -O3 -I$PREFIX/include"
export LDFLAGS="$LDFLAGS -L$PREFIX/lib"

make -j"${CPU_COUNT}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument" LDFLAGS="${LDFLAGS}"
install -d "$PREFIX/bin"
install -v -m 0755 build/bin/rdeval "$PREFIX/bin/"
38 changes: 38 additions & 0 deletions recipes/rdeval/foo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/Makefile b/Makefile
index 5823f28..6f4a60f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-CXX ?= g++
-INCLUDE_DIR = -I./include -I./gfalibs/include
+CXX ?= ${CXX}
+INCLUDE_DIR = -I${PREFIX}/include -I./include -I./gfalibs/include
WARNINGS = -Wall -Wextra

CXXFLAGS = -g -std=gnu++14 -O3 $(INCLUDE_DIR) $(WARNINGS)
@@ -12,8 +12,8 @@ SOURCE = src
INCLUDE = include
BINDIR := $(BUILD)/.o

-LDFLAGS := -pthread
-LIBS = -lz
+LDFLAGS := -pthread -L${PREFIX}/lib
+LIBS := -lz -lpthread

OBJS := main input reads
BINS := $(addprefix $(BINDIR)/, $(OBJS))
@@ -22,12 +22,12 @@ BINS := $(addprefix $(BINDIR)/, $(OBJS))
GFALIBS_DIR := $(CURDIR)/gfalibs

head: $(BINS) gfalibs | $(BUILD)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(BUILD)/$(TARGET) $(BINDIR)/* $(GFALIBS_DIR)/*.o $(LIBS)
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIR) $(LDFLAGS) -o $(BUILD)/$(TARGET) $(BINDIR)/* $(GFALIBS_DIR)/*.o $(LIBS)

all: head validate regenerate

$(BINDIR)%: $(SOURCE)/%.cpp $(INCLUDE)/%.h | $(BINDIR)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -c $(SOURCE)/$(notdir $@).cpp -o $@
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIR) $(LDFLAGS) -c $(SOURCE)/$(notdir $@).cpp -o $@ $(LIBS)

.PHONY: gfalibs
gfalibs:
30 changes: 30 additions & 0 deletions recipes/rdeval/gfalibs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/gfalibs/Makefile b/gfalibs/Makefile
index de9ab9b..90a703c 100644
--- a/gfalibs/Makefile
+++ b/gfalibs/Makefile
@@ -1,5 +1,5 @@
-CXX = g++
-INCLUDE_DIR = -I./include
+CXX = $(CXX)
+INCLUDE_DIR = -I${PREFIX}/include -I./include -I./include/parallel-hashmap
WARNINGS = -Wall -Wextra

CXXFLAGS = -g -std=gnu++14 -O3 $(INCLUDE_DIR) $(WARNINGS)
@@ -8,7 +8,7 @@ TARGET = gfalibs
BUILD = build/bin
SOURCE = src
INCLUDE = include
-LDFLAGS :=
+LDFLAGS := -L${PREFIX}/lib -pthread

SOURCES = $(addsuffix .o, input-filters input-gfa input-agp gfa gfa-lines log stream-obj uid-generator struct output memory)

@@ -16,7 +16,7 @@ all: $(SOURCES)
@

%.o: $(SOURCE)/%.cpp $(INCLUDE)/%.h
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -c $(SOURCE)/$(basename $@).cpp -o $@
+ $(CXX) $(CXXFLAGS) $(INCLUDE_DIR) $(LDFLAGS) -c $(SOURCE)/$(basename $@).cpp -o $@ -lz -lpthread

clean:
$(RM) *.o
45 changes: 45 additions & 0 deletions recipes/rdeval/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% set name = "rdeval" %}
{% set version = "0.0.2" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/vgl-hub/{{ name }}/releases/download/v{{ version }}/{{ name }}.v{{ version }}-with_submodules.zip
sha256: 56c2f4d7d2c22b27d1b380dc41b81cc77a2d97c792a69b9360bed9e0027bac4d
patches:
- zlib.patch
- foo.patch
- gfalibs.patch

build:
number: 0
run_exports:
- {{ pin_subpackage(name|lower, max_pin="x.x") }}

requirements:
build:
- {{ compiler('cxx') }}
- make
host:
- pthread-stubs
- zlib

test:
commands:
- rdeval --help

about:
home: https://github.com/vgl-hub/{{ name }}
summary: A general purpose, multithreaded read analysis and manipulation tool.
license: MIT
license_family: MIT
license_file: LICENSE
dev_url: https://github.com/vgl-hub/{{ name }}
doc_url: https://github.com/vgl-hub/rdeval/blob/v{{ version }}/README.md

extra:
additional-platforms:
- linux-aarch64
- osx-arm64
52 changes: 52 additions & 0 deletions recipes/rdeval/zlib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/gfalibs/include/output.h b/gfalibs/include/output.h
index aabbec0..20f0dc1 100644
--- a/gfalibs/include/output.h
+++ b/gfalibs/include/output.h
@@ -12,7 +12,7 @@
#include "gfa-lines.h"
#include "gfa.h"

-#include "zlib.h"
+#include <zlib.h>
#include "zstream/zstream_common.hpp"
#include "zstream/ozstream.hpp"
#include "zstream/ozstream_impl.hpp"
diff --git a/gfalibs/include/stream-obj.h b/gfalibs/include/stream-obj.h
index 1faa4df..8e28bf6 100644
--- a/gfalibs/include/stream-obj.h
+++ b/gfalibs/include/stream-obj.h
@@ -2,7 +2,7 @@
#define STREAM_OBJ_H

#include <fstream>
-#include "zlib.h"
+#include <zlib.h>

class membuf : public std::streambuf {

diff --git a/gfalibs/src/stream-obj.cpp b/gfalibs/src/stream-obj.cpp
index e9694ee..c6eca26 100644
--- a/gfalibs/src/stream-obj.cpp
+++ b/gfalibs/src/stream-obj.cpp
@@ -5,7 +5,7 @@

#include "bed.h"
#include "struct.h"
-#include "zlib.h"
+#include <zlib.h>
#include "global.h"
#include "log.h"
#include "threadpool.h"
diff --git a/src/reads.cpp b/src/reads.cpp
index 866f49b..ac714cf 100644
--- a/src/reads.cpp
+++ b/src/reads.cpp
@@ -14,7 +14,7 @@
#include "functions.h" // global functions
#include "stream-obj.h"

-#include "zlib.h"
+#include <zlib.h>
#include "zstream/zstream_common.hpp"
#include "zstream/ozstream.hpp"
#include "zstream/ozstream_impl.hpp"

0 comments on commit 278e2c1

Please sign in to comment.