ParaView 5.9.0-RC1 superbuild package configuration issue affecting matplotlib's detection of freetype and zlib

The ParaView 5.9.0-RC1 superbuild does not seem to add the package config directory to it PKG_CONFIG_PATH unless you add it yourself

setenv PKG_CONFIG_PATH Build_dir/install}/lib/pkgconfig

without this the matplotlib section can not find the freetype2.pc file

also the superbuild zlib build fails to put its zlib.pc configuration file into the Build_dir/install}/lib/pkgconfig

so one must manually copy it

cp Build_dir/superbuild/zlib/build/zlib.pc to Build_dir/install/lib/pkgconfig

for matplotlib to dectect and use it.

Thanks,

Joe Hennessey

We do set it up (superbuild/cmake/SuperbuildMacros.cmake line 1192 and it is built up in superbuild/cmake/SuperbuildUtils.cmake line 129). Is there something going wrong with these? You can see the effects of it in the relevant superbuild/sb-*-configure.cmake scripts). zlib seems to put it into install/share/pkgconfig/zlib.pc instead (which is wrong, but is also a place that should be searched).

Ben,

I am not sure what is going wrong with the superbuild script but it seems to just affect matplotlib and nothing else it seems that there is a file in matplotlib

Build_dir/superbuild/matplotlib/src/setupext.py

which has a function get_pkg_config() lines 232-252 in the file

I suspect it must be causing the issue somehow.

a workaround could still be to set

setenv PKG_CONFIG_PATH Build_dir/install/lib/pkgconfig:Build_dir/install/share/pkgconfig

where Build_dir is your build directory. This would allow matplotlib to find freetype2 and zlib.pc then.

Thanks,

Joe

PKG_CONFIG_PATH should already get set as part of the superbuild though. Could you provide the information from the sb-matplotlib-build.cmake file? When I configure (without setting PKG_CONFIG_PATH manually), I see PKG_CONFIG_PATH;/home/boeckb/misc/builds/paraview/build-sb/install/lib/pkgconfig:/home/boeckb/misc/builds/paraview/build-sb/install/share/pkgconfig in it which should be doing what you’re trying to do manually. Is it there? If so, is it correct? If not, we need to figure out what is missing.

Ben,

Here is the information you requested.

# Handle the environment when running a primary step (configure, build,
# install) of a project.

set(environment "PKG_CONFIG;LDFLAGS;  ;CPPFLAGS;  ;CXXFLAGS;-fPIC  ;CFLAGS;-fPIC  ;PATH;/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/bin;LD_LIBRARY_PATH;/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib:/p/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib:/app/DAAC/build/Qt/5.12.10/lib:/app/DAAC/build/libpthread-stubs/0.3/lib:/app/DAAC/build/libtool/2.4.6/lib:/app/DAAC/build/glproto/1.4.17/lib:/p/app/hpe/mpt-2.17/lib:/p/app/gnu/6.3.0/lib64:/usr/lib64:/usr/lib;PKG_CONFIG_PATH;/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/pkgconfig:/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/share/pkgconfig:/app/DAAC/build/Qt/5.12.10/lib/pkgconfig;PYTHONPATH;/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/python3.8/site-packages")
set(list_separator "-+-")
set(command "/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/bin/python3;setup.py;build")

set(env_separator ":")
# These environment variables are prepended to using `env_separator`.
set(prepend_envvars
PATH CMAKE_PREFIX_PATH PKG_CONFIG_PATH)
if (WIN32)
  set(env_separator ";")
elseif (APPLE)
  list(APPEND prepend_envvars
  DYLD_LIBRARY_PATH)
elseif (UNIX)
  list(APPEND prepend_envvars
  LD_LIBRARY_PATH)
endif ()

set(key)
foreach (arg IN LISTS environment)
  if (NOT key)
    set(key "${arg}")
  else ()
    list(FIND prepend_envvars "${key}" index)
    if (index EQUAL "-1")
      set(value "${arg}")
    else ()
      set(value "${arg}${env_separator}$ENV{${key}}")
    endif ()
    string(REPLACE "${list_separator}" ";" value "${value}")
    set("ENV{${key}}" "${value}")

    unset(key)
  endif ()
endforeach ()

string(REPLACE "${list_separator}" "\;" command "${command}")

execute_process(
COMMAND ${command}
RESULT_VARIABLE rv)

if (rv)
  message(FATAL_ERROR "Failed with exit code ${rv}")
endif ()

Thanks,

Joe

It looks like it has the right PKG_CONFIG_PATH setting. Maybe matplotlib needs some love for its pkg-config support? I’ll try and look into it tomorrow, though I suspect I’ll need some debugging info from your environment for details.

I added some debugging output (diff below) to setupext.py. I have no PKG_CONFIG_PATH set up in my environment outside of the superbuild. During the build, this output is available:

old PKG_CONFIG_PATH: /home/boeckb/misc/builds/paraview/build-sb/install/lib/pkgconfig:/home/boeckb/misc/builds/paraview/build-sb/install/share/pkgconfig:
new PKG_CONFIG_PATH: /home/boeckb/misc/builds/paraview/build-sb/install/lib/pkgconfig:/home/boeckb/misc/builds/paraview/build-sb/install/share/pkgconfig::/home/boeckb/misc/builds/paraview/build-sb/install/lib/pkgconfig
pkg_config: pkg-config
cmd for freetype2 : ['pkg-config', 'freetype2']
cflags: ['-I/home/boeckb/misc/builds/paraview/build-sb/install/include/freetype2', '-I/home/boeckb/misc/builds/paraview/build-sb/install/include', '-I/home/boeckb/misc/builds/paraview/build-sb/install/include/libpng16']
libs: ['-L/home/boeckb/misc/builds/paraview/build-sb/install/lib', '-lfreetype']
cmd for libpng : ['pkg-config', 'libpng']
cflags: ['-I/home/boeckb/misc/builds/paraview/build-sb/install/include/libpng16', '-I/home/boeckb/misc/builds/paraview/build-sb/install/include']
libs: ['-L/home/boeckb/misc/builds/paraview/build-sb/install/lib', '-lpng16', '-lz']
cmd for freetype2 : ['pkg-config', 'freetype2']
cflags: ['-I/home/boeckb/misc/builds/paraview/build-sb/install/include/freetype2', '-I/home/boeckb/misc/builds/paraview/build-sb/install/include', '-I/home/boeckb/misc/builds/paraview/build-sb/install/include/libpng16']
libs: ['-L/home/boeckb/misc/builds/paraview/build-sb/install/lib', '-lfreetype']

which all looks fine to me.

--- setupext.py 2020-11-19 08:37:21.987610337 -0500
+++ setupext.py 2020-11-19 08:37:01.977991294 -0500
@@ -241,16 +241,19 @@
             "IMPORTANT WARNING:\n"
             "    pkg-config is not installed.\n"
             "    Matplotlib may not be able to find some of its dependencies.")
         return None
     pkg_config_path = sysconfig.get_config_var('LIBDIR')
+    print('old PKG_CONFIG_PATH:', os.environ['PKG_CONFIG_PATH'])
     if pkg_config_path is not None:
         pkg_config_path = os.path.join(pkg_config_path, 'pkgconfig')
         try:
             os.environ['PKG_CONFIG_PATH'] += ':' + pkg_config_path
         except KeyError:
             os.environ['PKG_CONFIG_PATH'] = pkg_config_path
+    print('new PKG_CONFIG_PATH:', os.environ['PKG_CONFIG_PATH'])
+    print('pkg_config:', pkg_config)
     return pkg_config
 
 
 def pkg_config_setup_extension(
         ext, package,
@@ -259,10 +262,11 @@
 
     # First, try to get the flags from pkg-config.
 
     pkg_config = get_pkg_config()
     cmd = [pkg_config, package] if pkg_config else alt_exec
+    print('cmd for', package, ':', cmd)
     if cmd is not None:
         try:
             if pkg_config and atleast_version:
                 subprocess.check_call(
                     [*cmd, f"--atleast-version={atleast_version}"])
@@ -275,10 +279,12 @@
             libs = shlex.split(
                 os.fsdecode(subprocess.check_output([*cmd, "--libs"])))
         except (OSError, subprocess.CalledProcessError):
             pass
         else:
+            print('cflags:', cflags)
+            print('libs:', libs)
             ext.extra_compile_args.extend(cflags)
             ext.extra_link_args.extend(libs)
             return
 
     # If that fails, fall back on the defaults.

Ben,

Here is the output

Edit setup.cfg to change the build options; suppress output with --quiet.

BUILDING MATPLOTLIB
  matplotlib: yes [3.2.1]
      python: yes [3.8.6 (default, Nov 18 2020, 21:00:58)  [GCC 6.3.0]]
    platform: yes [linux]
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: no  [Mac OS-X only]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-3.8/matplotlib/mpl-data
UPDATING build/lib.linux-x86_64-3.8/matplotlib/_version.py
set build/lib.linux-x86_64-3.8/matplotlib/_version.py to '3.2.1'
running build_ext
IMPORTANT WARNING:
    pkg-config is not installed.
    Matplotlib may not be able to find some of its dependencies.
pkg_config: None
cflags: []
cflags: []
pkg_config: None
cflags: ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16']
cflags: ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16']
pkg_config: None
cflags: []
cflags: []
building 'matplotlib.ft2font' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -Iextern/agg24-svn/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/python3.8/site-packages/numpy/core/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/python3.8 -c src/checkdep_freetype2.c -o build/temp.linux-x86_64-3.8/src/checkdep_freetype2.o

Ben,

And here is the output if I set the PKG_CONFIG_PATH environment variable to

setenv PKG_CONFIG_PATH ${INSTALLPATH}/lib/pkgconfig:${INSTALLPATH}/share/pkgconfig

Edit setup.cfg to change the build options; suppress output with --quiet.

BUILDING MATPLOTLIB
  matplotlib: yes [3.2.1]
      python: yes [3.8.6 (default, Nov 18 2020, 21:00:58)  [GCC 6.3.0]]
    platform: yes [linux]
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: no  [Mac OS-X only]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-3.8/matplotlib/mpl-data
UPDATING build/lib.linux-x86_64-3.8/matplotlib/_version.py
set build/lib.linux-x86_64-3.8/matplotlib/_version.py to '3.2.1'
running build_ext
IMPORTANT WARNING:
    pkg-config is not installed.
    Matplotlib may not be able to find some of its dependencies.
pkg_config: None
cflags: ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
cflags: ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
pkg_config: None
cflags: ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16']
cflags: ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16']
pkg_config: None
cflags: ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
cflags: ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
building 'matplotlib.ft2font' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -Iextern/agg24-svn/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/python3.8/site-packages/numpy/core/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/python3.8 -c src/checkdep_freetype2.c -o build/temp.linux-x86_64-3.8/src/checkdep_freetype2.o -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2 -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16 -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include

… etc it builds fine from this point on

It appears as though the fallback works, but this output seems indicative of the core problem:

Ben,

pkg-config is installed on my system

pkg-config --version
0.29.1

Thanks,

Joe

Then matplotlib package isn’t finding it though. I don’t know why that might be. It is using shutil.which. Do you happen to have the PKG_CONFIG environment variable set?

Ben,

I do not have the environment variable PKG_CONFIG set. I tried setting it, but it did not help.
If I set the PKG_CONFIG_PATH environment variable to

setenv PKG_CONFIG_PATH ${INSTALLPATH}/lib/pkgconfig:${INSTALLPATH}/share/pkgconfig

Then it works fine but still complains about pkg-config not being installed, even though it is.

Thanks,

Joe

Ben,

I believe I have figured out why this is failing. The system has python 2.7.5 installed, while shutil.which was not added until python 3.3

[joeh@gaffney01 PV]$ which python
/usr/bin/python
[joeh@gaffney01 PV]$ python
Python 2.7.5 (default, Sep 26 2019, 13:23:47)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which('pkg-config')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'which'
>>>

So that command cannot work, I think what you mean to be doing is accessing the python 3.8 version that paraview superbuild builds, but it is instead using the system version of 2.7.5 for some reason here.

Thanks,

Joe

That’s not it. First, we’d get an exception like the AttributeError, not None. Second, you can see that we’re using the superbuild’s python binary to build matplotlib:

Something else is up here. Digging into why shutil.which is failing on your machine may be necessary. Adding strace;-e;file;-o;/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/strace.log; in front of that quoted command variable’s value can get a log of it. If we can see where it looks for pkg-config, that might help. Dumping out os.environ['PATH'] can’t hurt either. Once editing that, make sure that the superbuild does not rerun cmake (as it will clobber the edit) and run just ninja superbuild/matplotlib/stamp/matplotlib-build to do the minimum amount of work around it.

Ben,

I have dug further,

I added theses print statements

def get_pkg_config():
    """
    Get path to pkg-config and set up the PKG_CONFIG environment variable.
    """
    if sys.platform == 'win32':
        return None
    path_value = os.environ.get('PATH')
    print("path_value = ", path_value)
    pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
    print("pkg_config = ", pkg_config)
    pkg_config = 'pkg-config'
    print("pkg_config = ", pkg_config)
    pkg_config_loc = shutil.which(pkg_config)
    print("pkg_config_loc = ", pkg_config_loc)
    if shutil.which(pkg_config) is None:
        print(
            "IMPORTANT WARNING:\n"
            "    pkg-config is not installed.\n"
            "    Matplotlib may not be able to find some of its dependencies.")
        return None
    print("old PKG_CONFIG_PATH = ",  os.environ['PKG_CONFIG_PATH'] )
    pkg_config_path = sysconfig.get_config_var('LIBDIR')
    print("pkg_config_path = ", pkg_config_path)
    if pkg_config_path is not None:
        pkg_config_path = os.path.join(pkg_config_path, 'pkgconfig')
        try:
            os.environ['PKG_CONFIG_PATH'] += ':' + pkg_config_path
        except KeyError:
            os.environ['PKG_CONFIG_PATH'] = pkg_config_path
    print("new PKG_CONFIG_PATH = ",  os.environ['PKG_CONFIG_PATH'] )
    return pkg_config

and these as well

def pkg_config_setup_extension(
        ext, package,
        atleast_version=None, alt_exec=None, default_libraries=()):
    """Add parameters to the given *ext* for the given *package*."""

    # First, try to get the flags from pkg-config.

    pkg_config = get_pkg_config()
    print("pkg_config = ", pkg_config)
    print("atleast_version = ", atleast_version)
    print("package = ", package)
    cmd = [pkg_config, package] if pkg_config else alt_exec
    print("cmd = ", cmd)
    if cmd is not None:
        try:
            if pkg_config and atleast_version:
                subprocess.check_call(
                    [*cmd, f"--atleast-version={atleast_version}"])
            # Use sys.getfilesystemencoding() to allow round-tripping
            # when passed back to later subprocess calls; do not use
            # locale.getpreferredencoding() which universal_newlines=True
            # would do.
            cflags = shlex.split(
                os.fsdecode(subprocess.check_output([*cmd, "--cflags"])))
            libs = shlex.split(
                os.fsdecode(subprocess.check_output([*cmd, "--libs"])))
            print("cflags = ", cflags)
            print("libs = ", libs)
        except (OSError, subprocess.CalledProcessError):
            pass
        else:
            ext.extra_compile_args.extend(cflags)
            ext.extra_link_args.extend(libs)
            return

    # If that fails, fall back on the defaults.

    # conda Windows header and library paths.
    # https://github.com/conda/conda/issues/2312 re: getting the env dir.
    if sys.platform == 'win32':
        conda_env_path = (os.getenv('CONDA_PREFIX')  # conda >= 4.1
                          or os.getenv('CONDA_DEFAULT_ENV'))  # conda < 4.1
        if conda_env_path and os.path.isdir(conda_env_path):
            ext.include_dirs.append(os.fspath(
                pathlib.Path(conda_env_path, "Library/include")))
            ext.library_dirs.append(os.fspath(
                pathlib.Path(conda_env_path, "Library/lib")))

    # Default linked libs.
    ext.libraries.extend(default_libraries)

And got this result,

after doing 2 things

First I forced pkg_config = ‘pkg-config’ because I noticed that its value was being set to LDFLAGS
which was why that shutil.which(pkg_config) was failing in that it was incorrectly looking for LDFLAGS instead of pkg-config this must mean that for some reason
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
is incorrectly returning LDFLAGS once I made this change then shutil.which(pkg_config) succeeded in correctly returning the location for pkg-config.

Second I copied zlib.pc into /app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/pkgconfig
from /app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/share/pkgconfig
since I noticed that /app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/share/pkgconfig was not in the PKG_CONFIG_PATH but /app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/pkgconfig
and freetype will fail without it.

Edit setup.cfg to change the build options; suppress output with --quiet.

BUILDING MATPLOTLIB
  matplotlib: yes [3.2.1]
      python: yes [3.8.6 (default, Nov 18 2020, 21:00:58)  [GCC 6.3.0]]
    platform: yes [linux]
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: no  [Mac OS-X only]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-3.8/matplotlib/mpl-data
UPDATING build/lib.linux-x86_64-3.8/matplotlib/_version.py
set build/lib.linux-x86_64-3.8/matplotlib/_version.py to '3.2.1'
running build_ext
path_value =  /p/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/bin:/app/DAAC/build/Qt/5.12.10/bin:/app/DAAC/build/pkg-config/0.29/1/bin:/app/DAAC/build/m4/1.4.18/bin:/app/DAAC/build/libtool/2.4.6/bin:/app/DAAC/build/automake/1.15/bin:/app/DAAC/build/autoconf/2.69/bin:/app/DAAC/build/git/2.5.0/bin:/app/DAAC/build/cmake/3.17.4/bin:/p/app/hpe/mpt-2.17/bin:/p/app/gnu/6.3.0/bin:/usr/local/bin:/opt/sgi/sbin:/opt/sgi/bin:/app/DAAC/build/pkg-config/0.29.1/bin:/usr/local/bin:/opt/sgi/sbin:/opt/sgi/bin:/usr/lib64/qt-3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/openssh-7.5p1.RedHatEL/bin:/usr/local/bin:/usr/local/sbin:/opt/c3/bin:/opt/pbs_19.2.4/bin:/sbin:/bin:/p/app/BCT/bin:/p/app/SLB:/p/home/joeh/.local/bin:/p/home/joeh/bin:/opt/c3/bin:/opt/pbs_19.2.4/bin:/sbin:/bin:/p/app/BCT/bin:/p/app/SLB
pkg_config =  LDFLAGS
pkg_config =  pkg-config
pkg_config_loc =  /app/DAAC/build/pkg-config/0.29.1/bin/pkg-config
old PKG_CONFIG_PATH =  /app/DAAC/build/Qt/5.12.10/lib/pkgconfig:/app/DAAC/build/pkg-config/0.29/1/lib/pkgconfig
pkg_config_path =  /app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib
new PKG_CONFIG_PATH =  /app/DAAC/build/Qt/5.12.10/lib/pkgconfig:/app/DAAC/build/pkg-config/0.29/1/lib/pkgconfig:/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/pkgconfig
pkg_config =  pkg-config
atleast_version =  9.11.3
package =  freetype2
cmd =  ['pkg-config', 'freetype2']
cflags =  ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
libs =  ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lfreetype']
pkg_config =  pkg-config
atleast_version =  1.2
package =  libpng
cmd =  ['pkg-config', 'libpng']
cflags =  ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
libs =  ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lpng16', '-lz']
pkg_config =  pkg-config
atleast_version =  9.11.3
package =  freetype2
cmd =  ['pkg-config', 'freetype2']
cflags =  ['-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16', '-I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include']
libs =  ['-L/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib', '-lfreetype']
building 'matplotlib.ft2font' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -Iextern/agg24-svn/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/lib/python3.8/site-packages/numpy/core/include -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/python3.8 -c src/checkdep_freetype2.c -o build/temp.linux-x86_64-3.8/src/checkdep_freetype2.o -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/freetype2 -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include/libpng16 -I/app/DAAC/build/PV/Build_5.9.0-RC1_mesa_test/install/include

with these 2 changes compilation succeeded.

Ah ha! Your sb-matplotlib-build.cmake has this entry:

PKG_CONFIG;LDFLAGS

which is a parity problem. This is why it has a bogus value. Let me see if I can’t figure out where this is coming from…

So we have this code:

  if (pkgconf_enabled)
    list(APPEND matplotlib_process_environment
      PKG_CONFIG "${superbuild_pkgconf}")
  endif ()

For some reason, this ends up as an empty entry. There are two places this is set in the superbuild:

  • projects/apple-unix/pkgconf.cmake
  • projects/apple-unix/pkgconf.system.cmake

I’m not sure which is being used on your machine, but…I see now. There’s a mismatch in logic. I’ll have a fix up shortly.

Could you please apply this diff to your build to verify that it does what is necessary? https://gitlab.kitware.com/paraview/common-superbuild/-/merge_requests/376

Ben,

It worked!

Thanks for your help in tracking this down.

Joe