[Numpy-discussion] preferred numpy build system

Ondrej Certik ondrej at certik.cz
Mon Feb 9 17:06:30 EST 2009


On Sun, Feb 8, 2009 at 7:56 PM, David Cournapeau
<david at ar.media.kyoto-u.ac.jp> wrote:
> Ondrej Certik wrote:
>>> That's exactly what I don't like about cmake  - it means you can't
>>> produce accurate builds (you need to rerun cmake everytime you change
>>> the configuration or dependencies, whereas this is automatic with
>>> scons/waf). It also have (used to have) very poor documentation unless
>>> you buy the book - but it looks like this is changing.
>>>
>>
>> You can always rerun cmake if you want (and make it automatic). Imho
>> that's not a problem. But maybe it is done in a better way with scons.
>>
>
> I think it is a problem - it means you have to update it explicitly when
> the configuration changes. In scons, the signature concept is quite
> powerful: not only are file dependencies handled, but also command
> lines, etc... For example, in numscons, if you change the blas/lapack
> from atlas to say MKL, only linking and eventually configuration changes
> are rebuilt. If you change the fortran compiler but not the C compiler,
> only fortran code is rebuilt. All of this is 100 % automatic.


I got an email from Alexander Neundorf from kde, and with his
permission, I am forwarding it here, because he is not subscribed. As
he writes below, cmake is in fact cabable of the above.




---------- Forwarded message ----------
From: Alexander Neundorf
Date: Mon, Feb 9, 2009 at 1:28 PM
Subject: cmake information
To: Ondrej Certik


Hi Ondrej,

I hope you are the Ondrej from this thread:
http://groups.google.com/group/Numpy-discussion/browse_thread/thread/c12f96b9ac367f57

If not, please let me know and I'll try to find the right email address.
I saw this in the thread:

----------8<-------------8<----------------8<----------------

Ondrej Certik wrote:
 >> That's exactly what I don't like about cmake  - it means you can't
 >> produce accurate builds (you need to rerun cmake everytime you change
 >> the configuration or dependencies, whereas this is automatic with
 >> scons/waf). It also have (used to have) very poor documentation unless
 >> you buy the book - but it looks like this is changing.

> You can always rerun cmake if you want (and make it automatic). Imho
 > that's not a problem. But maybe it is done in a better way with scons.

I think it is a problem - it means you have to update it explicitly when
 the configuration changes. In scons, the signature concept is quite
 powerful: not only are file dependencies handled, but also command
 lines, etc... For example, in numscons, if you change the blas/lapack
 from atlas to say MKL, only linking and eventually configuration changes
 are rebuilt. If you change the fortran compiler but not the C compiler,
 only fortran code is rebuilt. All of this is 100 % automatic.

----------8<-------------8<----------------8<----------------

CMake does handle this automatically.
E.g. if include directories are changed (which you do by editing a
CMakeLists.txt or the cmake cache), all files which are affected by the are
rebuilt. If some library changes, everything linking to this library is
linked again.
If any of the files the build depends on (e.g. a CMakeLists.txt, or an
included .cmake file, or the cmake cache) is changed, cmake is automatically
rerun, and the makefiles/project files are regenerated.

I don't know what happens if you are using both C and Fortran in one project
and change one of them. I think this is actually not possible, you can (or
should) not change the compiler of an existing build tree. Basically
everything which uses this compiler is invalid then, the object files, the
results of tests etc. I'm not sure handling this separately for different
languages within one project is supported by cmake.

Alex



More information about the NumPy-Discussion mailing list