Re: [eigen] CMake - I think I'm still doing it wrong

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2010/1/22 Aron Ahmadia <aja2111@xxxxxxxxxxxx>:
> Hi Everybody,
>
> In the process of writing this email, I tried 'make test', which fails
> because it doesn't try to build the tests first, then 'make check',
> which appears to be doing what I want.

Yes, have you read
http://eigen.tuxfamily.org/index.php?title=Tests

Normally, on makefiles-based platforms, cmake should print a nice
message explaining this:

Some things you can do now:
--------------+----------------------------------------------------------------
Command       |   Description
--------------+----------------------------------------------------------------
make install  | Install to /usr/local
              |   To change that: cmake . -DCMAKE_INSTALL_PREFIX=yourpath
make doc      | Generate the API documentation, requires Doxygen & LaTeX
make check    | Build and run the unit-tests. Read this page:
              |   http://eigen.tuxfamily.org/index.php?title=Tests
make blas     | Build BLAS library (not the same thing as Eigen)
--------------+----------------------------------------------------------------

If it didn't, this is something we must fix!
The current test for printing this message is:

string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_tolower)
if(cmake_generator_tolower MATCHES "makefile")

Could you check what ${CMAKE_GENERATOR} is on your platform? Just put
this in some CMakeLists.txt:

    message(${CMAKE_GENERATOR})

>  Feel free to browse in case
> you'd like to help me figure out any other things I'm doing wrong in
> using CMake.
>
> Thanks for your help so far, I think I still don't 'get' CMake and how
> to use it to do what I want, which is this:
>
> :: try to build some c++ code that uses Eigen configured for my
> environment as well as possible (custom compilers

For custom C++ compilers, first erase your builddir, and do:

CXX=/path/to/compiler cmake ....

>, command line
> options,

To pass additional compile flags for a target, see
set_target_properties. To do that globally, use the CMAKE_CXX_FLAGS
variable and/or the variables specific to build types, see our root
CMakeLists.

To just add preprocessor definitions, see add_definitions.

 etc...)
>
> So Eigen represents maybe the third CMake project I've actually worked
> on, and I'm still learning how to specify options using cmake and the
> process of setting variables, reconfiguring, etc...

Good luck :)

>
> Right now, I have the development branch of Eigen checked out into
> sub-directory hg/, and I'm trying to get CMake to generate a Makefile
> to build some examples.  Sorry for the play by play but I'm not sure
> what I'm doing wrong here.
>
> So I type ccmake hg/

Can I just point you to our wiki page:
http://eigen.tuxfamily.org/index.php?title=CMake

>
> I hit 't' to get into advanced mode.
>
> I set:
> CMAKE_CXX_COMPILER              /bgsys/drivers/ppcfloor/comm/bin/mpixlcxx_r
> CMAKE_C_COMPILER                 /bgsys/drivers/ppcfloor/comm/bin/mpixlc_r
>
> (These are the IBM-installed wrappers that summon the BlueGene C/C++
> compilers with threaded support)
>
> I hit 'c' to configure the files.
>
> I can't write to the default install prefix but I assume that it is
> not important.

Indeed, you only need write access to the install prefix when you do
"make install" which for that reason you usually do as root.

>  I hit 'g' to generate the files and quit.
>
> If I type 'make' nothing happens.

That's normal. Eigen is a pure template library, there's nothing in it
to build. See above link for tests.

>
> In the process of writing this email, I tried 'make test', which fails
> because it doesn't try to build the tests first, then 'make check',
> which appears to be doing what I want.

Yep :)

>
> Is any of this documented anywhere besides general info on cmake from
> the CMake website?

Yes see link at the beginning of my reply :)

Good luck
Benoit



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/