[vtkusers] Ongong woes building vtk on Mac OSX

Sean McInerney seanm at nmr.mgh.harvard.edu
Wed Sep 29 13:59:02 EDT 2004


Hi,

   The "interpreter not initialized" problems reminds me of a problem 
that I had on OSX related to initialization of static data. Do python's 
internals rely upon some static data or singletons that might not be 
initialized in the expected order on OSX?

   Also ... and of possible help to you ... If you are linking static 
objects into a dynamic library, you will likely need to compile your 
static objects as "position independent" or "relocatable" objects. 
Depending on your compiler, this just means adding '-fPIC', '-KPIC', 
etc. to the compiler flags.

-Sean

Sander Niemeijer wrote:
> Hi,
> 
> Some time ago I have been struggling with self-made Python builds myself 
> on Mac OS X.
> As far as I remember that specific error was indeed caused by using a 
> static version of the library instead of a shared variant. The problem 
> with the Python 2.3.3 version I use(d) is that the package does not 
> support a way to create a libpython2.3.dylib, so you have to do it 
> yourself. I borrowed my solution from the Python package in Fink. They 
> provide a manual dynamic link line after they build the Python package. 
> Something like:
> 
> cc -dynamiclib -all_load -framework System -framework CoreServices \
>    -framework Foundation ...../lib/python2.3/config/libpython2.3.a \
>    -o ...../lib/libpython2.3.dylib -install_name 
> ....../lib/libpython2.3.dylib \
>    -current_version 2.3 -compatibility_version 2.3
> 
> If you have Fink installed, just look at the contents of the file:
> 
> /sw/fink/10.3/stable/main/finkinfo/languages/python23.info
> 
> I hope this helps.
> 
> Best regards,
> Sander
> 
> On woensdag, sep 29, 2004, at 19:20 Europe/Amsterdam, Prabhu 
> Ramachandran wrote:
> 
>>>>>>> "JT" == Jens Thomas <j.m.h.thomas at dl.ac.uk> writes:
>>
>>
>> [...]
>>
>>     JT> I've had to build my own Python distribution as I was getting
>>     JT> the "Fatal Python error: Interpreter not initialized (version
>>     JT> mismatch?)" error due to tkinter not being installed with the
>>     JT> default Python installation on the Mac. As I don't have root
>>     JT> acces on the machine I'm working on (I'm working on it
>>     JT> remotely), I've decided to build my own python distribution
>>     JT> from scratch and use that instead. However, I'm now getting
>>     JT> errors during the build that I've pasted in below. I've also
>>     JT> included my CMakeCache.txt below that.
>>
>> I have no clue about the Mac and if this will help or not but you
>> could try to build your Python library as a shared library
>> (libpython2.3.so/dyld and not libpython2.3.a).  How you will do that,
>> I have no idea.
>>
>> HTH,
>> prabhu
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at: 
>> <http://public.kitware.com/cgi-bin/vtkfaq>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
> 
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list