Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on newer glibc versions #132

Closed
bradley-solliday-skydio opened this issue May 18, 2022 · 1 comment
Closed

Build fails on newer glibc versions #132

bradley-solliday-skydio opened this issue May 18, 2022 · 1 comment
Labels
bug Something isn't working build
Milestone

Comments

@bradley-solliday-skydio
Copy link
Collaborator

bradley-solliday-skydio commented May 18, 2022

When building with a new compiler verison (gcc 11.2.0 in my case), the build fails with the below error:

In file included from /usr/include/signal.h:328,
                 from /symforce/third_party/catch2/include/catch.hpp:8152,
                 from /symforce/third_party/catch2/src/catch_amalgamated.cpp:15:
/symforce/third_party/catch2/src/catch_amalgamated.cpp:3580:54: error: call to non-'constexpr' function 'long int sysconf(int)'
 3580 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                      ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /symforce/third_party/catch2/include/catch.hpp:8152,
                 from /symforce/third_party/catch2/src/catch_amalgamated.cpp:15:
/usr/include/unistd.h:640:17: note: 'long int sysconf(int)' declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
/symforce/third_party/catch2/src/catch_amalgamated.cpp:3633:41: error: size of array 'altStackMem' is not an integral constant-expression
 3633 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                         ^~~~~~~~~~~~

This error is apparently already known about and fixed on the developer branch of catch2: catchorg/Catch2#2317

We, however, have a copy of catch2 checked in the third_party directory, so our version doesn't have the fix.

So, updating catch2 will probably fix this error. We'd probably want to download the newer version of catch2 using cmake's FetchContent and delete catch2 from third_party while we're at it.

To Reproduce

Create a docker container with
docker run --rm -it ubuntu:jammy /bin/bash
and run the following commands:

apt-get update
apt-get install build-essential doxygen libgmp-dev pandoc git python3-pip -y
git clone https://github.com/symforce-org/symforce.git
cd symforce
pip3 install -r dev_requirements.txt
mkdir build
cd build
cmake ..
make -j $(nproc)

To see it work with a newer version of gcc, you can just run the above commands, except in ubuntu:focal (which ends up using gcc 9.4.0) by instead creating your docker container with
docker run --rm -it ubuntu:focal /bin/bash

@bradley-solliday-skydio bradley-solliday-skydio added bug Something isn't working build labels May 18, 2022
@stefangachter
Copy link

Changed git tag in CMakeLists.txt - Catch2 section - to GIT_TAG 97c48e0c343d26d50764fafdc90b1e630fbd10ce # v3.1.0 to make it build with Ubuntu 22.04

@aaron-skydio aaron-skydio changed the title Build fails on newer compiler versions Build fails on newer glibc versions Sep 30, 2022
bradley-solliday-skydio added a commit that referenced this issue Oct 21, 2022
This version of Catch2 doesn't have the same issues that sometimes
causes v3.0.1 to fail to compile with older ubuntu versions/compiler
versions.

Moreover, it also can compile with newer compilers (like gcc-11) on
ubuntu jammy.

So, adding ubuntu jammy to the `test_editable_pip_install` and `ci`
github action workflows.

Fixes #132
@aaron-skydio aaron-skydio added this to the v0.6.1 milestone Oct 21, 2022
bradley-solliday-skydio added a commit to bradley-solliday-skydio/symforce that referenced this issue Oct 25, 2022
This version of Catch2 doesn't have the same issues that sometimes
causes v3.0.1 to fail to compile with older ubuntu versions/compiler
versions.

Moreover, it also can compile with newer compilers (like gcc-11) on
ubuntu jammy.

So, adding ubuntu jammy to the `test_editable_pip_install` and `ci`
github action workflows.

Fixes symforce-org#132
bradley-solliday-skydio added a commit to bradley-solliday-skydio/symforce that referenced this issue Oct 25, 2022
This version of Catch2 doesn't have the same issues that sometimes
causes v3.0.1 to fail to compile with older ubuntu versions/compiler
versions.

Moreover, it also can compile with newer compilers (like gcc-11) on
ubuntu jammy.

So, adding ubuntu jammy to the `test_editable_pip_install` and `ci`
github action workflows.

Fixes symforce-org#132
bradley-solliday-skydio added a commit that referenced this issue Oct 27, 2022
This version of Catch2 doesn't have the same issues that sometimes
causes v3.0.1 to fail to compile with older ubuntu versions/compiler
versions.

Moreover, it also can compile with newer compilers (like gcc-11) on
ubuntu jammy.

So, adding ubuntu jammy to the `test_editable_pip_install` and `ci`
github action workflows.

To suport the Jammy build, I needed to make `setup.py` more robust to
different locations that the `symengine_wrapper.so` file might be
placed in after the build step.

Only real reason I'm not running gcc-5 on Jammy is because it is a bit
inconvenient to get a copy of it on Jammy, and it's not obviously worth
the hassle.

Set `PYTHON_EXECUTABLE` to equal `SYMFORCE_PYTHON` before adding
pybind11 to ensure that the whole build is referencing the same python
version (for example, when I had both python3.10 and python3.8 installed
on ubuntu jammy, `PYTHON_EXECUTABLE` was automatically set to python3.10
despite `SYMFORCE_PYTHON` being set to python3.8).

Fixes #132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants