[vtkusers] VTK CVS: Build problems with Python

Hans Fangohr H.FANGOHR at soton.ac.uk
Tue Jan 28 09:15:20 EST 2003


Hi Gavin,

> I am building VTK from CVS (checked out morning of 28-Jan AEST) on
> Debian woody, with gcc 2.95.4 and Python 2.2.1, and CMake 1.4p4.
>
> I did a clean cvs checkout, ran 'cmake -i ../VTK' and straight away
> get this error:
>
> CMake Error: ADD_CUSTOM_COMMAND: Error :
> ADD_CUSTOM_COMMAND Wrong syntax: Empty COMMAND. from CMakeLists.txt file in
> directory /home/gavinb/projects/vtk/VTK/Wrapping/Python


I had the same problem - it turns out that you need cmake >= 1.6 to
compile the more recent VTK code.

this problem should be fixed, once you use cmake 1.6.

I then get another error message, something like "couldn't compile VTK
extensions" from ccmake, but it seems that this can be ignored (I
guess it is just a feature of cmake that VTK doesn't use or so).

Good luck,

Hans



>
>     (repeated 12 times)
>
> (It is most unfortunate that the error messages from CMake do not
> include the line number of the error.)
>
> I tracked down the problem to this entry in VTK/Wrapping/Python/CMakeLists.txt
> on line 83:
>
>   ADD_CUSTOM_COMMAND(SOURCE ${src}
>     COMMAND ${PYTHON_EXECUTABLE}
>     ARGS -c "\"import" "py_compile;py_compile.compile('${src}','${tgt}','${tgt}')\""
>     TARGET vtkpython_pyc
>     OUTPUTS ${tgt}
>     )
>
> The problem is that PYTHON_EXECUTABLE isn't being set, and in the top
> level CMakLists.txt, the FIND_PROGRAM for Python has some problems: it
> is only getting set if BUILD_TESTING and DART_ROOT are both set, and
> secondly, the PATHs are only provided for Windows (pulling them out of
> the registry by the looks).
>
> I think this could be fixed with something like this:
>
> IF(VTK_WRAP_PYTHON)
>   IF(WIN32)
>     FIND_PROGRAM(PYTHON_EXECUTABLE
>       NAMES python2.2 python2.1 python1.6 python1.5 python
>       PATHS
>        [HKEY_LOCAL_MACHINE...] # as in current version
>     )
>   END(WIN32)
>   IF(UNIX)
>     FIND_PROGRAM(PYTHON_EXECUTABLE
>       NAMES python2.2 python2.1 python1.6 python1.5 python
>       PATHS
>         /usr/bin
>         /usr/local/bin
>         /opt/bin
>     )
>   END(UNIX)
> END(VTK_WRAP_PYTHON)
>
> The workaround is to invoke cmake like this:
>
> % ccmake -i ../VTK -DPYTHON_EXECUTABLE:FILE=/usr/bin/python2.2
>
> Note that if you put a space after the -D, CMake doesn't handle it too
> gracefully, and gives a strange error that doesn't really reflect the
> actual problem.
>
>   :: Gavin
>
> --
> Gavin Baker                                Computer Vision Lab (CVMIL)
> http://www.cs.mu.oz.au/~gavinb                 University of Melbourne
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers
>

-------------------------------------------------
Dr Hans Fangohr

Computational Engineering & Design Research Group
School of Engineering Sciences
University of Southampton
Southampton, SO17 1BJ
United Kingdom

Location: Building 25, Room 1033
phone : +44 (0) 23 8059 8345
fax   : +44 (0) 23 8059 7082
email : fangohr at soton.ac.uk
-------------------------------------------------





More information about the vtkusers mailing list