From: Alan W. I. <ir...@be...> - 2013-10-17 22:31:31
|
On 2013-10-17 19:51-0000 Arjen Markus wrote: > Hi Alan, > > I am trying to get the Python bindings and examples ready under Windows so that I > can compare the output with the C examples. However, I am getting a set of weird error messages. > (I am not quite sure I have all the build tools right - I had some problems the past week with the stuff > installed on my laptop) > > Anyway here are the messages: > > > Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 > Copyright (C) Microsoft Corporation. All rights reserved. > > [ 0%] Built target csirocsa > [ 1%] Built target deltaT-gen > [ 1%] Built target tai-utc-gen > [ 1%] Built target tai-utc.h_built > [ 1%] Built target deltaT.h_built > [ 1%] Built target qsastime > [ 1%] Built target plhershey-unicode-gen > [ 2%] Built target plhershey-unicode.h_built > [ 12%] Built target plplotd > [ 13%] Built target plplotcxxd > [ 13%] Building C object bindings/python/CMakeFiles/_plplotcmodule.dir/plplotcmodulePYTHON_wrap.c.obj > plplotcmodulePYTHON_wrap.c > D:\plplot-svn\build-windows-python\bindings\python\plplotcmodulePYTHON_wrap.c(3578) : error C2036: 'void *' : unknown size [...] > The PyArray_FLOAT symbol is part of Numpy pre-1.7 and it appears in plplotcmodule.i but I do not know how to repair this. > I also do not know what the "void *" messages are all about. > Hi Arjen: I believe you ran into Python trouble before when you were testing te_gen for me with MinGW/MSYS. I cannot recall whether that was resolved or not. Anyhow, I may be repeating what was discussed then, but please bear with me as I go through absolutely everything you should need. >From the above results, I suspect you are pointing to an incorrect Python header version so macros are not being defined properly ==> all kinds of compiler errors. Have you installed numpy to the correct location? I just now created a successful Python-2.7.3 + numeric installation on Wine. Here is what I did from my notes. Where appropriate drop the wine command prefix to do the equivalent Microsoft windows command. # Install python-2.7.3 wine msiexec /i python-2.7.3.msi In the GUI I chose the installation directory to be z:\home\wine\newstart\python\python-2.7.3 Everything else was default. # Install numpy that is consistent with python-2.7.3 wine numpy-1.5.1-win32-superpack-python2.7.exe The GUI found the above python-2.7.3 installation so I could choose everything to be default for the installation. Here is a quick check that all is well with that numpy installation: Get into the python-2.7.3 command-line by simply executing the python.exe command. Then from that python prompt, execute import numpy print numpy.get_include() The results here under Wine are Z:\home\wine\newstart\python\python-2.7.3\lib\site-packages\numpy\core\include (This is the method used by our CMake build system to discover the location of the numpy include files, see below for my results for that.) Here is how I set up Python before I do anything else on the bash.exe command line with MinGW/MSYS. You can just put these commands in a file which you run from bash.exe by source <filename> (which is what I do) or you can enter these values by hand from the bash,exe command line. # Directory where python.exe can be found. Tailor this to the right # location on your system (see above how that install prefix is determined when you install python). PYTHON_PATH=/z/home/wine/newstart/python/python-2.7.3 # Once the above line is tailored correctly, the rest follows automatically # Put Python on the PATH PATH=$PYTHON_PATH:$PATH # Help CMake find Python headers and library. # This form of the commands assumes that # both CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH already exist # as environment variables. CMAKE_INCLUDE_PATH=$PYTHON_PATH/include:$CMAKE_INCLUDE_PATH CMAKE_LIBRARY_PATH=$PYTHON_PATH/libs:$CMAKE_LIBRARY_PATH That's all that should be normally required to find and use Python from CMake. Assuming you have set up PATH, CMAKE_INCLUDE_PATH, and CMAKE_LIBRARY_PATH correctly for your Python installation, then the CMake output for the PLplot configuration should tell you everything you need to know about your Python setup. Here are the relevant cmake output lines from my recent successful builds with Python on MinGW/MSYS/Wine. -- Found PythonInterp: z:/home/wine/newstart/python/python-2.7.3/python.exe (found version "2.7.3") -- Found PythonLibs: z:/home/wine/newstart/python/python-2.7.3/libs/libpython27.a (found version "2.7.3") -- PYTHON_VERSION = 2.7.3 -- Building Python binding with plsmem() support PYTHON_EXECUTABLE: z:/home/wine/newstart/python/python-2.7.3/python.exe PYTHON_INCLUDE_PATH: z:/home/wine/newstart/python/python-2.7.3/include PYTHON_LIBRARIES: z:/home/wine/newstart/python/python-2.7.3/libs/libpython27.a NUMERIC_INCLUDE_PATH: Z:/home/wine/newstart/python/python-2.7.3/Lib/site-packages/numpy/core/include/numpy Do you get expected results for all of these locations once (a) python and numpy have been installed correctly as tested above with the "print numpy.get_include()" command, and (b) you have let CMake know about the appropriate Python locations using the environment variables PATH, CMAKE_INCLUDE_PATH, and CMAKE_LIBRARY_PATH? Let me know if there is anything I need to explain further in the above notes, and I hope that by following these notes you will achieve a permanent end to the Python troubles that you have been having. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |