Open beausoleilmo opened 4 years ago
I get the same error while trying to install SHAPEIT4 on macOS Catalina (10.15).
$ make
g++ -std=c++11 -O3 -mavx2 -mfma -c src/io/haplotype_writer.cpp -o obj/haplotype_writer.o -Isrc -I/usr/local/Cellar/htslib/1.9 -I/usr/local/Cellar/boost/1.72.0
In file included from src/io/haplotype_writer.cpp:22:
In file included from src/io/haplotype_writer.h:25:
In file included from src/utils/otools.h:63:
src/utils/string_utils.h:64:26: error: use of undeclared identifier 'setiosflags'; did you mean 'std::setiosflags'?
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
^~~~~~~~~~~
std::setiosflags
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iomanip:126:1: note: 'std::setiosflags' declared here
setiosflags(ios_base::fmtflags __mask)
^
In file included from src/io/haplotype_writer.cpp:22:
In file included from src/io/haplotype_writer.h:25:
In file included from src/utils/otools.h:63:
src/utils/string_utils.h:72:26: error: use of undeclared identifier 'setiosflags'; did you mean 'std::setiosflags'?
if (prec >= 0) { ss << setiosflags( std::ios::fixed ); ss.precision(prec); }
^~~~~~~~~~~
std::setiosflags
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iomanip:126:1: note: 'std::setiosflags' declared here
setiosflags(ios_base::fmtflags __mask)
^
2 errors generated.
make: *** [obj/haplotype_writer.o] Error 1
I have both HTSlib and Boost installed via Homebrew. Here are my local changes to specify my own paths for those dependencies, as instructed at https://odelaneau.github.io/shapeit4/#installation:
$ git diff
diff --git a/makefile b/makefile
index c0bd9d2..6b3ce78 100644
--- a/makefile
+++ b/makefile
@@ -2,13 +2,18 @@
CXX=g++ -std=c++11
#HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
-HTSLIB_INC=$(HOME)/Tools/htslib-1.9
-HTSLIB_LIB=$(HOME)/Tools/htslib-1.9/libhts.a
+# HTSLIB_INC=$(HOME)/Tools/htslib-1.9
+# HTSLIB_LIB=$(HOME)/Tools/htslib-1.9/libhts.a
+HTSLIB_INC=/usr/local/Cellar/htslib/1.9
+HTSLIB_LIB=/usr/local/Cellar/htslib/1.9/lib/libhts.a
#BOOST IOSTREAM & PROGRAM_OPTION LIBRARIES [SPECIFY YOUR OWN PATHS]
-BOOST_INC=/usr/include
-BOOST_LIB_IO=/usr/lib/x86_64-linux-gnu/libboost_iostreams.a
-BOOST_LIB_PO=/usr/lib/x86_64-linux-gnu/libboost_program_options.a
+# BOOST_INC=/usr/include
+# BOOST_LIB_IO=/usr/lib/x86_64-linux-gnu/libboost_iostreams.a
+# BOOST_LIB_PO=/usr/lib/x86_64-linux-gnu/libboost_program_options.a
+BOOST_INC=/usr/local/Cellar/boost/1.72.0
+BOOST_LIB_IO=/usr/local/Cellar/boost/1.72.0/lib/libboost_iostreams.a
+BOOST_LIB_PO=/usr/local/Cellar/boost/1.72.0/lib/libboost_program_options.a
#HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
#HTSLIB_INC=/software/UHTS/Analysis/samtools/1.4/include
Being able to use SHAPEIT4 on Mac would be convenient!
I worked around this issue by using this Docker image: https://hub.docker.com/r/cwhelan/shapeit4.
I'd still prefer to be able to build a Mac binary for SHAPEIT4, but this suffices for me in the meantime.
If you replace setiosflags
with std::setiosflags
at those 4 locations, it should compile fine on Mac.
I've been trying to install shapeit4 on Mac (macOS Mojave, 10.14.6).
I installed HTSlib and BOOST (using BREW) and found all the files that I needed to put into the makefile.
I've also modified the CXXFLAG to run without avx2 (since I don't have that option)
But when I use
make
, I always get this error: