Failing to compile ParaView 5.8.0 with Spack on Cori


So far I have been compiling ParaView 5.8.0 on NERSC’s Cori supercomputer by cloning it and calling cmake manually. I have been trying to get the same build working with spack, but the build fails.

Here is how I build ParaView manually:

module load python3/3.8-anaconda-2020.11
module swap PrgEnv-intel PrgEnv-gnu
module swap gcc/8.3.0 gcc/9.3.0
module load cmake/3.18.2

git clone
cd paraview
git fetch --all --tags
git checkout v5.8.0
git submodule update --init --recursive

mkdir build
cd  build

             -DPARAVIEW_USE_MPI=ON \
             -DVTK_USE_X:BOOL=FALSE \
             -DCMAKE_CXX_COMPILER=CC \
             -DCMAKE_C_COMPILER=cc \
             -DCMAKE_BUILD_TYPE=Release \
make install

With spack I have the following environment file:
spack.yaml (5.3 KB)

which I use as follows

spack env create myenv spack.yaml
spack env activate myenv
spack install -j 1

(the -j 1 is there so the error doesn’t get buried in unrelated build logs)

The build process fails with the following errors:

/tmp/mdorier/spack-stage/spack-stage-paraview-5.8.0-zvsma5jbul5za63rkddaqezyutp37cuc/spack-src/VTK/Rendering/FreeType/vtkFreeTypeTools.cxx:382:1: error: expected constructor, destructor, or type conversion before 'vtkFreeTypeToolsFaceRequester'
  382 | vtkFreeTypeToolsFaceRequester(
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/mdorier/spack-stage/spack-stage-paraview-5.8.0-zvsma5jbul5za63rkddaqezyutp37cuc/spack-src/VTK/Rendering/FreeType/vtkFreeTypeTools.cxx: In member function 'virtual FT_Error vtkFreeTypeTools::CreateFTCManager()':
/tmp/mdorier/spack-stage/spack-stage-paraview-5.8.0-zvsma5jbul5za63rkddaqezyutp37cuc/spack-src/VTK/Rendering/FreeType/vtkFreeTypeTools.cxx:1154:61: error: 'vtkFreeTypeToolsFaceRequester' was not declared in this scope; did you mean 'vtkFreeTypeToolsCleanupCounter'?
 1154 |     this->MaximumNumberOfSizes, this->MaximumNumberOfBytes, vtkFreeTypeToolsFaceRequester,
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             vtkFreeTypeToolsCleanupCounter

Any idea why this happens?

Note that if I create a new spack package for ParaView, inheriting from the original one but hard-coding the cmake arguments I need, the build works fine:

from spack.pkg.builtin.paraview import Paraview

class Paraview(Paraview):

    def cmake_args(self):
        args = [ '-DPARAVIEW_USE_QT=OFF',
                 '-DCMAKE_CXX_COMPILER=' + self.spec['mpi'].mpicxx,
                 '-DCMAKE_C_COMPILER=' + self.spec['mpi'].mpicc,
                 '-DVTK_PYTHON_OPTIONAL_LINK=OFF' ]
        return args

I managed to extract the argument passed to cmake by spack in the failing case:

'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=<some-path> 

Now the question is: which of these flags is the offending one, and I do I turn it off?

I suspect PARAVIEW_BUILD_WITH_EXTERNAL=ON is the problem. That forces ParaView to use external packages for all 3rd parties, except those manually forced off by using VTK_MODULE_USE_EXTERNAL_VTK_...=. I suspect some third party library has changed and no longer works with 5.8.0 exposing this issue. From the looks of it, it may be freetype.

cc: @danlipsa , any thoughts?

I don’t remember seeing this one. I’ve seen various packages failing to build which can be solved by downgrading the offending package - or fixing the error on the machine you are building.
Downgrading might fix this error as well as spack might pick up a version ParaView was not tested with.


The superbuild is using freetype-2.10.0. What is the version picked up by spack?

The paraview package is define here: spack/ at develop · spack/spack · GitHub
It does depend on freetype but doesn’t require a specific version.

But the error looks more like it’s in the ParaView code itself, or in VTK’s code, not a problem with freetype’s API.

Utkarsh seems to have been right; the following “hacked” package, which removes -DPARAVIEW_BUILD_WITH_EXTERNAL=ON, seems to work (I have a build in progress and it’s got passed the point where the freetype problem usually occurs).

from spack.pkg.builtin.paraview import Paraview

class Paraview(Paraview):

    def cmake_args(self):
        args = super(Paraview, self).cmake_args()
        return args

The problem is that VTK was using macros that new fontconfig has removed from its public headers (they were internal macros apparently). See these VTK commits: