[med-svn] [Git][med-team/libslow5lib][master] 5 commits: B-D on python3-all-dev to build all available py ext
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Thu Jun 30 17:14:39 BST 2022
Nilesh Patra pushed to branch master at Debian Med / libslow5lib
Commits:
5b350a19 by Nilesh Patra at 2022-06-30T15:03:19+00:00
B-D on python3-all-dev to build all available py ext
- - - - -
d72cb896 by Nilesh Patra at 2022-06-30T15:24:36+00:00
Test using default python
- - - - -
68ed6744 by Nilesh Patra at 2022-06-30T15:26:44+00:00
Add d/clean for cleaning redundant files
- - - - -
7341863c by Nilesh Patra at 2022-06-30T15:31:01+00:00
Build for all python versions
- - - - -
1cb12720 by Nilesh Patra at 2022-06-30T15:39:34+00:00
Link python extension against streamvbyte as well
- - - - -
4 changed files:
- + debian/clean
- debian/control
- debian/patches/use_debian_packaged_streamvbyte.patch
- debian/rules
Changes:
=====================================
debian/clean
=====================================
@@ -0,0 +1,4 @@
+.pybuild/
+build/
+lib/
+python/pyslow5.c
=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Build-Depends: debhelper-compat (= 13),
cmake,
d-shlibs,
dh-python,
- python3-dev,
+ python3-all-dev,
libstreamvbyte-dev,
libzstd-dev,
zlib1g-dev,
=====================================
debian/patches/use_debian_packaged_streamvbyte.patch
=====================================
@@ -4,7 +4,7 @@ Description: Use Debian packaged streamvbyte library
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -26,7 +26,6 @@ unset(SLOW5_USE_ZSTD CACHE)
+@@ -26,7 +26,6 @@
# include_directories(${PROJECT_SOURCE_DIR}/src)
# include_directories(${PROJECT_SOURCE_DIR}/test)
include_directories(${PROJECT_SOURCE_DIR}/include)
@@ -12,7 +12,7 @@ Description: Use Debian packaged streamvbyte library
set(slow5_ src/slow5.c)
set(slow5_idx src/slow5_idx.c)
-@@ -42,7 +41,6 @@ set(slow5_press src/slow5_press.c)
+@@ -42,7 +41,6 @@
# set(openmp_get_reads examples/random_read_openmp.c)
# add_executable(slow5exmp ${openmp_get_reads})
@@ -20,7 +20,7 @@ Description: Use Debian packaged streamvbyte library
option(SLOW5_LINK_STATIC "libslow5 will create a static lib" OFF) #OFF by default
if(SLOW5_LINK_STATIC)
-@@ -54,7 +52,7 @@ else()
+@@ -54,7 +52,7 @@
endif(SLOW5_LINK_STATIC)
unset(SLOW5_LINK_STATIC CACHE)
@@ -31,7 +31,7 @@ Description: Use Debian packaged streamvbyte library
#add_library(slow5 STATIC ${slow5_} ${slow5_idx} ${slow5_misc} ${slow5_press})
--- a/test/Makefile
+++ b/test/Makefile
-@@ -4,7 +4,7 @@ LIB = ../lib
+@@ -4,7 +4,7 @@
CPPFLAGS += -I ../include/ -I $(SRC)/
#CFLAGS += -g -Wall -Werror -Wpedantic -std=c99
CFLAGS += -g -Wall -Werror -std=gnu99
@@ -42,7 +42,7 @@ Description: Use Debian packaged streamvbyte library
LDFLAGS += -lzstd
--- a/src/slow5_press.c
+++ b/src/slow5_press.c
-@@ -1034,7 +1034,7 @@ static ssize_t fwrite_compress_zlib(stru
+@@ -1034,7 +1034,7 @@
static uint8_t *ptr_compress_svb(const uint32_t *ptr, size_t count, size_t *n) {
uint32_t length = count / sizeof *ptr;
@@ -51,7 +51,7 @@ Description: Use Debian packaged streamvbyte library
uint8_t *out = (uint8_t *) malloc(max_n + sizeof length);
if (!out) {
SLOW5_MALLOC_ERROR();
-@@ -1042,7 +1042,7 @@ static uint8_t *ptr_compress_svb(const u
+@@ -1042,7 +1042,7 @@
return NULL;
}
@@ -60,7 +60,7 @@ Description: Use Debian packaged streamvbyte library
memcpy(out, &length, sizeof length); /* copy original length of ptr (needed for depress) */
*n = *n + sizeof length;
SLOW5_LOG_DEBUG("max svb bytes=%zu\nsvb bytes=%zu\n",
-@@ -1070,7 +1070,7 @@ static uint8_t *ptr_compress_svb_zd(cons
+@@ -1070,7 +1070,7 @@
slow5_errno = SLOW5_ERR_MEM;
return NULL;
}
@@ -69,7 +69,7 @@ Description: Use Debian packaged streamvbyte library
SLOW5_LOG_DEBUG("orig bytes=%zu\n", count); /* TESTING */
-@@ -1094,7 +1094,7 @@ static uint32_t *ptr_depress_svb(const u
+@@ -1094,7 +1094,7 @@
}
size_t bytes_read;
@@ -78,7 +78,7 @@ Description: Use Debian packaged streamvbyte library
SLOW5_ERROR("Expected streamvbyte_decode to read '%zu' bytes, instead read '%zu' bytes.",
count - sizeof length, bytes_read);
slow5_errno = SLOW5_ERR_PRESS;
-@@ -1122,7 +1122,7 @@ static int16_t *ptr_depress_svb_zd(const
+@@ -1122,7 +1122,7 @@
slow5_errno = SLOW5_ERR_MEM;
return NULL;
}
@@ -89,7 +89,7 @@ Description: Use Debian packaged streamvbyte library
// for (int64_t i = 0; i < length; ++ i) {
--- a/setup.py
+++ b/setup.py
-@@ -18,9 +18,9 @@ include_dirs = []
+@@ -18,9 +18,9 @@
# for the install.
try:
import numpy as np
@@ -101,7 +101,7 @@ Description: Use Debian packaged streamvbyte library
def np(*args, ** kwargs ):
import numpy as np
return np(*args, ** kwargs)
-@@ -38,13 +38,13 @@ except ImportError:
+@@ -38,13 +38,13 @@
sources=['python/pyslow5.pyx', 'src/slow5.c', 'src/slow5_press.c', 'src/slow5_misc.c', 'src/slow5_idx.c',
'python/slow5_write.c', 'python/slow5threads.c',
@@ -117,12 +117,14 @@ Description: Use Debian packaged streamvbyte library
extra_compile_args = ['-g', '-Wall', '-O2', '-std=c99']
# extra_compile_args = []
# os.environ["CFLAGS"] = '-g -Wall -O2 -std=c99'
-@@ -58,7 +58,7 @@ elif arch in ["x86_64"]:
+@@ -58,8 +58,8 @@
extra_compile_args.extend(['-DSTREAMVBYTE_SSSE3=1', '-mssse3']) # WARNING: ancient x86_64 CPUs don't have SSSE3
-# include_dirs = ['include/', np.get_include(), 'thirdparty/streamvbyte/include']
+-libraries = ['m', 'z']
+# include_dirs = ['include/', np.get_include() ]
- libraries = ['m', 'z']
++libraries = ['m', 'z', 'streamvbyte']
library_dirs = ['.']
+ # a nasty hack to provide option to build with zstd
=====================================
debian/rules
=====================================
@@ -5,6 +5,9 @@ export LC_ALL=C.UTF-8
export PYBUILD_NAME=slow5
+DEFPY3 := $(shell py3versions -v -d)
+PY_PLATFORM := $(shell python3 -c 'from distutils.util import get_platform; print(get_platform())')
+
# for hardening you might like to uncomment this:
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
@@ -18,15 +21,17 @@ override_dh_auto_configure:
override_dh_auto_build:
dh_auto_build
- python3 setup.py build
+ for py in `py3versions -s`; do \
+ $$py setup.py build; \
+ done
#FIXME cp build/lib.*/*.so ./
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
mkdir -p lib
- cp -a obj-$(DEB_HOST_GNU_TYPE)/libslow5_static.a lib/libslow5.a
- $(MAKE) -C test zstd=1
- PYTHONPATH=build/lib* python3 < python/example.py
+ #cp -a obj-$(DEB_HOST_GNU_TYPE)/libslow5_static.a lib/libslow5.a
+ #$(MAKE) -C test zstd=1
+ PYTHONPATH=$(CURDIR)/build/lib.$(PY_PLATFORM)-$(DEFPY3) python3 < python/example.py
endif
override_dh_install:
View it on GitLab: https://salsa.debian.org/med-team/libslow5lib/-/compare/8ed62de506c384b299fead9fb0459c9066a99bf2...1cb1272072f8fc913be1e61b817eb278632d7505
--
View it on GitLab: https://salsa.debian.org/med-team/libslow5lib/-/compare/8ed62de506c384b299fead9fb0459c9066a99bf2...1cb1272072f8fc913be1e61b817eb278632d7505
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220630/5fcffffc/attachment-0001.htm>
More information about the debian-med-commit
mailing list