Skip to content
Draft
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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@ At the moment, GLIMPSE2 performs imputation only from a reference panel of sampl

To build the source code, please refer to the [step-by-step guide on the website](https://odelaneau.github.io/GLIMPSE/docs/installation).

#### Building on macOS

GLIMPSE2 supports macOS builds, including Apple Silicon (ARM64) devices. The build system automatically detects dependencies installed via Homebrew.

**Prerequisites:**
```bash
# Install dependencies via Homebrew
brew install boost htslib openssl@3 libdeflate
```

**Building:**
```bash
# Build all tools
make

# Or build individual tools
make phase
make chunk
make ligate
make split_reference
make concordance
```

**Platform-specific notes:**

- **⚠️ Performance Note (WIP):** On Apple Silicon and other ARM platforms, GLIMPSE2 currently uses scalar fallback implementations instead of AVX2 SIMD instructions. This means **significantly slower performance** compared to x86_64 with AVX2. Native ARM NEON optimizations are planned for future releases.
- On x86_64 platforms, native AVX2/FMA instructions are used for optimal performance
- The build system automatically detects the architecture and applies appropriate compiler flags

#### Docker images

##### Dockerhub
Expand Down
42 changes: 40 additions & 2 deletions chunk/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LDFLAG=-O3

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lpthread -lbz2 -llzma -lcurl -lcrypto -ldeflate
BASE_DYN_LIBS := $(DYN_LIBS)

HFILE=$(shell find src -name *.h)
CFILE=$(shell find src -name *.cpp)
Expand All @@ -25,6 +26,34 @@ NAME=$(shell basename $(CURDIR))
BFILE=bin/GLIMPSE2_$(NAME)
EXEFILE=bin/GLIMPSE2_$(NAME)_static

BREW_AVAILABLE := $(shell command -v brew 2>/dev/null)
BOOST_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix boost 2>/dev/null),)
HTSLIB_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix htslib 2>/dev/null),)

BOOST_INC_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/include,)
BOOST_LIB_DIR_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/lib,)
BOOST_LIB_IO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.a $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.dylib $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.so))
BOOST_LIB_PO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_program_options.a $(BOOST_LIB_DIR_AUTO)/libboost_program_options.dylib $(BOOST_LIB_DIR_AUTO)/libboost_program_options.so))
BOOST_LIB_SE_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_serialization.a $(BOOST_LIB_DIR_AUTO)/libboost_serialization.dylib $(BOOST_LIB_DIR_AUTO)/libboost_serialization.so))

HTSLIB_INC_AUTO := $(if $(HTSLIB_PREFIX_AUTO),$(HTSLIB_PREFIX_AUTO)/include,)
HTSLIB_LIB_AUTO := $(firstword $(wildcard $(HTSLIB_PREFIX_AUTO)/lib/libhts.a $(HTSLIB_PREFIX_AUTO)/lib/libhts.dylib $(HTSLIB_PREFIX_AUTO)/lib/libhts.so))

OPENSSL_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix openssl@3 2>/dev/null),)
LIBDEFLATE_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix libdeflate 2>/dev/null),)

EXTRA_LDFLAGS_AUTO := $(strip $(if $(BOOST_LIB_DIR_AUTO),-L$(BOOST_LIB_DIR_AUTO)) $(if $(HTSLIB_PREFIX_AUTO),-L$(HTSLIB_PREFIX_AUTO)/lib) $(if $(OPENSSL_PREFIX_AUTO),-L$(OPENSSL_PREFIX_AUTO)/lib) $(if $(LIBDEFLATE_PREFIX_AUTO),-L$(LIBDEFLATE_PREFIX_AUTO)/lib))

DEFAULT_BOOST_INC := $(or $(BOOST_INC_AUTO),/usr/include)
DEFAULT_BOOST_LIB_IO := $(or $(BOOST_LIB_IO_AUTO),-lboost_iostreams)
DEFAULT_BOOST_LIB_PO := $(or $(BOOST_LIB_PO_AUTO),-lboost_program_options)
DEFAULT_BOOST_LIB_SE := $(or $(BOOST_LIB_SE_AUTO),-lboost_serialization)

DEFAULT_HTSLIB_INC := $(or $(HTSLIB_INC_AUTO),/home/srubinac/git/htslib-1.17)
DEFAULT_HTSLIB_LIB := $(or $(HTSLIB_LIB_AUTO),/home/srubinac/git/htslib-1.17/libhts.a)

.DEFAULT_GOAL := auto

#COMMIT_VERS=$(shell git rev-parse --short HEAD)
#COMMIT_DATE=$(shell git log -1 --format=%cd --date=short)
#CXXFLAG+= -D__COMMIT_ID__=\"$(COMMIT_VERS)\"
Expand Down Expand Up @@ -147,10 +176,19 @@ static_exe: BOOST_LIB_SE=/usr/local/lib/libboost_serialization.a
static_exe: $(EXEFILE)

#COMPILATION RULES
all: desktop
all: auto

auto: BOOST_INC=$(DEFAULT_BOOST_INC)
auto: BOOST_LIB_IO=$(DEFAULT_BOOST_LIB_IO)
auto: BOOST_LIB_PO=$(DEFAULT_BOOST_LIB_PO)
auto: BOOST_LIB_SE=$(DEFAULT_BOOST_LIB_SE)
auto: HTSLIB_INC=$(DEFAULT_HTSLIB_INC)
auto: HTSLIB_LIB=$(DEFAULT_HTSLIB_LIB)
auto: AUTO_LDFLAG=$(strip $(LDFLAG) $(EXTRA_LDFLAGS_AUTO))
auto: $(BFILE)

$(BFILE): $(OFILE)
$(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)
$(CXX) $(AUTO_LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)

$(EXEFILE): $(OFILE)
$(CXX) $(LDFLAG) -static -static-libgcc -static-libstdc++ -pthread -o $(EXEFILE) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) -Wl,-Bstatic $(DYN_LIBS)
Expand Down
42 changes: 40 additions & 2 deletions concordance/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LDFLAG=-O3

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lpthread -lbz2 -llzma -lcurl -lcrypto -ldeflate
BASE_DYN_LIBS := $(DYN_LIBS)

HFILE=$(shell find src -name *.h)
CFILE=$(shell find src -name *.cpp)
Expand All @@ -25,6 +26,34 @@ NAME=$(shell basename $(CURDIR))
BFILE=bin/GLIMPSE2_$(NAME)
EXEFILE=bin/GLIMPSE2_$(NAME)_static

BREW_AVAILABLE := $(shell command -v brew 2>/dev/null)
BOOST_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix boost 2>/dev/null),)
HTSLIB_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix htslib 2>/dev/null),)

BOOST_INC_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/include,)
BOOST_LIB_DIR_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/lib,)
BOOST_LIB_IO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.a $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.dylib $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.so))
BOOST_LIB_PO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_program_options.a $(BOOST_LIB_DIR_AUTO)/libboost_program_options.dylib $(BOOST_LIB_DIR_AUTO)/libboost_program_options.so))
BOOST_LIB_SE_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_serialization.a $(BOOST_LIB_DIR_AUTO)/libboost_serialization.dylib $(BOOST_LIB_DIR_AUTO)/libboost_serialization.so))

HTSLIB_INC_AUTO := $(if $(HTSLIB_PREFIX_AUTO),$(HTSLIB_PREFIX_AUTO)/include,)
HTSLIB_LIB_AUTO := $(firstword $(wildcard $(HTSLIB_PREFIX_AUTO)/lib/libhts.a $(HTSLIB_PREFIX_AUTO)/lib/libhts.dylib $(HTSLIB_PREFIX_AUTO)/lib/libhts.so))

OPENSSL_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix openssl@3 2>/dev/null),)
LIBDEFLATE_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix libdeflate 2>/dev/null),)

EXTRA_LDFLAGS_AUTO := $(strip $(if $(BOOST_LIB_DIR_AUTO),-L$(BOOST_LIB_DIR_AUTO)) $(if $(HTSLIB_PREFIX_AUTO),-L$(HTSLIB_PREFIX_AUTO)/lib) $(if $(OPENSSL_PREFIX_AUTO),-L$(OPENSSL_PREFIX_AUTO)/lib) $(if $(LIBDEFLATE_PREFIX_AUTO),-L$(LIBDEFLATE_PREFIX_AUTO)/lib))

DEFAULT_BOOST_INC := $(or $(BOOST_INC_AUTO),/usr/include)
DEFAULT_BOOST_LIB_IO := $(or $(BOOST_LIB_IO_AUTO),-lboost_iostreams)
DEFAULT_BOOST_LIB_PO := $(or $(BOOST_LIB_PO_AUTO),-lboost_program_options)
DEFAULT_BOOST_LIB_SE := $(or $(BOOST_LIB_SE_AUTO),-lboost_serialization)

DEFAULT_HTSLIB_INC := $(or $(HTSLIB_INC_AUTO),/home/srubinac/git/htslib-1.17)
DEFAULT_HTSLIB_LIB := $(or $(HTSLIB_LIB_AUTO),/home/srubinac/git/htslib-1.17/libhts.a)

.DEFAULT_GOAL := auto

#COMMIT_VERS=$(shell git rev-parse --short HEAD)
#COMMIT_DATE=$(shell git log -1 --format=%cd --date=short)
#CXXFLAG+= -D__COMMIT_ID__=\"$(COMMIT_VERS)\"
Expand Down Expand Up @@ -147,10 +176,19 @@ static_exe: BOOST_LIB_SE=/usr/local/lib/libboost_serialization.a
static_exe: $(EXEFILE)

#COMPILATION RULES
all: desktop
all: auto

auto: BOOST_INC=$(DEFAULT_BOOST_INC)
auto: BOOST_LIB_IO=$(DEFAULT_BOOST_LIB_IO)
auto: BOOST_LIB_PO=$(DEFAULT_BOOST_LIB_PO)
auto: BOOST_LIB_SE=$(DEFAULT_BOOST_LIB_SE)
auto: HTSLIB_INC=$(DEFAULT_HTSLIB_INC)
auto: HTSLIB_LIB=$(DEFAULT_HTSLIB_LIB)
auto: AUTO_LDFLAG=$(strip $(LDFLAG) $(EXTRA_LDFLAGS_AUTO))
auto: $(BFILE)

$(BFILE): $(OFILE)
$(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)
$(CXX) $(AUTO_LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)

$(EXEFILE): $(OFILE)
$(CXX) $(LDFLAG) -static -static-libgcc -static-libstdc++ -pthread -o $(EXEFILE) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) -Wl,-Bstatic $(DYN_LIBS)
Expand Down
42 changes: 40 additions & 2 deletions ligate/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ LDFLAG=-O3

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lpthread -lbz2 -llzma -lcurl -lcrypto -ldeflate
BASE_DYN_LIBS := $(DYN_LIBS)

HFILE=$(shell find src -name *.h)
CFILE=$(shell find src -name *.cpp)
Expand All @@ -25,6 +26,34 @@ NAME=$(shell basename $(CURDIR))
BFILE=bin/GLIMPSE2_$(NAME)
EXEFILE=bin/GLIMPSE2_$(NAME)_static

BREW_AVAILABLE := $(shell command -v brew 2>/dev/null)
BOOST_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix boost 2>/dev/null),)
HTSLIB_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix htslib 2>/dev/null),)

BOOST_INC_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/include,)
BOOST_LIB_DIR_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/lib,)
BOOST_LIB_IO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.a $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.dylib $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.so))
BOOST_LIB_PO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_program_options.a $(BOOST_LIB_DIR_AUTO)/libboost_program_options.dylib $(BOOST_LIB_DIR_AUTO)/libboost_program_options.so))
BOOST_LIB_SE_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_serialization.a $(BOOST_LIB_DIR_AUTO)/libboost_serialization.dylib $(BOOST_LIB_DIR_AUTO)/libboost_serialization.so))

HTSLIB_INC_AUTO := $(if $(HTSLIB_PREFIX_AUTO),$(HTSLIB_PREFIX_AUTO)/include,)
HTSLIB_LIB_AUTO := $(firstword $(wildcard $(HTSLIB_PREFIX_AUTO)/lib/libhts.a $(HTSLIB_PREFIX_AUTO)/lib/libhts.dylib $(HTSLIB_PREFIX_AUTO)/lib/libhts.so))

OPENSSL_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix openssl@3 2>/dev/null),)
LIBDEFLATE_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix libdeflate 2>/dev/null),)

EXTRA_LDFLAGS_AUTO := $(strip $(if $(BOOST_LIB_DIR_AUTO),-L$(BOOST_LIB_DIR_AUTO)) $(if $(HTSLIB_PREFIX_AUTO),-L$(HTSLIB_PREFIX_AUTO)/lib) $(if $(OPENSSL_PREFIX_AUTO),-L$(OPENSSL_PREFIX_AUTO)/lib) $(if $(LIBDEFLATE_PREFIX_AUTO),-L$(LIBDEFLATE_PREFIX_AUTO)/lib))

DEFAULT_BOOST_INC := $(or $(BOOST_INC_AUTO),/usr/include)
DEFAULT_BOOST_LIB_IO := $(or $(BOOST_LIB_IO_AUTO),-lboost_iostreams)
DEFAULT_BOOST_LIB_PO := $(or $(BOOST_LIB_PO_AUTO),-lboost_program_options)
DEFAULT_BOOST_LIB_SE := $(or $(BOOST_LIB_SE_AUTO),-lboost_serialization)

DEFAULT_HTSLIB_INC := $(or $(HTSLIB_INC_AUTO),/home/srubinac/git/htslib-1.17)
DEFAULT_HTSLIB_LIB := $(or $(HTSLIB_LIB_AUTO),/home/srubinac/git/htslib-1.17/libhts.a)

.DEFAULT_GOAL := auto

#COMMIT_VERS=$(shell git rev-parse --short HEAD)
#COMMIT_DATE=$(shell git log -1 --format=%cd --date=short)
#CXXFLAG+= -D__COMMIT_ID__=\"$(COMMIT_VERS)\"
Expand Down Expand Up @@ -147,10 +176,19 @@ static_exe: BOOST_LIB_SE=/usr/local/lib/libboost_serialization.a
static_exe: $(EXEFILE)

#COMPILATION RULES
all: desktop
all: auto

auto: BOOST_INC=$(DEFAULT_BOOST_INC)
auto: BOOST_LIB_IO=$(DEFAULT_BOOST_LIB_IO)
auto: BOOST_LIB_PO=$(DEFAULT_BOOST_LIB_PO)
auto: BOOST_LIB_SE=$(DEFAULT_BOOST_LIB_SE)
auto: HTSLIB_INC=$(DEFAULT_HTSLIB_INC)
auto: HTSLIB_LIB=$(DEFAULT_HTSLIB_LIB)
auto: AUTO_LDFLAG=$(strip $(LDFLAG) $(EXTRA_LDFLAGS_AUTO))
auto: $(BFILE)

$(BFILE): $(OFILE)
$(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)
$(CXX) $(AUTO_LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)

$(EXEFILE): $(OFILE)
$(CXX) $(LDFLAG) -static -static-libgcc -static-libstdc++ -pthread -o $(EXEFILE) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) -Wl,-Bstatic $(DYN_LIBS)
Expand Down
17 changes: 13 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
projects = chunk concordance ligate phase split_reference

.PHONY: all $(projects)
BOOST_INC := $(shell brew --prefix boost)/include
BOOST_LIB := $(shell brew --prefix boost)/lib

CXXFLAGS += -I$(BOOST_INC)
LDFLAGS += -L$(BOOST_LIB)
LDLIBS += -lboost_program_options

.PHONY: all $(projects) clean

all: $(projects)

$(projects):
$(MAKE) -C $@ $(COMPILATION_ENV)
$(MAKE) -C $@ $(COMPILATION_ENV) \
CXXFLAGS="$(CXXFLAGS)" \
LDFLAGS="$(LDFLAGS)" \
LDLIBS="$(LDLIBS)"

clean:
for dir in $(projects); do \
$(MAKE) $@ -C $$dir; \
$(MAKE) -C $$dir clean; \
done

49 changes: 46 additions & 3 deletions phase/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ dummy_build_folder_obj := $(shell mkdir -p obj)
#COMPILER & LINKER FLAGS
CXXFLAG=-O3 -Wno-ignored-attributes
LDFLAG=-O3
HOST_ARCH := $(shell uname -m)

#CXXFLAG=-O0 -g -Wno-ignored-attributes
#LDFLAG=-O0

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lpthread -lbz2 -llzma -lcurl -lcrypto -ldeflate
BASE_DYN_LIBS := $(DYN_LIBS)

HFILE=$(shell find src -name *.h)
CFILE=$(shell find src -name *.cpp)
Expand All @@ -25,13 +27,45 @@ NAME=$(shell basename $(CURDIR))
BFILE=bin/GLIMPSE2_$(NAME)
EXEFILE=bin/GLIMPSE2_$(NAME)_static

BREW_AVAILABLE := $(shell command -v brew 2>/dev/null)
BOOST_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix boost 2>/dev/null),)
HTSLIB_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix htslib 2>/dev/null),)

BOOST_INC_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/include,)
BOOST_LIB_DIR_AUTO := $(if $(BOOST_PREFIX_AUTO),$(BOOST_PREFIX_AUTO)/lib,)
BOOST_LIB_IO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.a $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.dylib $(BOOST_LIB_DIR_AUTO)/libboost_iostreams.so))
BOOST_LIB_PO_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_program_options.a $(BOOST_LIB_DIR_AUTO)/libboost_program_options.dylib $(BOOST_LIB_DIR_AUTO)/libboost_program_options.so))
BOOST_LIB_SE_AUTO := $(firstword $(wildcard $(BOOST_LIB_DIR_AUTO)/libboost_serialization.a $(BOOST_LIB_DIR_AUTO)/libboost_serialization.dylib $(BOOST_LIB_DIR_AUTO)/libboost_serialization.so))

HTSLIB_INC_AUTO := $(if $(HTSLIB_PREFIX_AUTO),$(HTSLIB_PREFIX_AUTO)/include,)
HTSLIB_LIB_AUTO := $(firstword $(wildcard $(HTSLIB_PREFIX_AUTO)/lib/libhts.a $(HTSLIB_PREFIX_AUTO)/lib/libhts.dylib $(HTSLIB_PREFIX_AUTO)/lib/libhts.so))

OPENSSL_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix openssl@3 2>/dev/null),)
LIBDEFLATE_PREFIX_AUTO := $(if $(BREW_AVAILABLE),$(shell brew --prefix libdeflate 2>/dev/null),)

EXTRA_LDFLAGS_AUTO := $(strip $(if $(BOOST_LIB_DIR_AUTO),-L$(BOOST_LIB_DIR_AUTO)) $(if $(HTSLIB_PREFIX_AUTO),-L$(HTSLIB_PREFIX_AUTO)/lib) $(if $(OPENSSL_PREFIX_AUTO),-L$(OPENSSL_PREFIX_AUTO)/lib) $(if $(LIBDEFLATE_PREFIX_AUTO),-L$(LIBDEFLATE_PREFIX_AUTO)/lib))

DEFAULT_BOOST_INC := $(or $(BOOST_INC_AUTO),/usr/include)
DEFAULT_BOOST_LIB_IO := $(or $(BOOST_LIB_IO_AUTO),-lboost_iostreams)
DEFAULT_BOOST_LIB_PO := $(or $(BOOST_LIB_PO_AUTO),-lboost_program_options)
DEFAULT_BOOST_LIB_SE := $(or $(BOOST_LIB_SE_AUTO),-lboost_serialization)

DEFAULT_HTSLIB_INC := $(or $(HTSLIB_INC_AUTO),/home/srubinac/git/htslib-1.17)
DEFAULT_HTSLIB_LIB := $(or $(HTSLIB_LIB_AUTO),/home/srubinac/git/htslib-1.17/libhts.a)

.DEFAULT_GOAL := auto

#COMMIT_VERS=$(shell git rev-parse --short HEAD)
#COMMIT_DATE=$(shell git log -1 --format=%cd --date=short)
#CXXFLAG+= -D__COMMIT_ID__=\"$(COMMIT_VERS)\"
#CXXFLAG+= -D__COMMIT_DATE__=\"$(COMMIT_DATE)\"

ifeq ($(NAME),phase)
CXXFLAG+=-mavx2 -mfma
ifeq ($(HOST_ARCH),x86_64)
CXXFLAG+=-mavx2 -mfma
else
$(info Skipping AVX2/FMA flags for architecture $(HOST_ARCH))
endif
endif

COMMIT_VERS=3bed6d9
Expand Down Expand Up @@ -147,10 +181,19 @@ static_exe: BOOST_LIB_SE=/usr/local/lib/libboost_serialization.a
static_exe: $(EXEFILE)

#COMPILATION RULES
all: desktop
all: auto

auto: BOOST_INC=$(DEFAULT_BOOST_INC)
auto: BOOST_LIB_IO=$(DEFAULT_BOOST_LIB_IO)
auto: BOOST_LIB_PO=$(DEFAULT_BOOST_LIB_PO)
auto: BOOST_LIB_SE=$(DEFAULT_BOOST_LIB_SE)
auto: HTSLIB_INC=$(DEFAULT_HTSLIB_INC)
auto: HTSLIB_LIB=$(DEFAULT_HTSLIB_LIB)
auto: AUTO_LDFLAG=$(strip $(LDFLAG) $(EXTRA_LDFLAGS_AUTO))
auto: $(BFILE)

$(BFILE): $(OFILE)
$(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)
$(CXX) $(AUTO_LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) $(BGEN_LIB) -o $@ $(DYN_LIBS)

$(EXEFILE): $(OFILE)
$(CXX) $(LDFLAG) -static -static-libgcc -static-libstdc++ -pthread -o $(EXEFILE) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) $(BOOST_LIB_SE) -Wl,-Bstatic $(DYN_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion phase/src/models/imputation_hmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <utils/otools.h>
#include <containers/conditioning_set.h>
#include <immintrin.h>
#include "simd_compat.h"
#include <boost/align/aligned_allocator.hpp>

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion phase/src/models/phasing_hmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <utils/otools.h>
#include <containers/conditioning_set.h>
#include <immintrin.h>
#include "simd_compat.h"
#include <boost/align/aligned_allocator.hpp>

template <typename T>
Expand Down
Loading