Compiler error while trying to build kicad

Hello, I am a new kicad user trying to build it from the current source. But I am getting a compiler error (below). I’m using gcc 14.2 and protoc version 31.0-dev. I tried to collect the header files into a tiny project but was not able to duplicate the error outside of the main build. Has anyone else seen this, or could someone please suggest something to try? Thanks

[ 12%] Building CXX object common/CMakeFiles/kicommon.dir/netclass.cpp.o
In file included from /dsk2/usr/include/absl/strings/string_view.h:43,
from /dsk2/usr/include/absl/log/internal/vlog_config.h:39,
from /dsk2/usr/include/absl/log/absl_vlog_is_on.h:63,
from /dsk2/usr/include/absl/log/internal/log_impl.h:18,
from /dsk2/usr/include/absl/log/absl_log.h:36,
from /dsk2/usr/include/google/protobuf/io/coded_stream.h:107,
from /dsk2/usr/include/google/protobuf/any.pb.h:20,
from /dsk2/opt/kicad-9/include/api/api_utils.h:25,
from /dsk2/opt/kicad-9/common/netclass.cpp:31:
/dsk2/usr/include/absl/functional/internal/any_invocable.h: In static member function ‘static ReturnType absl::lts_20250127::internal_any_invocable::Impl<ReturnType(P …)>::InvokedAfterMove(absl::lts_20250127::internal_any_invocable::TypeErasedState*, absl::lts_20250127::internal_any_invocable::ForwardedParameterType

…)’:
/dsk2/usr/include/absl/functional/internal/any_invocable.h:868:1: internal compiler error: Segmentation fault
868 | ABSL_INTERNAL_ANY_INVOCABLE_IMPL(, , &);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xf1d99f crash_signal
…/…/./gcc/toplev.cc:319
0xb938aa location_wrapper_p(tree_node const*)
…/…/./gcc/tree.h:4391
0xb938aa tree_strip_any_location_wrapper(tree_node*)
…/…/./gcc/tree.h:4403
0xb938aa operand_compare::operand_equal_p(tree_node const*, tree_node const*, unsigned int)
…/…/./gcc/fold-const.cc:3154
0x791230 build_conditional_expr(op_location_t const&, tree_node*, tree_node*, tree_node*, int)
…/…/./gcc/cp/call.cc:6382
0x978ca2 build_x_conditional_expr(unsigned int, tree_node*, tree_node*, tree_node*, int)
…/…/./gcc/cp/typeck.cc:7974
0x8b3055 cp_parser_assignment_expression
…/…/./gcc/cp/parser.cc:10743
0x8b3424 cp_parser_expression
…/…/./gcc/cp/parser.cc:10904
0x8d9026 cp_parser_decltype_expr
…/…/./gcc/cp/parser.cc:17113
0x8d9026 cp_parser_decltype
…/…/./gcc/cp/parser.cc:17217
0x8e783e cp_parser_simple_type_specifier
…/…/./gcc/cp/parser.cc:20377
0x8d5e8c cp_parser_postfix_expression
…/…/./gcc/cp/parser.cc:7857
0x8b220b cp_parser_binary_expression
…/…/./gcc/cp/parser.cc:10393
0x8b2e74 cp_parser_assignment_expression
…/…/./gcc/cp/parser.cc:10737
0x8b3424 cp_parser_expression
…/…/./gcc/cp/parser.cc:10904
0x8c963c cp_parser_primary_expression
…/…/./gcc/cp/parser.cc:5925
0x8d63af cp_parser_postfix_expression
…/…/./gcc/cp/parser.cc:7934
0x8b220b cp_parser_binary_expression
…/…/./gcc/cp/parser.cc:10393
0x8b2e74 cp_parser_assignment_expression
…/…/./gcc/cp/parser.cc:10737
0x8b3424 cp_parser_expression
…/…/./gcc/cp/parser.cc:10904
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See https://gcc.gnu.org/bugs/ for instructions.
make[2]: *** [common/CMakeFiles/kicommon.dir/build.make:1770: common/CMakeFiles/kicommon.dir/netclass.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4318: common/CMakeFiles/kicommon.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

What version of Linux are you running, and what branch are you trying to compile?

I am runing Netrunner linux 25 . uname returns 6.1.0-31-amd64.
I did not specify a branch when I pulled kicad with git, so probably it is the main one.

I don’t know anything about that distro, but you could try setting the protobuf cmake option mentioned in the note here: Linux | Developer Documentation | KiCad

That helps resolve a build/link error with absl and protobuf on some distros, which might help you.

Okay, I will try that, and also try using Ninja to see if it makes a difference.
Thank you for the suggestion.

Update: Neither that protobuf flag nor ninja made any difference. The compiler is still failing at the same place. I’ll keep playing around with it.

This is not a KiCad issue, it looks like. Something about your distro’s compiler and available version of abseil don’t like each other. KiCad works on Debian, which it looks like your distro is based on, so I would start looking for differences between the toolchain (gcc) and libraries (abseil) to see which one is causing the issue, and then you will probably want to report it to your distro.

On a personal note, I don’t understand any of this post and I have no wish to, but I’m curious. Why is all this necessary when I just install Kicad by clicking on an ‘EXE’ file please :woozy_face: :face_with_spiral_eyes:
:mouse:

I understand a “touch” more but that “touch” could very easily be rounded down to zero :wink: but I think it’s all about different distributions and builds (flavours if you like) of Linux. The different distributions include different repositories of libraries/app, etc so when a user tries to run KiCad on a specific (not officially supported ) version of Linux it can often throw up dependency issues.

Also some people just like to compile the KiCad software for themselves, because they can . . . or find they can’t and then ask for help.

Personally I’m happy to run on Windows, I run the installer, it installs . . . life is too precious to me to spend time trying to do anything more involved to get KiCad to work.

1 Like

I was trying to compile kicad from source in order to get the latest version. The version available via the package manager on my linux distro is only version 6, but the current one is 9. I appreciate the suggestions that a few people left earlier. I’m still trying to get it to build.

If all you want is to run the version, I would recommend using the FlatPak instead of building from source.

Just checked. Debian 12 shows the same. If this distro is following Debian closely, as the website indicates, then look into setting up backports.

https://packages.debian.org/search?searchon=names&keywords=kicad

Hmm… Not sure if this matters but are you running an ARM processor?

My processor is amd64. I was not aware of flatpak. I’m trying that now.

I was able to successfully install version 9 with flatpak. Thanks craftyjon for the solution.

1 Like

And I learned a whole shed loads to :laughing: Cheers @RaptorUK
:mouse: