Skip to content
Open
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Release ST_BarcodeMap

on:
push:
tags:
- 'v*' # Triggers on version tags like v0.0.1

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
environment-file: environment.yml
activate-environment: barcodeenv
python-version: 3.9

- name: Install C++ dependencies
shell: bash -l {0}
run: |
mamba install -c conda-forge gcc_linux-64 gxx_linux-64
export CC=$(which x86_64-conda-linux-gnu-gcc)
export CXX=$(which x86_64-conda-linux-gnu-g++)
echo "Using CC=$CC"
echo "Using CXX=$CXX"
make

- name: Rename binary with version
run: |
mkdir -p dist
cp ST_BarcodeMap dist/ST_BarcodeMap-${{ github.ref_name }}-linux
chmod +x dist/ST_BarcodeMap-${{ github.ref_name }}-linux

- name: Upload binary to GitHub Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: dist/ST_BarcodeMap-${{ github.ref_name }}-linux
body: |
🔁 Automated release for **${{ github.ref_name }}**
🐧 Platform: **Linux**
📦 Binary: `ST_BarcodeMap-${{ github.ref_name }}-linux`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 15 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,35 @@ DIR_OBJ := ./obj

PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
INCLUDE_DIRS ?=
LIBRARY_DIRS ?=

# Use Conda’s Boost, but system GCC
INCLUDE_DIRS = -I$(DIR_INC) -I$(CONDA_PREFIX)/include -I/usr/include/hdf5/serial
LIBRARY_DIRS = -L$(CONDA_PREFIX)/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial

SRC := $(wildcard ${DIR_SRC}/*.cpp)
OBJ := $(patsubst %.cpp,${DIR_OBJ}/%.o,$(notdir ${SRC}))

TARGET := ST_BarcodeMap-0.0.1

TARGET := ST_BarcodeMap
BIN_TARGET := ${TARGET}

CXX ?= g++
CXXFLAGS := -std=c++11 -g -O3 -I${DIR_INC} $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir)) ${CXXFLAGS}
LIBS := -lz -lpthread
LD_FLAGS := $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(LIBS) $(LD_FLAGS)

CXX := g++
CXXFLAGS := -std=c++11 -g -O3 $(INCLUDE_DIRS)
LD_FLAGS := $(LIBRARY_DIRS) -lboost_serialization -lhdf5 -lz -lpthread

${BIN_TARGET}:${OBJ}
${BIN_TARGET}: ${OBJ}
$(CXX) $(OBJ) -o $@ $(LD_FLAGS)

${DIR_OBJ}/%.o:${DIR_SRC}/%.cpp make_obj_dir
${DIR_OBJ}/%.o: ${DIR_SRC}/%.cpp make_obj_dir
$(CXX) -c $< -o $@ $(CXXFLAGS)

.PHONY:clean
.PHONY: clean
clean:
rm obj/*.o
rm $(TARGET)
rm -f ${DIR_OBJ}/*.o
rm -f ${TARGET}

make_obj_dir:
@if test ! -d $(DIR_OBJ) ; \
then \
mkdir $(DIR_OBJ) ; \
fi
@if [ ! -d ${DIR_OBJ} ]; then mkdir -p ${DIR_OBJ}; fi

install:
install $(TARGET) $(BINDIR)/$(TARGET)
install ${TARGET} ${BINDIR}/${TARGET}
@echo "Installed."
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,24 @@ This program can map barcode of stereomics-seq to stereomics-chip
| zlib | >=1.2.11 | file compressing and decompressing |
| hdf5 | >=1.10.7 | hdf5 format mask file read |

## Using conda
If the conda is not set up yet, please install conda first, following the link below:
[https://www.anaconda.com/docs/getting-started/miniconda/install#macos-linux-installation](https://www.anaconda.com/docs/getting-started/miniconda/install#macos-linux-installation)

To meet the above prerequisites, a conda environment can be created as shown below:
```bash
conda install mamba -n base -c conda-forge
mamba create -n barcodeenv boost=1.73 hdf5=1.10.7 zlib=1.2.11 -c conda-forge
conda activate barcodeenv
mamba install -c conda-forge gcc_linux-64 gxx_linux-64
mamba install -c conda-forge boost=1.73
```

## make the runnable program
```
##add the requested packages in your environment value or specify their path in Makefile by INCLUDE_DIRS and LIBRARY_DIRS
conda activate barcodeenv
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

cd ST_BarcodeMap
make
Expand Down
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: barcodeenv
channels:
- conda-forge
dependencies:
- boost=1.73
- hdf5=1.10.7
- zlib=1.2.11
- gcc_linux-64
- gxx_linux-64
- make
- mamba