CMake build MPI issues

Issue #15 new
Alexander Julian Reinking created an issue

CombBLAS wouldn’t build without setting CMAKE_CXX_COMPILER to the OpenMPI mpic++ wrapper on my system. This is because there’s a missing dependency on MPI in usort.

I can’t seem to open a pull request, but you can see my changes here: https://bitbucket.org/areinking/combinatorial-blas-2.0/src/cmake-mpi/

There are a few other issues with the package I changed here, namely:

  1. Setting CMAKE_CXX_FLAGS in a lists file breaks a third party’s ability to inject necessary flags (clang sanitizers, for instance). -O3 is set automatically in Release/RelWithDebInfo, anyway.
  2. Setting the language level via a compiler flag directly is unnecessary. Even in CMake 3.3, compile features can be used to enforce C++14. In particular, setting cxx_return_type_deduction is enough to enforce this.
  3. The variable CombBLAS_VERSION is automatically set by the project command, so it was removed. Ideally, there is no code between cmake_minimum_required and project.
  4. The optional OpenMP support was overwrought. Check for the target first, then the success variable.

Also, I would strongly consider bumping the minimum CMake version to 3.9 (or higher!) if at all possible. 3.3 is downright ancient and the maintainers caution against using anything that old. I say 3.9 because it’s the first version to introduce imported targets in all of the find modules you’re using. CMake 3.14 would greatly simplify your packaging setup. So would using the GNUInstallDirs module.

Lastly – it isn’t clear what the purpose of GenerateExportHeader is in this project. The macros it defines aren’t used anywhere and the comments seem to confuse it with write_basic_package_version_file which is used correctly below.

Comments (1)

  1. Aydin Buluc

    Alex, I gave you read access to the repo so you can issue a pull request.

    Sorry my settings must be messed up because I haven’t seen this “issue” you posted until today (Giulia notified me)

    PS: I think I fixed the usort building issue already without reading your post, likely in a different way.

  2. Log in to comment