Consider providing CMake files

Issue #51 resolved
Louis Dionne created an issue

After stumbling upon your Meeting C++ 2014 presentation on ETs, I found myself wanting to check out this seemingly awesome library called Blaze. Unfortunately, after cloning the repo, I find myself unable to build anything and needing to setup this strange ConfigFile thing. Even stranger is that even though the script is called configure, it does not seem to work like usual autoconf scripts. Needless to say, I end up frustrated and willing to give up my investigation because it takes too much energy to setup for a test ride.

I know CMake is not universal, but it is kinda the standard for open source C++ projects and I would thus suggest that you provide a way to use your project with it. In my case at least, it would have made things much easier.

Comments (12)

  1. Klaus Iglberger

    Hi Louis!

    Thanks a lot for pointing out this issue. Since we don't get this kind of feedback often, your impressions on the usability of Blaze are highly valuable for us.

    Currently there is no CMakeLists file available since there is nothing to build. Since Blaze is a header-only library all you need to do to get started is to include the Blaze header file:

    #include <blaze/Blaze.h>
    

    The one additional configuration step that we recommend is to specify which BLAS library to use. This is only really necessary in case you want to multiply two large dense matrices. For this purpose, please edit the following header file:

    <blaze/config/BLAS.h>
    

    We sincerely apologize for the inconvenience. It is our mistake to not provide a better documentation of the initial steps. As a first measure we will use this ticket to improve the situation by removing the Configfile and configure script since they are obviously misleading (and quite frankly obsolete). As a second measure we will think about adding CMake files for a more convenient configuration. This sounds like a good suggestion.

    We hope you are not too frustrated and give Blaze a second try. Anyway, thanks a lot for your input!

    Best regards,

    Klaus!

  2. Louis Dionne reporter

    Thanks for the reply. The idea with providing a CMakeLists.txt file is largely to allow building and running the tests seamlessly in the case of a header-only library. The CMakeLists.txt file can also find any BLAS library on the system without requiring the user to explicitly specify it (FindBlas.cmake is a standard module).

  3. sarthakpati

    Hi Klaus,

    We met during CppCon 16 and had a nice chat (again, awesome talk). I think this issue is important since configuring blaze for specific machines is tough. There needs to be a way to package the code we develop using blaze in an easy manner. Have a traditional CMake configuration step would remove a lot of the redundant manual steps involved (armadillo is a nice reference for this - they do essentially the same thing).

    Cheers, Sarthak

  4. Mario Emmenlauer

    Hi, please see my pull request for an early version of CMake support. It does detect the required dependent libraries, and it can install Blaze headers. Currently it does nothing else, i.e. it does not use the detected libraries to configure Blaze. I would be curious if you are interested in using this concept? Then I could add CMake-generated headers that configure Blaze for the available thirdparty dependencies?

  5. sarthakpati

    Hi Mario,

    Thanks a ton for doing this, BTW. It would be great if that configuration can also be handled (addition of a "configure" command with "@ONLY" should do the trick)!

    Best, Sarthak

  6. Klaus Iglberger

    Hi Mario!

    Thanks a lot for your efforts, it is highly appreciated. Please give us some time to review your pull request before merging it. We might have some requests for improvements. Again, thanks a lot!

    Best regards,

    Klaus!

  7. Mario Emmenlauer

    Hey Klaus, sure! I've looked a bit at the build instructions and think it should be fairly easy to add the utils build and create a static / shared library config. I've also just pushed a commit that enables doxygen doc build (out of source) so its possible now to use: "cd /some/tmp/path && cmake /path/to/source && make doc && make install"

    I still have not looked at your config headers, do you think they can be auto-configured? cmake typically generates defines like HAVE_BOOST and similar...

  8. Klaus Iglberger

    Hi Mario!

    As stated in a previous post the Blaze library is obsolete and will be removed till the next release. CMake therefore should only take care of detecting the BLAS library. In the best case CMake should adjust the according configuration file to preserve the option to manually configure Blaze.

    Best regards,

    Klaus!

  9. Mario Emmenlauer

    Hi Klaus, yes this sounds reasonable. Currently CMake already detects boost, BLAS and LAPACK. So I'll take a look how these CMake config settings can be used to adjust your existing configuration files in a way that they can still be configured manually. Cheers!

  10. Klaus Iglberger

    The feature to configure and install Blaze via CMake has been implemented and documented as required (see the pull requests #5 and #9). It is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.2.

  11. Log in to comment