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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
16 changes: 16 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,23 @@ CXXFLAG=-O3 -mavx2 -mfma

LDFLAG=-O3

#INSTALLATION
INSTALL=cp
INSTALL_PROGRAM=$(INSTALL)
INSTALL_DATA=$(INSTALL) -m 644
DISTDIR=/usr/local

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lbz2 -lm -lpthread -llzma -lcurl -lssl -lcrypto

# MAC BUILD - DYNAMICALLY LINKED
ifeq ($(shell uname -s),Darwin)
HTSLIB_LIB:=-lhts
BOOST_LIB_IO:=-lboost_iostreams
BOOST_LIB_PO:=-lboost_program_options
DYN_LIBS:=
endif

#SHAPEIT SOURCES & BINARY
BFILE=bin/shapeit4.2
HFILE=$(shell find src -name *.h)
Expand All @@ -54,3 +67,6 @@ obj/%.o: %.cpp $(HFILE)

clean:
rm -f obj/*.o $(BFILE)

install: $(BFILE)
$(INSTALL_PROGRAM) $(BFILE) $(DESTDIR)/$(BFILE)
11 changes: 11 additions & 0 deletions scripts/build_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Requirements to install on Mac:
# Install from homebrew: htslib boost
# Make sure that your environment has Homebrew's include and library paths are on your C compiler's search path
# For example, in your .zshrc
# export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
# export CPATH="$(brew --prefix)/include"

# We are using dynamically linked libhts, which makes building much easier. We don't need libcrypto, libssl, or even pthreads.
make -j8 HTSLIB_LIB="-lhts" BOOST_LIB_IO="-lboost_iostreams" BOOST_LIB_PO="-lboost_program_options" DYN_LIBS=""
4 changes: 2 additions & 2 deletions src/utils/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class string_utils {
template < class T >
std::string str(T n, int prec = -1) {
std::ostringstream ss( std::stringstream::out );
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
if (prec >= 0) { ss << std::setiosflags( std::ios::fixed ); ss.precision(prec); }
ss << n;
return ss.str();
}

template < class T >
std::string str(std::vector < T > & v, int prec = -1) {
std::ostringstream ss( std::stringstream::out );
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
if (prec >= 0) { ss << std::setiosflags( std::ios::fixed ); ss.precision(prec); }
for (int e = 0 ; e < v.size() ; e ++) ss << (e>0?" ":"") << v[e] ;
return ss.str();
}
Expand Down
4 changes: 2 additions & 2 deletions tools/bingraphsample/src/utils/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class string_utils {
template < class T >
std::string str(T n, int prec = -1) {
std::ostringstream ss( std::stringstream::out );
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
if (prec >= 0) { ss << std::setiosflags( std::ios::fixed ); ss.precision(prec); }
ss << n;
return ss.str();
}

template < class T >
std::string str(std::vector < T > & v, int prec = -1) {
std::ostringstream ss( std::stringstream::out );
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
if (prec >= 0) { ss << std::setiosflags( std::ios::fixed ); ss.precision(prec); }
for (int e = 0 ; e < v.size() ; e ++) ss << (e>0?" ":"") << v[e] ;
return ss.str();
}
Expand Down