[GNC-dev] Missing Package

John Ralls jralls at ceridwen.us
Wed Sep 25 23:40:23 EDT 2019



> On Sep 25, 2019, at 6:44 PM, Stephen M. Butler <kg7je at arrl.net> wrote:
> 
>> /On Sep 25, 2019, at 10:50 AM, Tommy Trussell <tommy.trussell at
> gmail.com <https://lists.gnucash.org/mailman/listinfo/gnucash-devel>>
> wrote: /
> Guys,
> 
> You're off on the wrong tack. Those are cmake tests to determine if certain functions are present and it's expected for some of them to fail. They cause preprocessor variables to be set or not and there are checks in the code that adjust what functions are called depending on those preprocessor variables.
> 
> There's seldom any need to look at CMakeOutput.txt or CMakeError.txt, and you need a good understanding of how build systems work first in order to interpret them. Just look at what cmake writes to the terminal, that almost always tells you what's wrong in simple terms.
> 
> Regards,
> John Ralls
> 
> John, 
> 
> Sorry, I deleted this before responding and had to grab a copy from the
> archives.
> 
> My wife says I can't see anything right in front of my face!!  That must
> be true in this case.  I started from the point of building a minimal
> Disco schroot environment.  Knowing that GnC compiles in my environment
> under the full Disco set of packages but fails with the below snippet
> from the end of the string of messages, I made the presumption that the
> failure was due to a package missing in the minimal environment. 
> 
> Hopefully, if we can figure this out for Disco under schroot, then we
> can do Bionic in a similar environment.
> 
> 
> So, given the below, what am I not seeing that I should see (and thus
> fix)!  Or, have I not gone back far enough to catch the critical
> message?  My initial thought is that something to do with pthreads isn't
> loaded in the minimal environment.
> 
> 
> 
> Run Build Command:"/usr/bin/make" "cmTC_42272/fast"
> make[2]: Entering directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> /usr/bin/make -f CMakeFiles/cmTC_42272.dir/build.make
> CMakeFiles/cmTC_42272.dir/build
> make[3]: Entering directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> Building C object CMakeFiles/cmTC_42272.dir/CheckForPthreads.c.o
> /usr/bin/cc   -Wno-error=deprecated-declarations -std=gnu11
> -Wno-error=parentheses -Werror -Wdeclaration-after-statement
> -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations
> -Wno-unused -g -O2
> -fdebug-prefix-map=/home/steve/Projects/GnuCash/gnucash=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2    -o
> CMakeFiles/cmTC_42272.dir/CheckForPthreads.c.o   -c
> /usr/share/cmake-3.13/Modules/CheckForPthreads.c
> /usr/share/cmake-3.13/Modules/CheckForPthreads.c:3:7: error: no previous
> prototype for ‘start_routine’ [-Werror=missing-prototypes]
>  void* start_routine(void* args)
>        ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[3]: *** [CMakeFiles/cmTC_42272.dir/build.make:66:
> CMakeFiles/cmTC_42272.dir/CheckForPthreads.c.o] Error 1
> make[3]: Leaving directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> make[2]: *** [Makefile:121: cmTC_42272/fast] Error 2
> make[2]: Leaving directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> 
> 
> Determining if the function pthread_create exists in the pthreads failed
> with the following output:
> Change Dir: /home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp
> 
> Run Build Command:"/usr/bin/make" "cmTC_0cbb0/fast"
> make[2]: Entering directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> /usr/bin/make -f CMakeFiles/cmTC_0cbb0.dir/build.make
> CMakeFiles/cmTC_0cbb0.dir/build
> make[3]: Entering directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> Building C object CMakeFiles/cmTC_0cbb0.dir/CheckFunctionExists.c.o
> /usr/bin/cc   -Wno-error=deprecated-declarations -std=gnu11
> -Wno-error=parentheses -Werror -Wdeclaration-after-statement
> -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations
> -Wno-unused -g -O2
> -fdebug-prefix-map=/home/steve/Projects/GnuCash/gnucash=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -DCHECK_FUNCTION_EXISTS=pthread_create   -o
> CMakeFiles/cmTC_0cbb0.dir/CheckFunctionExists.c.o   -c
> /usr/share/cmake-3.13/Modules/CheckFunctionExists.c
> Linking C executable cmTC_0cbb0
> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0cbb0.dir/link.txt
> --verbose=1
> /usr/bin/cc -Wno-error=deprecated-declarations -std=gnu11
> -Wno-error=parentheses -Werror -Wdeclaration-after-statement
> -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations
> -Wno-unused -g -O2
> -fdebug-prefix-map=/home/steve/Projects/GnuCash/gnucash=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -DCHECK_FUNCTION_EXISTS=pthread_create 
> -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now 
> CMakeFiles/cmTC_0cbb0.dir/CheckFunctionExists.c.o  -o cmTC_0cbb0 -lpthreads
> /usr/bin/ld: cannot find -lpthreads
> collect2: error: ld returned 1 exit status
> make[3]: *** [CMakeFiles/cmTC_0cbb0.dir/build.make:87: cmTC_0cbb0] Error 1
> make[3]: Leaving directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> make[2]: *** [Makefile:121: cmTC_0cbb0/fast] Error 2
> make[2]: Leaving directory
> '/home/steve/Projects/GnuCash/gnucash/.build/CMakeFiles/CMakeTmp'
> 
> 
> dh_auto_configure: cd .build && cmake -DCMAKE_INSTALL_PREFIX=/usr
> -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc
> -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
> -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "-GUnix Makefiles"
> -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu
> -Wdev -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release
> "-DCMAKE_CXX_FLAGS=-g -O2
> -fdebug-prefix-map=/home/steve/Projects/GnuCash/gnucash=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2" -DWITH_PYTHON=ON
> -DCMAKE_INSTALL_LIBDIR=/usr/lib/x86_64-linux-gnu/gnucash
> -DGTEST_ROOT=TEST_ROOT -DGMOCK_ROOT=MOCK_ROOT .. returned exit code 1
> make[1]: *** [debian/rules:38: override_dh_auto_configure] Error 255
> make[1]: Leaving directory '/home/steve/Projects/GnuCash/gnucash'
> make: *** [debian/rules:24: build] Error 2
> dpkg-buildpackage: error: debian/rules build subprocess returned exit
> status 2
> 

Steven,

Whatever went wrong isn't in that listing. I don't know much about either schroot or Debian's build scripts except that Dmitriy filed a bunch of "FTBFS" bugs where it took the two of us many hours to figure out what had gone wrong. My conclusion is that the Debian build system breaks often and is difficult to debug.

So do what Dmitriy declines to: Get a shell in your schroot and build GnuCash by hand. Start off with the minimal flags, `cmake -G 'Unix Makefiles" -DWITH_PYTHON=ON -DGTEST_ROOT=xxx -DGMOCK_ROOT=yyyy ..` and make sure that builds OK, then start adding the others, one at a time, until it fails. When it fails, scroll back in the terminal and look at the messages there, don't bother with CMakeOutput or CMakeErrors.

Note that if you're building GnuCash master that GMOCK_ROOT was deleted a couple of weeks ago, that the minimum Googletest version is 1.8.0 and that GTEST_ROOT should point to the outer googletest folder, the one containing the googletest and googelmock folders.

Another note: '-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-g -O2"' is spelled '-DCMAKE_BUILD_TYPE=RelWithDebInfo' as that gets you debug symbols for both C and C++ instead of only C++ the way you've (and perhaps Dmitriy) have it. There's a heck of a lot more C than C++ in GnuCash. It's also better practice to let Cmake handle the compiler flags.

Regards,
John Ralls



More information about the gnucash-devel mailing list