make install does not work with newer CMake

Issue #54 new
Felix Bartusch created an issue

Hello,

Today I experienced a problem when I tried to install Relion 3.0 beta with a newer CMake version on our cluster.

In September 18 compiled Relion 3.0 beta with CMake 3.6.1 and everything worked as expected. Today I tried to make a new install to catch up with bugfixes. In the meantime our default CMake version on the cluster to 3.11.4.

Now the make install step did not work any more.

-- BUILD TYPE set to the default type:  'Release'
-- Using provided CUDA_ARCH=37
-- CUDA enabled - Building CUDA-accelerated version of RELION
-- Setting cpu precision to double
-- Setting accelerated code precision to single
-- Using cuda wrapper to compile....
-- Cuda version is >= 7.5 and single-precision build, enable double usage warning.
-- Omitting GUI targets as per your request
-- CMAKE_C_COMPILER : /opt/bwhpc/common/compiler/gnu/5.2.0/bin/gcc
-- CMAKE_CXX_COMPILER : /opt/bwhpc/common/compiler/gnu/5.2.0/bin/g++
-- MPI_C_COMPILER : /opt/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/bin/mpicc
-- MPI_CXX_COMPILER : /opt/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/bin/mpicxx
-- CMAKE_CXX_COMPILER_ID : GNU
-- Found MPI_C: /opt/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/bin/mpicc (found version "3.1") 
-- Found MPI_CXX: /opt/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/bin/mpicxx (found version "3.1") 
CMake Error at CMakeLists.txt:244 (include_directories):
  include_directories given empty-string as include directory.


-- MPI_INCLUDE_PATH : 
-- MPI_LIBRARIES : /nfsmounts/binac/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/lib/libmpi.so
-- MPI_CXX_INCLUDE_PATH : 
[...]
-- Configuring incomplete, errors occurred!

According to the CMake documentation, MPI_INCLUDE_PATH seems to be deprecated.

I switched back to the older CMake, then 'make install' succeeded. I think this information could be interesting for you and other users.

Comments (9)

  1. Takanori Nakane

    Thank you very much for your report.

    I tried with the latest cmake (3.13.2) and got a similar but non-identical error with MPI. In my case, the first make worked fine, but not only make install but also running make again failed.

  2. CharlesCongdon Account Deactivated

    FYI - from issue #44 it appears that 3.9 seems to be the most recent version that can be used successfully.

  3. Dari Kimanius

    Takanori, it appears that your issue is unrelated. I've made a pull request on a fix for it.

    Felix i can't reproduce your issue, which suggests it's related to your environment (presumably the FindMPI module). Could you try replacing the deprecated variable MPI_INCLUDE_PATH with MPI_CXX_INCLUDE_DIRS in the file root/CMakeLists.txt and see it that helps. This is also included in the pull request.

  4. Takanori Nakane

    Hi Dari, unfortunately your change to MPI_CXX_INCLUDE_DIRS fails to build on cmake 2.8.12.2, while it works fine on 3.13.2.

    CMake Error at CMakeLists.txt:206 (include_directories):
      include_directories given empty-string as include directory.
    ...
    -- Configuring incomplete, errors occurred!
    See also "/lmb/home/tnakane/prog/relion-devel-tcblab/build/CMakeFiles/CMakeOutput.log".
    See also "/lmb/home/tnakane/prog/relion-devel-tcblab/build/CMakeFiles/CMakeError.log".
    

    The following seems to fix the issue. Do you know a cleaner way of doing this?

    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 96708ff..b2b40ec 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -203,7 +203,12 @@ endif(ALTCPU)
     # -------------------------------------------------------------------------------MPI--
     find_package(MPI REQUIRED)
    
    -include_directories("${MPI_CXX_INCLUDE_DIRS}")
    +if ("${MPI_CXX_INCLUDE_DIRS}" STREQUAL "")
    +       include_directories("${MPI_CXX_INCLUDE_PATH}")
    +else()
    +       include_directories("${MPI_CXX_INCLUDE_DIRS}")
    +endif()
    +
     message(STATUS "MPI_INCLUDE_PATH : ${MPI_INCLUDE_PATH}")
     message(STATUS "MPI_LIBRARIES : ${MPI_LIBRARIES}")
     message(STATUS "MPI_CXX_INCLUDE_PATH : ${MPI_CXX_INCLUDE_PATH}")
    
  5. Dari Kimanius

    The most elegant solution would be to use cmake's backward compatibility. Unfortunately it seems like this is not working on some systems. The solution you propose is probably the way to go, if we want to stay up to date and backward compatible. All that aside, I'm not sure if this will even fix the reported issue, since I can't reproduce it.

  6. Felix Bartusch reporter

    Hi Dari, cannot find the pull request you mentioned. I can only see two old pull requests in this repo. I added the changes Takanori mentioned, but the error is the same:

    -- MPI_CXX_COMPILER : /opt/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/bin/mpicxx
    -- CMAKE_CXX_COMPILER_ID : GNU
    CMake Error at CMakeLists.txt:245 (include_directories):
      include_directories given empty-string as include directory.
    
    
    -- MPI_INCLUDE_PATH :
    -- MPI_LIBRARIES : /nfsmounts/binac/bwhpc/common/mpi/openmpi/2.1.5-gnu-5.2/lib/libmpi.so
    

    This is the MPI_CXX_INCLUDE_PATH variable.

    I don't know if just our cluster environment causes this error. I reproduced the problem today with our two CMake versions. Unfortunately I have not the time to dig deeper in the FindMPI module of CMake.

  7. Takanori Nakane

    Hi Felix, Dari's pull request is in our private repository. I will merge it and let you know.

  8. Log in to comment