Skip to content
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
806d74a
create devcontainer for compiling on the fly
aryarm Mar 17, 2026
40608d4
oops fix typo in htslib
aryarm Mar 17, 2026
c1e37f9
ignore object files after compilation
aryarm Mar 17, 2026
042251a
include cstdint in region permanently
aryarm Mar 17, 2026
3578e4c
ensure binary in artifacts is static
aryarm Mar 17, 2026
4c5bf07
also skip builds on windows
aryarm Mar 17, 2026
4a16f3d
retry to build static in ci
aryarm Mar 17, 2026
515dabe
allow overriding from bioconda.yml
aryarm Mar 17, 2026
ed23612
rm static attempt
aryarm Mar 17, 2026
a09c294
use linked instead of bundled htslib
aryarm Mar 17, 2026
1d7a6e7
also patch DenovoFinder and PhasingChecker
aryarm Mar 17, 2026
2f15766
fix 0002 patch
aryarm Mar 17, 2026
cb927a0
try to fix patch again
aryarm Mar 17, 2026
d808568
try to fix 0002 patch yet again
aryarm Mar 17, 2026
6353b95
Merge branch 'main' into htslib
aryarm Mar 18, 2026
49aa38d
prefer static binaries for now
aryarm Mar 18, 2026
cc1ef16
add usage instructions for binaries from conda recipe
aryarm Mar 18, 2026
8d3480b
add static xz version as well
aryarm Mar 18, 2026
a955a01
Update LDFLAGS to include additional libraries when building static
aryarm Mar 19, 2026
c05b3c4
rm quotes around static arg
aryarm Mar 19, 2026
e3d477f
use jinja2 templating for static build
aryarm Mar 19, 2026
1e68c7f
try static jinja2 templating again
aryarm Mar 20, 2026
fd7e219
also test if the static build is truly static
aryarm Mar 20, 2026
bea901e
ensure sed is properly patching the recipe
aryarm Mar 23, 2026
b06c58a
retry with static of 0 and 1
aryarm Mar 23, 2026
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
39 changes: 39 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/rocker-org/devcontainer-features/miniforge:2": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "mamba env create -y -n hipstr -f dev-env.yml",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-vscode.live-server",
"GitHub.vscode-github-actions"
],
"settings": {
"terminal.integrated.hideOnStartup": "always",
"files.eol": "\n",
"git.autofetch": true,
"git.enableSmartCommit": true,
"git.confirmSync": false
}
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.o
lib/cephes/libprob.a
src/version.cpp
12 changes: 12 additions & 0 deletions dev-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- conda-forge::xz
- bioconda::htslib
- conda-forge::zlib
- conda-forge::bzip2
- conda-forge::hcephes
- conda-forge::gxx_linux-64
- conda-forge::gcc_linux-64
4 changes: 3 additions & 1 deletion recipes/hipstr2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ source:
sha256: {{ sha }}
patches:
- patches/0001-use-version-from-config.patch
- patches/0002-include-cstdint-in-region.patch
- patches/0002-adapt-src-for-newest-htslib.patch
build:
number: 0
run_exports:
- {{ pin_subpackage('hipstr2', max_pin="x.x") }}
skip: true # [win]
script:
- mkdir -p "${PREFIX}/bin"
- make version
Expand All @@ -33,6 +34,7 @@ requirements:
- xz
- zlib
- bzip2
- htslib

test:
commands:
Expand Down
76 changes: 66 additions & 10 deletions recipes/hipstr2/patches/0001-use-version-from-config.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/Makefile b/Makefile
index 0f7ea29..84f774a 100644
index 0f7ea29..34037e4 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,12 @@
## Default compilation flags.
## Override with:
## make CXXFLAGS=XXXXX
-CXXFLAGS= -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread #-pedantic -Wunreachable-code -Weverything
+CXXFLAGS=$(CPPFLAGS) -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -DMACOSX -pthread #-pedantic -Wunreachable-code -Weverything
+CXXFLAGS=$(CPPFLAGS) -O3 -g -D__STDC_LIMIT_MACROS -D_FILE_OFFSET_BITS=64 -std=c++0x -pthread #-pedantic -Wunreachable-code -Weverything

## To create a static distribution file, run:
## make static-dist
Expand All @@ -19,7 +19,22 @@ index 0f7ea29..84f774a 100644
endif

## Source code files, add new files to this list
@@ -43,7 +41,7 @@ all: HipSTR DenovoFinder test/fast_ops_test test/haplotype_test test/read_vcf_al
@@ -28,12 +26,10 @@ OBJ_SEQALN := $(SRC_SEQALN:.cpp=.o)
OBJ_DENOVO := $(SRC_DENOVO:.cpp=.o)

CEPHES_ROOT=lib/cephes
-HTSLIB_ROOT=lib/htslib

-LIBS = -L./ -lm -L$(HTSLIB_ROOT)/ -lz -L$(CEPHES_ROOT)/ -llzma -lbz2
-INCLUDE = -Ilib -Ilib/htslib
+LIBS = -L./ -lm -lhts -lz -L$(CEPHES_ROOT)/ -llzma -lbz2
+INCLUDE = -idirafter lib
CEPHES_LIB = lib/cephes/libprob.a
-HTSLIB_LIB = $(HTSLIB_ROOT)/libhts.a

.PHONY: all
all: HipSTR DenovoFinder test/fast_ops_test test/haplotype_test test/read_vcf_alleles_test test/snp_tree_test test/vcf_snp_tree_test
@@ -43,7 +39,7 @@ all: HipSTR DenovoFinder test/fast_ops_test test/haplotype_test test/read_vcf_al
static-dist:
rm -f HipSTR
$(MAKE) STATIC=1
Expand All @@ -28,7 +43,7 @@ index 0f7ea29..84f774a 100644
DST="HipSTR-$${VER}-static-$$(uname -s)-$$(uname -m)" ; \
mkdir "$${DST}" && \
mkdir "$${DST}/scripts" && \
@@ -54,7 +52,7 @@ static-dist:
@@ -54,7 +50,7 @@ static-dist:
)

version:
Expand All @@ -37,14 +52,55 @@ index 0f7ea29..84f774a 100644

# Clean the generated files of the main project only
.PHONY: clean
@@ -111,8 +109,8 @@ test/vcf_snp_tree_test: test/vcf_snp_tree_test.cpp src/error.cpp src/snp_tree.cp
@@ -64,7 +60,6 @@ clean:
# Clean all compiled files
.PHONY: clean-all
clean-all: clean
- cd lib/htslib && $(MAKE) clean
rm lib/cephes/*.o $(CEPHES_LIB)

# The GNU Make trick to include the ".d" (dependencies) files.
@@ -74,13 +69,13 @@ include $(subst .cpp,.d,$(SRC))

# The resulting binary executable

-HipSTR: $(OBJ_COMMON) $(OBJ_HIPSTR) $(CEPHES_LIB) $(HTSLIB_LIB) $(OBJ_SEQALN)
+HipSTR: $(OBJ_COMMON) $(OBJ_HIPSTR) $(CEPHES_LIB) $(OBJ_SEQALN)
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

-DenovoFinder: $(OBJ_DENOVO) $(HTSLIB_LIB)
+DenovoFinder: $(OBJ_DENOVO)
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

-PhasingChecker: src/check_phasing.cpp src/region.cpp src/error.cpp src/haplotype_tracker.cpp src/version.cpp src/pedigree.cpp src/vcf_reader.cpp src/stringops.cpp $(HTSLIB_LIB)
+PhasingChecker: src/check_phasing.cpp src/region.cpp src/error.cpp src/haplotype_tracker.cpp src/version.cpp src/pedigree.cpp src/vcf_reader.cpp src/stringops.cpp
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

test/haplotype_test: test/haplotype_test.cpp src/SeqAlignment/Haplotype.cpp src/SeqAlignment/HapBlock.cpp src/SeqAlignment/NeedlemanWunsch.cpp src/error.cpp src/stringops.cpp
@@ -92,13 +87,13 @@ test/em_stutter_test: test/em_stutter_test.cpp src/em_stutter_genotyper.cpp src/
test/fast_ops_test: test/fast_ops_test.cpp src/mathops.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $^

-test/read_vcf_alleles_test: test/read_vcf_alleles_test.cpp src/error.cpp src/region.cpp src/vcf_input.cpp src/vcf_reader.cpp $(HTSLIB_LIB)
+test/read_vcf_alleles_test: test/read_vcf_alleles_test.cpp src/error.cpp src/region.cpp src/vcf_input.cpp src/vcf_reader.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

-test/snp_tree_test: src/snp_tree.cpp src/error.cpp test/snp_tree_test.cpp src/haplotype_tracker.cpp src/vcf_reader.cpp $(HTSLIB_LIB)
+test/snp_tree_test: src/snp_tree.cpp src/error.cpp test/snp_tree_test.cpp src/haplotype_tracker.cpp src/vcf_reader.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

-test/vcf_snp_tree_test: test/vcf_snp_tree_test.cpp src/error.cpp src/snp_tree.cpp src/haplotype_tracker.cpp src/vcf_reader.cpp $(HTSLIB_LIB)
+test/vcf_snp_tree_test: test/vcf_snp_tree_test.cpp src/error.cpp src/snp_tree.cpp src/haplotype_tracker.cpp src/vcf_reader.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

# Build each object file independently
@@ -111,8 +106,4 @@ test/vcf_snp_tree_test: test/vcf_snp_tree_test.cpp src/error.cpp src/snp_tree.cp

# Rebuild CEPHES library if needed
$(CEPHES_LIB):
- cd lib/cephes && $(MAKE)
+ cd lib/cephes && $(MAKE) CC="$(CC)"

# Rebuild htslib library if needed
$(HTSLIB_LIB):
-
-# Rebuild htslib library if needed
-$(HTSLIB_LIB):
- cd lib/htslib && $(MAKE)
+ cd lib/htslib && $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS) -I$(PREFIX)/include" LDFLAGS="$(LDFLAGS) -L$(PREFIX)/lib"
+ cd lib/cephes && $(MAKE) CC="$(CC)"
Loading
Loading