Werner Smekal writes:
 > I think there is a misunderstanding. CMAKE_INSTALL_PREFIX is the prefix
 > used to install the program you're configuring, this doesn't set the
 > path, where cmake looks for libraries:
 > 
 > pico:examples smekal$ cmake --help-variable CMAKE_INSTALL_PREFIX
 > cmake version 2.8.1
 >   CMAKE_INSTALL_PREFIX
 >        Install directory used by install.
 > 
 >        If "make install" is invoked or INSTALL is built, this directory is
 >        pre-pended onto all install directories.  This variable defaults to
 >        /usr/local on UNIX and c:/Program Files on Windows.
 > 
 > 
 > What you are looking for is CMAKE_PREFIX_PATH:
 > 
 > 
 > pico:examples smekal$ cmake --help-variable CMAKE_PREFIX_PATH
 > cmake version 2.8.1
 >   CMAKE_PREFIX_PATH
 >        Path used for searching by FIND_XXX(), with appropriate suffixes
 >        added.
 > 
 >        Specifies a path which will be used by the FIND_XXX() commands.  It
 >        contains the "base" directories, the FIND_XXX() commands append
 >        appropriate subdirectories to the base directories.  So
 > FIND_PROGRAM()
 >        adds /bin to each of the directories in the path, FIND_LIBRARY()
 >        appends /lib to each of the directories, and FIND_PATH() and
 >        FIND_FILE() append /include .  By default it is empty, it is intended
 >        to be set by the project.  See also CMAKE_SYSTEM_PREFIX_PATH,
 >        CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.
 > 
 > 
 > This option is what you described below, what you would like cmake can
 > do. I can do that already. Please try it.

While I was hopeful when I read this, that there would be a way to do what I
need using cmake, it turns out that in actual fact the above documented
options do not work as advertised.

I have attached a script called "proof", which  may be used to see
exactly what I am talking about.  I really do not have the bandwidth to
answer a lot of questions about what is or isn't on my system, in my
directories, etc.  Instead, please just run this script, and it will become
abundantly clear that cmake does not work as described in the above system
help messages.

I suggest making a directory ~/proof, and putting this script in there.  Then
do: 

cd ~/proof
./proof fetch
./proof prep
./proof check

Thes commands will fetch you a pristine python, and build it, installing it
into your ~/proof/prefix.  This will include the numpy which is needed by
plplot, and will prove that the so-built python does include working numpy.
If you try to execute the ~/proof/check.py script using a non-numpy-equipped
python, such as the one on my system, you'll get a different result, such as:

---------------------
ziffy:~/proof pwd
/home/furnish/proof
ziffy:~/proof which python
/usr/bin/python
ziffy:~/proof python check.py 
Traceback (most recent call last):
  File "check.py", line 1, in <module>
    import numpy
ImportError: No module named numpy
---------------------


Then do:

./proof config
./proof altcfg

Both of which will demonstrate very conclusively that cmake does NOT allow
you to override the system components, unless one were to go to the trouble
of rewriting some of the cmake modules, which, I suppose, it is now time for
me to start doing if I am to have any hope of achieving the objective of
building a plplot against a custom, non-system-default python.

Note that this is a python 2.7 beta strain.  2.7 isn't in the list of
programs in cmake's Module/FindPythonInterp.cmake.  However, "python" is in
the list (at the end), and should be found.  And if the system path was
really being overriden, then there is no way it should be coming back with
/usr/bin/python2.6 when the system path has been set to /bogus, and there is
no /bogus/usr/bin/anything on my system (and probably not on yours either
:-).

 > ziffy:~ ls /bogus
 > ls: cannot access /bogus: No such file or directory


On my system, both config and altcfg report, during the cmake configuration:

------------------------------------------------
-- Found PythonInterp: /usr/bin/python2.6
-- Found PythonLibs: /usr/lib64/python2.6/config/libpython2.6.so
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named numpy
-- WARNING: Numeric header not found. Disabling python bindings
------------------------------------------------

followed ultimately by:

ENABLE_python:          OFF             ENABLE_octave:          OFF

If you're default system pytyhon has the numpy installed, you might get a
"success" on the final line.  But unless you find a way to get cmake to find
~/proof/prefix/bin/python, I won't consider it working, since I do need a
custom python to be used for my PLplot build.  If you remove your system
default numpy install, it will all surely start failing for you, just as for
me, despite the presence of a demonstrably numpy-equipped python in your
local build zone (~/proof/prefix/bin/python in this case).

Finally, this broken cmake behavior exhibits under both cmake 2.6.4 and
2.8.1. 

-Geoff

Attachment: proof
Description: Script to use for configuring plplot against a custom python

------------------------------------------------------------------------------

_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to