Compiling bamtools on a Mac OS Lion 64 bit machine

120 views
Skip to first unread message

Oliver Stolpe

unread,
Dec 15, 2011, 5:15:45 PM12/15/11
to bamtoo...@googlegroups.com
Hello list,

I try to compile bamtools (pezmaster31-bamtools-466bc50) on a Mac OS
Lion on a 64 bit machine. This works, but when I try to use the library,
I get funny errors:

---8<---

$ gcc -L/usr/local/lib/bamtools -I/usr/local/include/bamtools test.cpp
-lz -lbamtools
Undefined symbols for architecture x86_64:
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccoMsZa5.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccoMsZa5.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

$ cat test.cpp
#include "api/BamReader.h"
#include "api/BamWriter.h"

using namespace BamTools;

int main(int argc, char* argv[]) {
return 0;
}

--->8---

First, I wondered that in CMakeFiles/CMakeSystem.cmake the following
lines occured:

SET(CMAKE_SYSTEM_PROCESSOR "i386")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "i386")

Ok, when I call the "arch" command I get:
$ arch
i386

So I wondered why my Mac is returning a wrong architecture.
Nevertheless, I changed the value to "x86" and rebuild the system, but
nothing changed.

SET(CMAKE_SYSTEM_PROCESSOR "x86")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "x86")

Are there any suggestions how to compile it properly?

Thanks in advance,
Oliver

Oliver Stolpe

unread,
Dec 16, 2011, 5:31:48 AM12/16/11
to bamtoo...@googlegroups.com
Hello list,

sorry for answering my question myself after such a short time:

It works by using "g++" instead of "gcc".

Thanks for your patience,
Oliver


Am 15.12.11 23:15, schrieb Oliver Stolpe:

Reply all
Reply to author
Forward
0 new messages