Skip to content

Commit

Permalink
36 fix threading memory leak (#41)
Browse files Browse the repository at this point in the history
Fix the memory leak issue in the bam module and refactor the project for Bioconda submission.
  • Loading branch information
jonperdomo authored May 6, 2023
1 parent 54674b8 commit 1b01991
Show file tree
Hide file tree
Showing 44 changed files with 1,414 additions and 2,142 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ SRC_DIR := $(CURDIR)/src
LIB_DIR := $(CURDIR)/lib

all:
# Generate the SWIG python <-> C++ wrappers (Both ways)
# The Python wrapper is stored in the main directory, while the C++ wrapper code is stored in /src
# Generate the SWIG Python/C++ wrappers
swig -c++ -python -outdir $(LIB_DIR) -I$(INCL_DIR) -o $(SRC_DIR)/lrst_wrap.cpp $(SRC_DIR)/lrst.i

# Compile the C++ shared libraries
# The C++ wrapper binary _lrst is generated in the /src directory
# Compile the C++ shared libraries into lib/
python setup.py build_ext --build-lib $(LIB_DIR)
File renamed without changes.
10 changes: 6 additions & 4 deletions conda/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# Build the C++ library

# Add the library path to the LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib

Expand All @@ -13,11 +15,11 @@ $PYTHON setup.py -I"${PREFIX}"/include -L"${PREFIX}"/lib install
cp "${SRC_DIR}"/longreadsum "${PREFIX}"/bin

# Create the src directory
mkdir -p "${PREFIX}"/src
#mkdir -p "${PREFIX}"/lib

# Copy the lib files to the src directory
cp -r "${SRC_DIR}"/src/*.py "${PREFIX}"/src
# Copy the lib files to the build directory
cp -r "${SRC_DIR}"/src/*.py "${PREFIX}"/lib

# Copy the SWIG generated library to the lib directory
cp -r "${SRC_DIR}"/lib/*.py "${PREFIX}"/src
cp -r "${SRC_DIR}"/lib/*.py "${PREFIX}"/lib
cp -r "${SRC_DIR}"/lib/*.so "${PREFIX}"/lib
8 changes: 3 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ channels:
- defaults
dependencies:
- python
- setuptools
- conda-build
- hdf5
- htslib
- samtools
- swig
- matplotlib
- plotly=4.14
- pytest
- pytest-dependency
- pip
- pip:
- kaleido

# conda env create --file=environment.yml
# conda activate lrst_py36
# conda activate lrst_py39
57 changes: 0 additions & 57 deletions include/BAM_module.h

This file was deleted.

191 changes: 0 additions & 191 deletions include/BamReader.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/ComStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string>
#include <map>
#include <vector>

#include <stdint.h>

/////////////////////////////////
#define MAX_F5EVENT_SIZE 3000000
Expand Down
Loading

0 comments on commit 1b01991

Please sign in to comment.