Compilation error with cairomm 1.16

Dear all,
I am trying to compile graph-tool-2.45 from source using the following dependencies (not full list):

  • gcc 11.3.0
  • cairo 1.17.4
  • cairomm 1.16.2
  • Python 3.10.4
  • pycairo 1.21.0
  • SciPy-bundle 2022.05

I am encountering two problems:
a) cairo will not be found automaticall unless I change in configure.ac the following line:

--    PKG_CHECK_MODULES(CAIROMM, [cairomm-1.0], AC_DEFINE([HAVE_CAIROMM], [1],
++    PKG_CHECK_MODULES(CAIROMM, [cairomm-1.16], AC_DEFINE([HAVE_CAIROMM], [1],

That allows me to run configure with these command line options after regenerating configure with autoreconfig -iv:

./configure --prefix=/tmp/graph-tools-eb --with-boost-python=boost_python310 --with-boost=$EBROOTBOOST

Summary of configure:

                            CONFIGURATION SUMMARY                              
================================================================================
Using python version:   3.10.4
Python interpreter:     /home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/bin/python
Installation path:      /home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/lib/python3.10/site-packages/graph_tool

C++ compiler (CXX):     g++
C++ compiler version:   11.3.0

Prefix:                 /tmp/graph-tools-eb
Pkgconfigdir:           ${libdir}/pkgconfig

Python CPP flags:       -I/home/sassy/apps/software/PyCairo/1.21.0-GCCcore-11.3.0/lib/python3.10/site-packages/cairo/include -I/home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/include/python3.10
Python LD flags:        -L/home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/lib -lpython3.10
Boost CPP flags:        -pthread -I/home/sassy/apps/software/Boost/1.79.0-GCC-11.3.0/include
Boost LD flags:         -L/home/sassy/apps/software/Boost/1.79.0-GCC-11.3.0/lib64 -lboost_iostreams-mt-x64 -lboost_python310 -lboost_regex-mt-x64 -lboost_context-mt-x64 -lboost_coroutine-mt-x64
Numpy CPP flags:        -I/home/sassy/apps/software/SciPy-bundle/2022.05-foss-2022a/lib/python3.10/site-packages/numpy/core/include
Sparsehash CPP flags:   
CGAL CPP flags:         -I/usr/include
CGAL LD flags:          
Expat CPP flags:        
Expat LD flags:          -lexpat 
Cairomm CPP flags:      -I/home/sassy/apps/software/cairomm/1.16.2-GCC-11.3.0/include/cairomm-1.16 -I/home/sassy/apps/software/cairomm/1.16.2-GCC-11.3.0/lib/cairomm-1.16/include -I/home/sassy/apps/software/cairo/1.17.4-GCCcore-11.3.0/include/cairo -I/home/sassy/apps/software/GLib/2.72.1-GCCcore-11.3.0/include/glib-2.0 -I/home/sassy/apps/software/GLib/2.72.1-GCCcore-11.3.0/lib/glib-2.0/include -I/home/sassy/apps/software/pixman/0.40.0-GCCcore-11.3.0/include/pixman-1 -I/home/sassy/apps/software/libpng/1.6.37-GCCcore-11.3.0/include/libpng16 -I/home/sassy/apps/software/libsigc++/3.4.0-GCCcore-11.3.0/include/sigc++-3.0 -I/home/sassy/apps/software/libsigc++/3.4.0-GCCcore-11.3.0/lib/sigc++-3.0/include
Cairomm LD flags:       -lcairomm-1.16 -lcairo -lsigc-3.0 
OpenMP compiler flags:  -fopenmp
OpenMP LD flags:        
Extra CPPFLAGS:         -DNDEBUG -I/home/sassy/apps/software/cairomm/1.16.2-GCC-11.3.0/include -I/home/sassy/apps/software/PyCairo/1.21.0-GCCcore-11.3.0/include -I/home/sassy/apps/software/sparsehash/2.0.4-GCCcore-11.3.0/include -I/home/sassy/apps/software/CGAL/4.14.3-gompi-2022a/include -I/home/sassy/apps/software/Boost.Python/1.79.0-GCC-11.3.0/include -I/home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/include -I/home/sassy/apps/software/gawk/5.1.1-GCC-11.3.0/include -I/home/sassy/apps/software/FFTW/3.3.10-GCC-11.3.0/include -I/home/sassy/apps/software/FlexiBLAS/3.2.0-GCC-11.3.0/include -I/home/sassy/apps/software/FlexiBLAS/3.2.0-GCC-11.3.0/include/flexiblas
Extra CXXFLAGS:         -fopenmp -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated -Wall -Wextra -ftemplate-backtrace-limit=0 -O2 -ftree-vectorize -march=native -fno-math-errno -std=c++17
Extra LDFLAGS:          -L/home/sassy/apps/software/cairomm/1.16.2-GCC-11.3.0/lib64 -L/home/sassy/apps/software/cairomm/1.16.2-GCC-11.3.0/lib -L/home/sassy/apps/software/PyCairo/1.21.0-GCCcore-11.3.0/lib64 -L/home/sassy/apps/software/PyCairo/1.21.0-GCCcore-11.3.0/lib -L/home/sassy/apps/software/matplotlib/3.5.2-foss-2022a/lib64 -L/home/sassy/apps/software/matplotlib/3.5.2-foss-2022a/lib -L/home/sassy/apps/software/sparsehash/2.0.4-GCCcore-11.3.0/lib64 -L/home/sassy/apps/software/sparsehash/2.0.4-GCCcore-11.3.0/lib -L/home/sassy/apps/software/CGAL/4.14.3-gompi-2022a/lib64 -L/home/sassy/apps/software/CGAL/4.14.3-gompi-2022a/lib -L/home/sassy/apps/software/Boost.Python/1.79.0-GCC-11.3.0/lib64 -L/home/sassy/apps/software/Boost.Python/1.79.0-GCC-11.3.0/lib -L/home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/lib64 -L/home/sassy/apps/software/Python/3.10.4-GCCcore-11.3.0/lib -L/home/sassy/apps/software/gawk/5.1.1-GCC-11.3.0/lib64 -L/home/sassy/apps/software/gawk/5.1.1-GCC-11.3.0/lib -L/home/sassy/apps/software/FFTW/3.3.10-GCC-11.3.0/lib64 -L/home/sassy/apps/software/FFTW/3.3.10-GCC-11.3.0/lib -L/home/sassy/apps/software/ScaLAPACK/2.2.0-gompi-2022a-fb/lib64 -L/home/sassy/apps/software/ScaLAPACK/2.2.0-gompi-2022a-fb/lib -L/home/sassy/apps/software/FlexiBLAS/3.2.0-GCC-11.3.0/lib64 -L/home/sassy/apps/software/FlexiBLAS/3.2.0-GCC-11.3.0/lib -L/home/sassy/apps/software/GCCcore/11.3.0/lib64 -L/home/sassy/apps/software/GCCcore/11.3.0/lib

Using OpenMP:           yes
Using sparsehash:       yes
Using cairo:            yes

However, make fails with this error message:

src/graph/draw/graph_cairo_draw.cc: In member function 'double VertexShape<Descriptor>::get_size(Cairo::Context&)':
src/graph/draw/graph_cairo_draw.cc:637:56: error: 'FontSlant' in namespace 'Cairo' does not name a type
  637 |                                     static_cast<Cairo::FontSlant>(_attrs.template get<int32_t>(VERTEX_FONT_SLANT)),
      |                                                        ^~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:638:56: error: 'FontWeight' in namespace 'Cairo' does not name a type
  638 |                                     static_cast<Cairo::FontWeight>(_attrs.template get<int32_t>(VERTEX_FONT_WEIGHT)));
      |                                                        ^~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc: In member function 'void VertexShape<Descriptor>::draw(Cairo::Context&, bool)':
src/graph/draw/graph_cairo_draw.cc:971:56: error: 'FontSlant' in namespace 'Cairo' does not name a type
  971 |                                     static_cast<Cairo::FontSlant>(_attrs.template get<int32_t>(VERTEX_FONT_SLANT)),
      |                                                        ^~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:972:56: error: 'FontWeight' in namespace 'Cairo' does not name a type
  972 |                                     static_cast<Cairo::FontWeight>(_attrs.template get<int32_t>(VERTEX_FONT_WEIGHT)));
      |                                                        ^~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc: In member function 'void EdgeShape<Descriptor, VertexShape>::draw(Cairo::Context&, double)':
src/graph/draw/graph_cairo_draw.cc:1229:37: error: 'FILL_RULE_EVEN_ODD' is not a member of 'Cairo'
 1229 |             cr.set_fill_rule(Cairo::FILL_RULE_EVEN_ODD);
      |                                     ^~~~~~~~~~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:1234:36: error: 'OPERATOR_SOURCE' is not a member of 'Cairo'
 1234 |             cr.set_operator(Cairo::OPERATOR_SOURCE);
      |                                    ^~~~~~~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:1278:36: error: 'OPERATOR_OVER' is not a member of 'Cairo'
 1278 |             cr.set_operator(Cairo::OPERATOR_OVER);
      |                                    ^~~~~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:1301:41: error: 'FILL_RULE_EVEN_ODD' is not a member of 'Cairo'
 1301 |                 cr.set_fill_rule(Cairo::FILL_RULE_EVEN_ODD);
      |                                         ^~~~~~~~~~~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:1366:52: error: 'FontSlant' in namespace 'Cairo' does not name a type
 1366 |                                 static_cast<Cairo::FontSlant>(_attrs.template get<int32_t>(EDGE_FONT_SLANT)),
      |                                                    ^~~~~~~~~
src/graph/draw/graph_cairo_draw.cc:1367:52: error: 'FontWeight' in namespace 'Cairo' does not name a type
 1367 |                                 static_cast<Cairo::FontWeight>(_attrs.template get<int32_t>(EDGE_FONT_WEIGHT)));
      |                                                    ^~~~~~~~~~
make[1]: *** [Makefile:3884: src/graph/draw/libgraph_tool_draw_la-graph_cairo_draw.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/sassy/easybuild/poppunk/todo/graph-tool/source/new/graph-tool-2.45'
make: *** [Makefile:2053: all] Error 2

My RSE friend and colleague told me that it looks like these functionalities have been removed.

I was searching the documentation but I could not find a recommended version for cairo .
What would be the way forward here?

Note: I do need cairo for the program I need to install on our HPC cluster and also, Anaconda is not an option for us.

Any sugestions are greatly appreciated.

You need cairomm 1.14 — version 1.16 introduced API breaks. Version 1.14 and 1.16 can be installed side by side.

Update: The current git version of graph-tool will work with either cairomm versions.

Many thanks for the prompt reply, I can confirm that downgrading cairomm to 1.14 works for me.
Also good to know that this was addressed in graph-tools as well.
As the software will get into EasyBuild, we are usually using releases, rather than the current Git version.
For what it is worth, here is the PR of the EasyConfig file of the latest release of graph-tool in the hope somebody might find it useful:

Thanks for your help

6 posts were split to a new topic: CMake port of graph-tool

Thank you! It’s the first time I’ve heard of EasyBuild. Please get in touch when the PR gets merged so I can list it as another possible installation route in the graph-tool webpage.

Hello!

Please accept my apologies for the delay to get back to you on this.
It was only a few days ago that graph-tool v2.55 got merged

Sometimes good things take time. :slight_smile:

So what does this mean now? In a nutshell, either you are waiting for the next EasyBuild release, which will have that automatically in the release, or if you are interested in trying it out, you can install EasyBuild as shown here:
https://tutorial.easybuild.io/2023-eb-eessi-uk-workshop/easybuild-installation/

and then get it directly from the PR:

$ eb --robot --from-pr 19234

That will take care of all the dependencies to build the program, including compiler etc!

Let me know if you got any further questions and again, apologies for the slow reply.