[vtkusers] installing vtk on RHEL; fails to find Python.h
Amy Squillacote
ahs at cfdrc.com
Wed May 28 15:41:09 EDT 2008
Rahul Nabar wrote:
> On Wed, May 28, 2008 at 8:40 AM, Amy Squillacote <ahs at cfdrc.com> wrote:
>
>
>> Is Python.h in your /usr/local/lib/python2.4 directory? If not, set
>> PYTHON_INCLUDE_PATH to the directory containing this file. Also,
>> PYTHON_LIBRARY should be set to the full path to the python library,
>> including the library name (probably something ending in .a or .so).
>>
>
> Hi Amy,
>
> Thanks for those tips. I set the PYTHON_INCLUDE_PATH and also the TCL
> and TK paths and now the cmake was perfect. No errors. The compilation
> proceeded 98% and then I had a new error.
>
> I****************************************************************************************
> [ 98%] Building CXX object
> Wrapping/Python/CMakeFiles/vtkpython.dir/vtkPythonAppInit.o
> Linking CXX executable ../../bin/vtkpython
> CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function
> `vtkPythonAppInitPrependPythonPath(char const*)':
> vtkPythonAppInit.cxx:(.text+0x366): undefined reference to `PySys_GetObject'
> vtkPythonAppInit.cxx:(.text+0x3a3): undefined reference to `PyString_FromString'
> vtkPythonAppInit.cxx:(.text+0x3c0): undefined reference to `PyList_Insert'
> CMakeFiles/vtkpython.dir/vtkPythonAppInit.o: In function `main':
> vtkPythonAppInit.cxx:(.text+0x814): undefined reference to `Py_SetProgramName'
> vtkPythonAppInit.cxx:(.text+0x819): undefined reference to `Py_Initialize'
> vtkPythonAppInit.cxx:(.text+0x849): undefined reference to `PySys_GetObject'
> vtkPythonAppInit.cxx:(.text+0x857): undefined reference to `PyString_AsString'
> vtkPythonAppInit.cxx:(.text+0x933): undefined reference to `Py_Main'
> collect2: ld returned 1 exit status
> make[2]: *** [bin/vtkpython] Error 1
> make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2
> make: *** [all] Error 2
>
> ****************************************************************************************
>
> I am not sure where I should point my PYTHON_LIBRARY to. I was
> pointing to /CMake/libcmVTK_WRAP_PYTHON2.so Is that the right place?
>
> Maybe you can tell me a filename that resides in PYTHON_LIBRARY so
> that I can run a 'locate filename.so' and find my correct path.
>
>
For the VTK build on my linux box, PYTHON_LIBRARY is set to
/usr/lib64/python2.3/config/libpython2.3.a. Since you're using Python
2.4, I'd expect the library name to be something like libpython2.4.a.
(The library you were pointing to is a CMake library for wrapping C/C++
code into Python, so it is not the correct value for PYTHON_LIBRARY.)
- Amy
--
Amy Squillacote Phone: (256) 726-4839
Computer Scientist Fax: (256) 726-4806
CFD Research Corporation Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL 35805
More information about the vtkusers
mailing list