← Back to team overview

dolfin team mailing list archive

Re: Some shared_ptr information

 

Hi All,
I've been running into similar problems on macosx with the JIT compiler for Dolfin Functions in PyDolfin

info:
python-2.5 from the enthought distribution
OS is macosx-10.4.11 intel.
swig-1.3.36
Dolfin 0.9.1 (development version)
FFC 0.6.1 (development version)
instant (dev version etc...)


running something like the restriction-interpolation demo, I get

Calling FFC just-in-time (JIT) compiler, this may take some time... done
Creating Python extension (compiling and linking), this may take some time... done
Calling FFC just-in-time (JIT) compiler, this may take some time... done
Creating Python extension (compiling and linking), this may take some time... done Calling DOLFIN Function just-in-time (JIT) compiler, this may take some time...In instant.recompile: The module did not compile, see '/ tmp/tmpVKDvoA2009-2-27-15-07_instant/ dolfin_compile_function_227f8d92341151df5a32d2c19fc7a041/compile.log'

looking at the log file, the issue seems to be that the compiler is using the options

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup blah blah blah

which appends /Developer/SDKs/MacOSX10.4u.sdk/ in front of some of my dynamic library paths which generates missing symbols etc. etc (in addition, I don't want to build for ppc but that doesn't seem as serious)

In particular, my openmpi libraries happen to be in /Applications/ mpich/openmpi-1.2.8/lib

but ld  complains:

warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/ Applications/mpich/openmpi-1.2.8/lib/libmpi_cxx.0.dylib referenced from: /Users/mspieg/mspieg/hg_repositories/FEniCS/ srcFEniCS/dolfin/local/lib/libdolfin.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)

and then generates a pile of missing MPI symbols.

All the c++ demos work as does some of the mesh and plotting python demos. Unfortunately, projection from python is just what I need (and I'm hoping there's an easy fix)

All help greatly appreciated
cheers
marc




On Jan 16, 2009, at 8:31 AM, Harish Narayanan wrote:

Johan Hake wrote:
Hello!

After I added shared_ptr support for PyDOLFIN things have stabelized, I think... but there are some issues you should be aware of. We need swig version 1.3.35 or higher. This version comes with ubuntu 08.10 (intrepid). Johannes are going to compile the newest swig, 1.3.37 and put it in our apt repositories. I assume this also will be done for ubuntu 08.10? This last version came this week, and it comes with a fix for std::tr1::shared_ptr,
making it possible to change back to tr1.

The nice thing with shared_ptrs in PyDOLFIN is that we no longer have to keep any references for instances we do not want to get garbage collected in python, as swig now use a shared_ptr to store the underlying c++ instance.
And of course it interact better with the c++ library which now use
shared_ptrs quite heavily.

I am running into some troubles with the JIT compiler after these recent
changes. I have Swig 1.3.35 and have run instant-clean.

When I try to run a(ny) python demo, it fails with a 'module did not
compile' and points me to a log file. Here is its head:

running build_ext
building '_form_631c2971bc63dc564a258685317dbc7c19bb5b84' extension
creating build
creating build/temp.macosx-10.5-i386-2.5
gcc -fno-strict-aliasing -Wno-long-double -mno-fused-madd -DNDEBUG -g
-fwrapv -O3 -Wall -Wstrict-prototypes
-I/Users/hnarayan/Work/FEniCS/build/include -I/sw/include/python2.5 -c
form_631c2971bc63dc564a258685317dbc7c19bb5b84_wrap.cxx -o
build/temp.macosx-10.5-i386-2.5/ form_631c2971bc63dc564a258685317dbc7c19bb5b84_wrap.o
-O0
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
C/ObjC but not for C++
form_631c2971bc63dc564a258685317dbc7c19bb5b84_wrap.cxx:2625:33: error:
boost/shared_ptr.hpp: No such file or directory
form_631c2971bc63dc564a258685317dbc7c19bb5b84_wrap.cxx:2640: error:
‘boost’ has not been declared

... many more related errors.

The compiler flags seem to be missing a -I/where/boost/includes/are and
-L/where/boost/libs/are . They are present in the corresponding scons
compile/link lines for the C++ demos which do not have this problem.

Harish
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev

----------------------------------------------------
Marc Spiegelman
Lamont-Doherty Earth Observatory
Dept. of Applied Physics/Applied Math
Columbia University
http://www.ldeo.columbia.edu/~mspieg
tel: 845 704 2323 (SkypeIn)
----------------------------------------------------



Follow ups

References