Understanding and fixing compile time errors

Dear GPlates team,

A student at the university I work is working on a project involving pyGPlates and the duty of installing it on our CentOS 7 HPC cluster has fallen on me. I have chosen to try Gplates 2.3.0, with the intention to get it to work with Anaconda 2023.03. I am compiling it with the openMPI compiler 4.1.5 on GCC 12.1.0.

However, when compiling it, I run into errors that I find difficult to fix. I was hoping I could rely on your expertise to identify what is going wrong. It appears as if it is related to calls to libboost, but the install came with its own boost, 1.78.0, implying that they are supposed to work well together. I could try linking with another boost version, but I would much rather understand what is going and what to do.

Thank you very much for your time,

Lukas (and a very grateful master student)

/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc: In member function ‘boost::optional<__gnu_cxx::_normal_iterator<const GPlatesGui::TopologyTools::VisibleSection*, std::vectorGPlatesGui::TopologyTools::VisibleSection > > GPlatesGui::TopologyTools::is_section_visible_boundary(std::vector::size_type) const’:
/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:3451:92: error: ‘1’ was not declared in this scope
3451 | boost::bind(&VisibleSection::d_section_info_index, 1) ==
| ^~
/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:3451:92: note: suggested alternatives:
In file included from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/include_preprocessed.hpp:37,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/placeholders.hpp:43,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/iterator/iterator_categories.hpp:16,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/iterator/iterator_adaptor.hpp:14,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/iterator/reverse_iterator.hpp:10,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/range/reverse_iterator.hpp:21,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/range/rend.hpp:19,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/foreach.hpp:82,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
In file included from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/utility/compare_pointees.hpp:15,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/optional/optional.hpp:55,
from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/optional.hpp:15,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:38:
/trinity/opt/apps/software/gcc/gcc-12.1.0/include/c++/12.1.0/functional:285:34: note: ‘std::placeholders::_1’
285 | extern const Placeholder<1> 1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
In file included from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/bind/bind.hpp:2336,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/utils/ReferenceCount.h:29,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/model/WeakReferenceCallback.h:35,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/model/WeakReference.h:37,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/model/Model.h:29,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/model/BasicHandle.h:39,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/model/FeatureHandle.h:35,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologySectionsContainer.h:37,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.h:37,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:54:
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/bind/placeholders.hpp:46:38: note: ‘boost::placeholders::1’
46 | BOOST_INLINE_CONSTEXPR boost::arg<1> 1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
In file included from /trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/lambda/bind.hpp:15,
from /trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:35:
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/lambda/core.hpp:71:60: note: ‘boost::lambda::{anonymous}::_1’
71 | boost::lambda::placeholder1_type& BOOST_ATTRIBUTE_UNUSED _1 = free1;
| ^~
/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc: In member function ‘boost::optional<__gnu_cxx::__normal_iterator<const GPlatesGui::TopologyTools::VisibleSection*, std::vectorGPlatesGui::TopologyTools::VisibleSection > > GPlatesGui::TopologyTools::is_section_visible_interior(std::vector::size_type) const’:
/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:3470:92: error: ‘1’ was not declared in this scope
3470 | boost::bind(&VisibleSection::d_section_info_index, 1) ==
| ^~
/trinity/opt/apps/software/python/pygplates/gplates_2.3.0_src/src/gui/TopologyTools.cc:3470:92: note: suggested alternatives:
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
/trinity/opt/apps/software/gcc/gcc-12.1.0/include/c++/12.1.0/functional:285:34: note: ‘std::placeholders::_1’
285 | extern const Placeholder<1> 1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/bind/placeholders.hpp:46:38: note: ‘boost::placeholders::1’
46 | BOOST_INLINE_CONSTEXPR boost::arg<1> 1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/mpl/aux
/preprocessed/gcc/placeholders.hpp:29:16: note: ‘mpl
::_1’
29 | typedef arg<1> _1;
| ^~
/trinity/opt/apps/software/Anaconda/2023.03/tensorflowGPU/installHere/include/boost/lambda/core.hpp:71:60: note: ‘boost::lambda::{anonymous}::_1’
71 | boost::lambda::placeholder1_type& BOOST_ATTRIBUTE_UNUSED _1 = free1;
| ^~
make[2]: *** [src/CMakeFiles/gplates-lib.dir/gui/TopologyTools.cc.o] Error 1
make[1]: *** [src/CMakeFiles/gplates-lib.dir/all] Error 2

Hi lukas,

Compiling from source code can get tricky with the dependency libraries (like boost) when you don’t have full control of their installation. In your case it looks like the boost version installed with TensorFlow is getting found (which could ultimately end up in link errors). Also the source code version of pyGPlates you’re using might not compile well with Boost 1.78 (probably why you’re getting that compile error). The latest pygplates branch would support it though.

However, it would be easier to first try using the pre-built conda version of pyGPlates which has already dealt with these issues in the Anaconda ecosystem. Here is an example on how pyGPlates was installed on a CentOS 8 HPC system (NCI’s Gadi) using Miniconda.

Hi John,

thank you for taking the time to reply!
I have initially tried a regular conda install: conda install -c conda-forge pygplates

And conda list indeed provides a nice:

> conda list | grep plates
pygplates                 0.39            py310he8583c2_1    conda-forge

However, Python scripts using

import pygplates

still return a

ModuleNotFoundError: No module named 'pygplates'

Also, in the install directory of Anaconda,

find |grep -i pygplates

returns nothing.
So I could either see how Anaconda really works, deep down, or compile from scratch and put it in the PYTHONPATH. As we compile almost everything from scratch and we had all but one of the dependencies of pyGPlates already compiled (CGAL was still missing, but that proved to be only a small hurdle) that seemed the more intuitive errors.

Beside that, I can imagine that I would get link time errors from wrong versions (such as lib boost), but these appear to be compile time errors, which are different in nature.

I will have a look at the example you so kindly provided, and see whether it can help me out.

Thanks again,

Lukas

Perhaps double-check that you’re running the Anaconda python (and not some other python, eg, in a HPC module that is currently loaded, or in PATH).

Otherwise, yes, since you’ve got all the dependencies compiled already (not an easy task) that could work too. Hopefully the latest pygplates source code (in the link above) will get rid of your original error (if you go down that route).

Dear John,

thank you for the time.
Our default Anaconda was 2023.03, and the conda forge install kept giving

__glibc[version=‘>=2.17’]

errors.

I checked for new Anaconda versions and there is 2023.09, where the install went quite easily.

The student just reported that everything works for her and a run that took about a week on her laptop now runs in parallel on the cluster in an hour, thanks to your help. :smile:

Best wishes,

Lukas