Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8293

CMake does not find Castor libraries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.08/00, 5.34/38, 6.06/08
    • Component/s: Build System
    • Labels:
      None
    • Environment:

      Arch Linux x86_64
      GCC 6.1.1
      Castor 2.1.16.4
      CMake 3.6.0

      Description

      I have set the "CASTOR_DIR" environment variable to the location of my castor library installation:

      $ echo $CASTOR_DIR
      /opt/castor/2.1.16.4
       
      $ ls -l $CASTOR_DIR
      drwxr-xr-x 2 root root 4096 May 28 23:50 bin
      drwxr-xr-x 3 root root 4096 May 28 23:50 include
      drwxr-xr-x 2 root root 4096 May 28 23:50 lib
      drwxr-xr-x 3 root root 4096 May 28 23:50 share

      ROOT's FindCastor.cmake looks in $CASTOR_DIR for the libraries:

      set(locations ${CASTOR_DIR} $ENV{CASTOR_DIR}
                    /cern/pro /cern/new /cern/old
                    /opt/shift /usr/local/shift
                    /usr/lib/shift /usr/local/lib/shift
      )
       
      find_library(CASTOR_shift_LIBRARY NAMES shift shiftmd HINTS ${locations})
      find_library(CASTOR_rfio_LIBRARY NAMES castorrfio HINTS ${locations})
      find_library(CASTOR_common_LIBRARY NAMES castorcommon HINTS ${locations})
      find_library(CASTOR_client_LIBRARY NAMES castorclient castorClient HINTS ${locations})
      find_library(CASTOR_ns_LIBRARY NAMES castorns HINTS ${locations})

      Now this worked fine until a little while ago, possible until Arch Linux CMake was updated to 3.6.0. Now it's no longer working and I need to replace like this:

      diff --git a/cmake/modules/FindCastor.cmake b/cmake/modules/FindCastor.cmake
      index 025c769..cd89464 100644
      --- a/cmake/modules/FindCastor.cmake
      +++ b/cmake/modules/FindCastor.cmake
      @@ -31,7 +31,7 @@ if(CASTOR_INCLUDE_DIR)
         string(REGEX REPLACE "BASEVERSION[ ]*[\"][ ]*([^ \"]+)" "\\1" CASTOR_VERSION ${cont})
       endif()
       
      -set(locations ${CASTOR_DIR} $ENV{CASTOR_DIR}
      +set(locations ${CASTOR_DIR}/lib $ENV{CASTOR_DIR}/lib
                     /cern/pro /cern/new /cern/old
                     /opt/shift /usr/local/shift
                     /usr/lib/shift /usr/local/lib/shift

      To make find_library find the libraries. I still don't exactly know why this broke, I suspect the CMake update. BTW, CMake documentation says that "hardcoded guesses" should go in PATHS, not in HINTS?

        Attachments

          Activity

            People

            Assignee:
            mato Pere Mato Vila
            Reporter:
            bbeische Bastian Beischer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: