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

Error trying to compile 2024-sep-14 p4c source on Ubuntu Linux #4912

Closed
jafingerhut opened this issue Sep 15, 2024 · 2 comments · Fixed by #4915
Closed

Error trying to compile 2024-sep-14 p4c source on Ubuntu Linux #4912

jafingerhut opened this issue Sep 15, 2024 · 2 comments · Fixed by #4915
Assignees
Labels
bug This behavior is unintended and should be fixed.

Comments

@jafingerhut
Copy link
Contributor

jafingerhut commented Sep 15, 2024

So far I have only seen this error with Ubuntu 24.04 Linux for aarch64 processor architecture, on an Apple Silicon M2 system running within VirtualBox. I am starting a build within Ubuntu 20.04 Linux for x86_64 processor arch on an Intel Apple system soon, and will add results from that when they are ready.

The error I see is:

In file included from /home/andy/p4c/test/gtest/flat_map.cpp:17:
/home/andy/p4c/lib/flat_map.h: In member function ‘P4::flat_map<K, V, Compare, Container>::mapped_type& P4::flat_map<K, V, Compare, Container>::at(const Key&)’:
/home/andy/p4c/lib/flat_map.h:103:40: error: ‘out_of_range’ is not a member of ‘std’
  103 |         if (found == end()) throw std::out_of_range("key is out of range");
      |                                        ^~~~~~~~~~~~
/home/andy/p4c/lib/flat_map.h:19:1: note: ‘std::out_of_range’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’?
   18 | #include <functional>
  +++ |+#include <stdexcept>
   19 | #include <vector>
/home/andy/p4c/lib/flat_map.h: In member function ‘const P4::flat_map<K, V, Compare, Container>::mapped_type& P4::flat_map<K, V, Compare, Container>::at(const Key&) const’:
/home/andy/p4c/lib/flat_map.h:109:40: error: ‘out_of_range’ is not a member of ‘std’
  109 |         if (found == end()) throw std::out_of_range("key is out of range");
      |                                        ^~~~~~~~~~~~
/home/andy/p4c/lib/flat_map.h:109:40: note: ‘std::out_of_range’ is defined in header ‘<stdexcept>’; did you forget to ‘#include <stdexcept>’?
make[2]: *** [test/CMakeFiles/gtestp4c.dir/build.make:300: test/CMakeFiles/gtestp4c.dir/gtest/flat_map.cpp.o] Error 1

I am using this version of the p4c source:

$ git log -n 1 | head -n 3
commit 9e77cde6203fb32f734826b17fee3f5034749aaa
Author: Kyle Cripps <60898032+kfcripps@users.noreply.github.com>
Date:   Thu Sep 12 05:41:14 2024 -0700

Summary of results:

  • aarch64 Ubuntu 20.04 - no error, compile & install of p4c goes fine
  • aarch64 Ubuntu 24.04 - the error above
  • x86_64 Ubuntu 20.04 - no error, compile & install of p4c goes fine
  • x86_64 Ubuntu 22.04 - the error above
  • x86_64 Ubuntu 24.04 - the error above

I have attached a log file for the Ubuntu 24.04 aarch64 attempted build of p4c, including output from the cmake command, in case that contains any useful details about versions of other things that are installed. Let me know if you want the output of any other commands executed on that system.
log-p4c-ubuntu24.04-aarch64-v8.txt

@fruffy fruffy added bug This behavior is unintended and should be fixed. bmv2 Topics related to BMv2 or v1model and removed bmv2 Topics related to BMv2 or v1model labels Sep 15, 2024
@ChrisDodd
Copy link
Contributor

There's a missing #include <stdexcept> needed in lib/flat_map.h

@asl
Copy link
Contributor

asl commented Sep 16, 2024

Yeah, will submit a fix shortly

asl added a commit to asl/p4c that referenced this issue Sep 16, 2024
Fixes p4lang#4912

Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
github-merge-queue bot pushed a commit that referenced this issue Sep 16, 2024
Fixes #4912

Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
@asl asl closed this as completed in #4915 Sep 16, 2024
linuxrocks123 pushed a commit to linuxrocks123/p4c that referenced this issue Sep 18, 2024
Fixes p4lang#4912

Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants