Skip to content

PKG_CONFIG_PATH not propagated to dependency scripts

KTH Sweden reported that on their Cray system, Mercury's CMake failed:

========= Error =======

-- The C compiler identification is unknown
-- Check for working C compiler: /opt/cray/pe/craype/2.7.20/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.7.20/bin/cc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/cray/pe/craype/2.7.20/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /cfs/klemming/projects/supr/kthmech/adperez/software/gekkofs_deps/git/mercury/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_dfcbc/fast && /usr/bin/gmake -f CMakeFiles/cmTC_dfcbc.dir/build.make CMakeFiles/cmTC_dfcbc.dir/build
    gmake[1]: Entering directory '/cfs/klemming/projects/supr/kthmech/adperez/software/gekkofs_deps/git/mercury/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_dfcbc.dir/testCCompiler.c.o
    /opt/cray/pe/craype/2.7.20/bin/cc    -o CMakeFiles/cmTC_dfcbc.dir/testCCompiler.c.o   -c /cfs/klemming/projects/supr/kthmech/adperez/software/gekkofs_deps/git/mercury/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Error invoking pkg-config!
    Package dsmml was not found in the pkg-config search path.
    Perhaps you should add the directory containing `dsmml.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'dsmml' found
    Package dsmml was not found in the pkg-config search path.
    Perhaps you should add the directory containing `dsmml.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'dsmml' found
    gmake[1]: *** [CMakeFiles/cmTC_dfcbc.dir/build.make:83: CMakeFiles/cmTC_dfcbc.dir/testCCompiler.c.o] Error 1
    gmake[1]: Leaving directory '/cfs/klemming/projects/supr/kthmech/adperez/software/gekkofs_deps/git/mercury/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:138: cmTC_dfcbc/fast] Error 2

Although the PKG_CONFIG_PATH was set to dsmml.pc it was not propagated to the compile_dep.sh script. Therefore, the mercury.install file should also consider a set PKG_CONFIG_PATH.