On Fri, Jul 25, 2014 at 12:55:10PM +0200, G. Gopakumar wrote:
...
> Reinstalling diffpy from scratch didn't work in my case.
> I still get the following error message while running the
> tests
...
> # Testing diffpy.srreal:
> .Python(21973,0x7fff75a90310) malloc: *** error for object 0x10989a310:
> pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> ./runtests.sh: line 12: 21973 Abort trap: 6 python -m
> diffpy.srreal.tests.run
...
> After that I tried the commands that you mentioned in your email, the
> output looked a
> bit different from what you had in your machine. Please find it below:
>
> =====================================
>
> mccec0054:diffpy_cmi-1.0 gopa$ zsh -c 'otool -L lib/**/*.(so|dylib)' | xargs ls -d 2>/dev/null | uniq
> /Users/gopa/Utilities/diffpy_cmi-1.0/lib/libObjCryst.dylib
> /Users/gopa/Utilities/diffpy_cmi-1.0/lib/libdiffpy.dylib
> /opt/local/lib/libgsl.0.dylib
> /opt/local/lib/libgslcblas.0.dylib
> /usr/lib/libSystem.B.dylib
> /usr/lib/libc++.1.dylib
> /usr/local/lib/libgcc_s.1.dylib
> /usr/local/lib/libstdc++.6.dylib
Hi Gopakumar,
The culprit is in the last 2 lines - it seems there is another
version of g++ installed under /usr/local, which is used instead of
the XCode compiler in /usr/bin. The MacPorts Python is built by
XCode, but DiffPy libraries by some other compiler resulting in
incompatibilities.
This can be fixed by adjusting the PATH in your terminal session
so that the XCode g++ is found before the one in /usr/local/bin:
export PATH="/opt/local/bin:/usr/bin:${PATH}"
Check if the g++ and python commands are found in the PATH as
intended, ie,
$ which python
/opt/local/bin/python
$ which g++
/usr/bin/g++
and if so, reinstall the DiffPy-CMI again.
If you prefer to have your local g++ as the first compiler,
you can avoid the mixed compilation of DiffPy-CMI in the future
by editing all sconscript.local files in the src/ folder;
there should be 3 of them in
src/diffpy.srreal/sconscript.local
src/libdiffpy/sconscript.local
src/pyobjcryst/sconscript.local
and appending the following line to the end of each file:
env.Replace(CXX='/usr/bin/g++')
This line sets the C++ compiler with its full path so the build
system would then use the XCode g++ regardless of the PATH value.
I hope this will finally work. Thanks for your patience with
DiffPy-CMI. Best,