angus-g / pyrol

Python interface to ROL 2.0
GNU Lesser General Public License v3.0
2 stars 2 forks source link

Build Failure: Errors Compiling pyrol on macOS with Python 3.11 #2

Closed ryan-david-murphy closed 2 months ago

ryan-david-murphy commented 2 months ago

Description I have attempted to install the pyrol on an M1 macOS 14.1 using Python 3.11. However, the installation failed during the build process, particularly when building the wheel for pyroltrilinos. The errors seem to be related to serialisation functions for std::vector with cereal and some warnings about unqualified calls to std::forward.

Steps to Reproduce

pip3 install --no-cache-dir roltrilinos
pip3 install --no-cache-dir ROL
git clone -b rol-2.0-checkpointing https://github.com/APaganini/pyrol.git
cd pyrol
git submodule update --init
cd ..
python -m pip install pyrol/

Error snippet:

error: static assertion failed due to requirement 'traits::detail::count_output_serializers<std::vector<bool>, cereal::BinaryOutputArchive>::value != 0': cereal could not find any output serialization functions for the provided type and archive combination.

error: static assertion failed due to requirement 'traits::detail::count_input_serializers<std::vector<bool>, cereal::BinaryInputArchive>::value != 0': cereal could not find any input serialization functions for the provided type and archive combination.

Could you please provide any guidance on how to resolve these build errors or if there are any workarounds or fixes available? I have attached the output log.

Thank you for your assistance.

output.txt

sghelichkhani commented 2 months ago

It looks like you're mixing up steps for installing the legacy version of pyrol (using ROL1.0) with pyrol2.0, which is what you're actually trying to get up and running. The older setup won’t work because pyrol2.0 uses a different version of roltrilinos (very close to upstream roltrilinos) that's tailored for it, including some neat serialization features for checkpointing.

The good news is, installing PyROL 2.0 is straightforward. You just need to use the master branch which points to the write roltrilinos repository in its setup, so just the following command:

python3 -m pip install --force-reinstall git+https://github.com/angus-g/pyrol.git

One you do that it should install fine!

ryan-david-murphy commented 2 months ago

Thank you @sghelichkhani -- this fixed the issue!