[odb-users] Issue on OSX 10.10 (Yosemite)

David Sarrut David.Sarrut at creatis.insa-lyon.fr
Thu Nov 27 13:06:40 EST 2014


So, finally : I compile libodb and libodb-sqlite with clang and not gcc. I
was confused by a /usr/local/bin/c++ (gcc) used instead of /usr/bin/c++
(clang), because my PATH provide /usr/local/bin before /usr/bin.

Now compilations of libodb and libodb-sqlite are fine. Tests (from odb
examples) run fine. Otool show links with libc++ (and no libstdc++ except
for the odb compiler installed with brew).

My app (linked with odb), still has issue at run time, but it should not be
related with odb.

So in short for users of odb with OSX Yosemite :
- be sure to not mix several compilers (clang is default and should work)
- install odb compiler with brew thanks to Adnan package
- compile/install libodb and libodb-sqlite (or others) from sources, with
default cpp compiler (clang)

thank you !
David


On Thu, Nov 27, 2014 at 2:16 PM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Hi David,
>
> David Sarrut <David.Sarrut at creatis.insa-lyon.fr> writes:
>
> > I install odb with brew, and libodb + libodb-sqlite by compiling (clang).
> > No problem.
> >
> > However, my app (compiled with clang also) seg fault with :
> > ydDump(41632,0x7fff7710f300) malloc: ***
> > mach_vm_map(size=3557673734211198976) failed (error code=3)
> > *** error: can't allocate region
> > *** set a breakpoint in malloc_error_break to debug
> > libc++abi.dylib: terminating with uncaught exception of type
> > std::bad_alloc: std::bad_alloc
> > Abort trap: 6
> >
> > which is probably related to the confusion between libc++ / libstdc++ (of
> > odb brew ?).
>
> ODB installed from Brew should not affect how you build the runtimes
> and your application. Just think about it: you run the ODB compiler,
> it produces C++ code which you compile with Clang. The GCC used by
> ODB underneath and Clang that you use to build runtimes and your
> code are completely isolated. They cannot somehow influence each
> other via generated C++ source code.
>
> But it seems you still somehow end up using different runtimes. Run
> otool -L on your application and see if you see both libc++.dylib
> and libstdc++.dylib. If you do, that's the problem.
>
> Next build sizeof_funds.cxx mentioned in the step-by-step instructions,
> make sure that it runs, and verify with otool -L that it only links
> to libc++.dylib.
>
> Next run 'otool -L' on libodb.dylib and libodb-sqlite.dylib. Which
> runtimes to they link?
>
> One final thing: make sure you don't have some old (from Brew?)
> versions of libodb.dylib and libodb-sqlite.dylib installed somewhere
> (e.g., /usr/local/lib).
>
> Boris
>



-- 
David Sarrut, Phd
Directeur de recherche CNRS
CREATIS, UMR CNRS 5220, Inserm U 1044
Centre de lutte contre le cancer Léon Bérard
28 rue Laënnec, 69373 Lyon cedex 08
Tel : 04 78 78 51 51 / 06 74 72 05 42
http://www.creatis.insa-lyon.fr/~dsarrut
_________________________________
 "2 + 2 = 5,  for extremely large values of 2"
_________________________________


More information about the odb-users mailing list