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 from source failure on undeclared identifier _POSIX_SEM_VALUE_MAX #16

Closed
willwray opened this issue Sep 21, 2023 · 2 comments
Closed

Comments

@willwray
Copy link

(Reporting here rather than cppyy repo because this issue is specific to the build here.)

I'm attempting to follow the instructions for building from source

Start with the cppyy-cling package (cppyy-backend repo, subdirectory “cling”), which requires source to be pulled in from upstream, and thus takes a few extra steps:

$ git clone https://github.com/wlav/cppyy-backend.git
$ cd cppyy-backend/cling
$ python setup.py egg_info
$ python create_src_directory.py
$ python -m pip install . --upgrade

This fails for me on two different systems and three compilers
Ubuntu (with clang16 or gcc11.4) and Fedora36 with gcc12.2

(Should I retry with other or older compilers?)

The SEM_VALUE_MAX error starts with commit 00c7bed "upgrade Cling from upstream (28.04)"
(before that commit there's another blocking error - a compile fail on a const qualifier).

Ubuntu 22.04.3 GCC11.4

      [ 97%] Generating G__ThreadLegacy.cxx, ../../lib/libThreadLegacy.rootmap
      In file included from input_line_8:16:
      In file included from /Data/home/will/repos/cppyy-backend/cling/builddir/include/ROOT/TReentrantRWLock.hxx:21:
      In file included from /usr/include/c++/11/condition_variable:47:
      In file included from /usr/include/c++/11/stop_token:37:
      In file included from /usr/include/c++/11/semaphore:35:
      /usr/include/c++/11/bits/semaphore_base.h:62:41: error: use of undeclared identifier '_POSIX_SEM_VALUE_MAX'; did you mean '_SC_SEM_VALUE_MAX'?
          static constexpr ptrdiff_t _S_max = _POSIX_SEM_VALUE_MAX;
                                              ^
      /usr/include/x86_64-linux-gnu/bits/confname.h:140:5: note: '_SC_SEM_VALUE_MAX' declared here
          _SC_SEM_VALUE_MAX,
          ^
      Error: /Data/home/will/repos/cppyy-backend/cling/builddir/core/rootcling_stage1/src/rootcling_stage1: compilation failure (/Data/home/will/repos/cppyy-backend/cling/builddir/lib/libThreadLegacyde1d7a8d17_dictUmbrella.h)
      gmake[2]: *** [core/thread/CMakeFiles/G__ThreadLegacy.dir/build.make:106: core/thread/G__ThreadLegacy.cxx] Error 1
      gmake[1]: *** [CMakeFiles/Makefile2:28486: core/thread/CMakeFiles/G__ThreadLegacy.dir/all] Error 2
      gmake[1]: *** Waiting for unfinished jobs....
      [ 97%] Built target Cling
      gmake: *** [Makefile:156: all] Error 2
      error: Failed to build cppyy-cling

Fedora36 GCC12.2

  [ 97%] Generating G__ThreadLegacy.cxx, ../../lib/libThreadLegacy.rootmap
  In file included from input_line_8:16:
  In file included from /home/will/repos/cppyy-backend/cling/builddir/include/ROOT/TReentrantRWLock.hxx:21:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/condition_variable:46:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/stop_token:37:
  In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/semaphore:35:
  /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/semaphore_base.h:59:41: error: use of undeclared identifier '_POSIX_SEM_VALUE_MAX'; did you mean '_SC_SEM_VALUE_MAX'?
      static constexpr ptrdiff_t _S_max = _POSIX_SEM_VALUE_MAX;
                                          ^
  /usr/include/bits/confname.h:140:5: note: '_SC_SEM_VALUE_MAX' declared here
      _SC_SEM_VALUE_MAX,
      ^
...
@wlav
Copy link
Owner

wlav commented Sep 22, 2023

Related: #12

@wlav
Copy link
Owner

wlav commented Nov 1, 2023

Workaround in repo as detailed in #12 .

@wlav wlav closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants