Kicad 8.0.5 compiling problem in Linux (boost 1.86)

Unlike previous 8.0.* versions that compiled well, this version compiling resulted in the following:

[  8%] Building CXX object common/CMakeFiles/kicommon.dir/exceptions.cpp.o
[  8%] Building CXX object common/CMakeFiles/kicommon.dir/kiid.cpp.o
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:50:15: error: ‘mt19937’ in namespace ‘boost’ does not name a type
   50 | static boost::mt19937                                       rng;
      |               ^~~~~~~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:51:52: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
   51 | static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator;
      |                                                    ^~~~~~~
In file included from /usr/include/c++/14.2.0/random:48,
                 from /usr/include/boost/uuid/detail/random_device.hpp:65,
                 from /usr/include/boost/uuid/detail/random_provider.hpp:9,
                 from /usr/include/boost/uuid/basic_random_generator.hpp:11,
                 from /usr/include/boost/uuid/random_generator.hpp:10,
                 from /usr/include/boost/uuid/uuid_generators.hpp:14,
                 from /tmp/SBo/kicad-8.0.5/common/kiid.cpp:28:
/usr/include/c++/14.2.0/bits/random.h:1717:37: note: ‘std::mt19937’ declared here
 1717 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:51:59: error: template argument 1 is invalid
   51 | static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator;
      |                                                           ^
/tmp/SBo/kicad-8.0.5/common/kiid.cpp: In constructor ‘KIID::KIID()’:
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:90:37: error: ‘randomGenerator’ cannot be used as a function
   90 |             m_uuid = randomGenerator();
      |                      ~~~~~~~~~~~~~~~^~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp: In constructor ‘KIID::KIID(const std::string&)’:
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:152:41: error: ‘randomGenerator’ cannot be used as a function
  152 |                 m_uuid = randomGenerator();
      |                          ~~~~~~~~~~~~~~~^~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp: In member function ‘size_t KIID::Hash() const’:
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:244:36: error: invalid cast from type ‘const boost::uuids::uuid::data_type’ to type ‘const uint32_t*’ {aka ‘const unsigned int*’}
  244 |         boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp: In member function ‘void KIID::ConvertTimestampToUuid()’:
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:275:41: error: ‘randomGenerator’ cannot be used as a function
  275 |     m_uuid             = randomGenerator();
      |                          ~~~~~~~~~~~~~~~^~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp: In static member function ‘static void KIID::SeedGenerator(unsigned int)’:
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:302:5: error: ‘rng’ was not declared in this scope
  302 |     rng.seed( aSeed );
      |     ^~~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:303:67: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
  303 |     randomGenerator = boost::uuids::basic_random_generator<boost::mt19937>( rng );
      |                                                                   ^~~~~~~
/usr/include/c++/14.2.0/bits/random.h:1717:37: note: ‘std::mt19937’ declared here
 1717 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/tmp/SBo/kicad-8.0.5/common/kiid.cpp:303:74: error: template argument 1 is invalid
  303 |     randomGenerator = boost::uuids::basic_random_generator<boost::mt19937>( rng );
      |                                                                          ^
make[2]: *** [common/CMakeFiles/kicommon.dir/build.make:702: common/CMakeFiles/kicommon.dir/kiid.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3256: common/CMakeFiles/kicommon.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Is it a problem with boost version or so ?

I can’t help with this compile stuff, but I changed your text from a “blockquote” to “Preformatted text”, as this preserves indentation and does not add other formatting such as strikethrough.

image

Boost made some backwards incompatible changes in 1.86. If you are using Boost 1.86, you’ll need to patch in a handful of commits from after the 8.0.5 tag to get KiCad to build. I think there are 3 needed:

Alternatively you could just build the head of the 8.0 branch instead of the 8.0.5 tag.

3 Likes

I entered these 3 changes to corresponding files, now KiCAD compiles as always, at this moment I have 15% progression. Must wait an hour or 2 for final result . . .

Edit: compilation went fine, thanks for the suggestions !

2 Likes