VPhaserII installation on Mac OSX

54 views
Skip to first unread message

bram.v...@gmail.com

unread,
Nov 27, 2015, 3:13:09 AM11/27/15
to Broad Viral Tool Users
Dear all,

I am trying to install VPhaserII on my Mac.  When I run ‘make’ from the src directory, with the default compiler on Mac OSX, I get the following error message:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/usr/bin/g++ -fopenmp -O3 -I/bioSoft/bamtools-2.2.1//include/ -I/bioSoft/boost_1_58_0// -L/bioSoft/bamtools-2.2.1//lib *.cpp -o ../bin/variant_caller -lpthread -lbamtools
In file included from aln_manip.cpp:12:
In file included from ./aln_manip.h:18:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from bam_manip.cpp:13:
In file included from ./bam_manip.h:18:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from em.cpp:13:
In file included from ./em.h:18:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from format.cpp:13:
In file included from ./format.h:18:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from main.cpp:22:
In file included from ./Parameter.h:22:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from phase.cpp:13:
In file included from ./phase.h:17:
In file included from ./pileup.h:17:
In file included from ./stat_func.h:17:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from pileup.cpp:13:
In file included from ./pileup.h:17:
In file included from ./stat_func.h:17:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
In file included from stat_func.cpp:13:
In file included from ./stat_func.h:17:
./xutil.h:28:10: fatal error: 'omp.h' file not found
#include <omp.h>
        ^
1 error generated.
make: *** [all] Error 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Because of this I changed to COMPILER=/usr/gcc-5.1.0/bin/g++-5.1.0, but now this cryptic message appears:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/usr/gcc-5.1.0/bin/g++-5.1.0 -fopenmp -O3 -I/bioSoft/bamtools-2.2.1//include/ -I/bioSoft/boost_1_58_0// -L/bioSoft/bamtools-2.2.1//lib *.cpp -o ../bin/variant_caller -lpthread -lbamtools
Undefined symbols for architecture x86_64:
  "BamTools::BamReader::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      sampling(int&, int&, int&, int&, int&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int) in ccv1OsFe.o
      gather_alignments(std::vector<BamTools::BamAlignment, std::allocator<BamTools::BamAlignment> >&, std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RefContent> >&, int, int, GlobalParam const&, Parameter const&) in ccv1OsFe.o
      parse_bam_header(GlobalParam&, int&)  in ccv1OsFe.o
      set_rmap_array(GlobalParam&, Parameter const&) in ccv1OsFe.o
  "BamTools::BamReader::GetReferenceID(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
      parse_bam_header(GlobalParam&, int&)  in ccv1OsFe.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [all] Error 1
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Does anyone have a suggestion for a workaround?

Thanks very much in advance!
Bram

Sivan Leviyang

unread,
Mar 2, 2016, 2:49:08 PM3/2/16
to Broad Viral Tool Users
Hi Bram.  I've run into the same problem.  Did you find a solution?

Bram Vrancken

unread,
Mar 2, 2016, 2:54:15 PM3/2/16
to viral-to...@googlegroups.com
Hi,

No, I haven’t… The post on the user list group on feb 1 by Daniel Park referred to some other way, but I I haven’t tried this method yet.

Cheers,
Bram 


--
You received this message because you are subscribed to a topic in the Google Groups "Broad Viral Tool Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/viral-tool-users/r-AVQsaRj-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to viral-tool-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Tomkins-Tinch

unread,
Mar 3, 2016, 9:25:23 AM3/3/16
to Broad Viral Tool Users
If you only need v-phaser, you might give the conda package a try:
http://bioconda.github.io/recipes/vphaser2/README.html

Sivan Leviyang

unread,
Mar 3, 2016, 3:23:04 PM3/3/16
to Broad Viral Tool Users

I've been able to get around this problem.  Building VPhaser2 on mac OS X (I run v10.11 El Capitan) runs into problems because OS X has substituted the clang/llmv compiler for g++ in recent releases.  So when you call g++ or gcc, you are actually calling clang.  The VPhaser2 build fails because clang doesn't connect to openmp, at least not using the -fopenmp flag.   I am not an expert on all this, but this is what I've gathered.


Looking through some posts there seemed to be two options (1) install openmp and then link using clang or (2) install g++ in Mac OS.  I went with the second option.


Installing g++ was easy (although took about 2 hours including build) using these directions.


https://solarianprogrammer.com/2015/05/01/compiling-gcc-5-mac-os-x/


I then went on to build VPhaser2 using the provided makefile.  One change that needs to be made is that the makefile COMPILER option needs to be changed to the following (I added the g++-5.2.0 path to my PATH):


COMPILER=g++-5.2.0


Note that if you use gcc-5.2.0 the build won't work, apparently due to differences in g++ and gcc standard library files.  So use g++-5.2.0.


BUT, I then ran into another problem similar to that noted in the post here


https://groups.google.com/forum/#!topic/viral-tool-users/JVp5RIxj8N8


I was able to fix this problem by just adding 


#include <climits>


to bam_manip.cpp (found in src folder of VPhaser2).  I did also reinstall bamtools using g++-5.2.0 rather than the OS X gcc (i.e. clang).  I'm not sure if this made any difference, but at some point I had problems linking to bamtools when I built VPhaser2 using g++-5.2.0.


Best,

Sivan

Clifford Beall

unread,
Apr 20, 2017, 3:47:39 PM4/20/17
to Broad Viral Tool Users
Dear Sivan-

How did you reinstall bamtools specifying a different compiler? I changed the VPhaser compiler to g++-6 and got past the omp.h thing and did the #include <climits> to get past the INT_MAX error but now I'm seeing "undefined symbols for architecture" and some problem with bamtools.

I didn't see an obvious way to do get bamtools to compile with a different gcc or g++, although I can think of some crude hacks I'm not that  eager to try them.

Best, Cliff

Sivan Leviyang

unread,
Apr 21, 2017, 10:52:26 AM4/21/17
to viral-to...@googlegroups.com
Hi Cliff.  It's been a while and I don't remember what I did exactly.  To the best of my recollection, I had to change the compiler cmake was using.   The build instructions for bamtools are here

 
The following link discusses changing the cmake compiler


and then the bamtools distribution contains the file CMakeLists.txt which you can edit prior to the build as discussed in the link above.   I'm not sure if this will work, but this is my foggy recollection of how I built bamtools so it linked with VPhaserII.

--
You received this message because you are subscribed to the Google Groups "Broad Viral Tool Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to viral-tool-users+unsubscribe@googlegroups.com.

Clifford Beall

unread,
Apr 24, 2017, 9:45:06 AM4/24/17
to Broad Viral Tool Users
Thanks, I found I could get it to compile on Linux with that #include <climits> hack, so I won't worry about the mac for now.
To unsubscribe from this group and stop receiving emails from it, send an email to viral-tool-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages