bugGNU Octave - Bugs: bug #45578, build failure due to no dependency...


bug #45578: build failure due to no dependency on libgnu

Submitted by:  John Donoghue <lostbard>
Submitted on:  Sun 19 Jul 2015 02:10:47 PM UTC  
Category: Configuration and Build SystemSeverity: 4 - Important
Priority: 5 - NormalItem Group: Build Failure
Status: ConfirmedAssigned to: None
Originator Name: JohnDOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Fri 08 Jul 2016 02:18:36 AM UTC, comment #11:

I pushed a minor fixup


I may look again at the partial work to try to build libgnu as an include file rather than a subdirectory make file.

This won't improve the build much over what we have now other than "cleanliness".

The overall issue of dependencies on generated files, say a header file that is built from a shell script, still remains.

However, I am able to do a full build of 'make dist' after doing some sneaky things to build all of the $(BUILT_SOURCES) first. So this proves to me that, if we were to have a way to add a dependency on $(BUILT_SOURCES), everything else actually does build with the right dependencies now.

To be specific, the following does work for me:

Now the 'dist' target, which does not depend on 'all' or 'check' or $(BUILT_SOURCES), builds successfully, including all of the things needed to actually build and run Octave to generate the images for the docs.

After building 'dist' I can 'make all' and show that only a handful of files are built that weren't needed for 'dist', including the -tst files, the .qm files under libgui, and the .gdbinit files useful for ./run-octave -g.

However, beyond that hack, I don't know how to actually make every compilation depend on $(BUILT_SOURCES), the automake manual talks about this and a few different approaches, but it looks like we may be approaching the best we can do.

Mike Miller <mtmiller>
Project Administrator
Tue 01 Mar 2016 05:57:03 PM UTC, comment #10:

I added a partial fix for libgnu not being built early enough in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/ad1dbbd23f1d). It is really only a band-aid that works when running 'make all', as is the case when MXE is used, but does nothing to put the real list of dependencies into the Makefile.

Rik <rik5>
Project Administrator
Thu 11 Feb 2016 10:49:11 PM UTC, comment #9:

Should we apply the patch from comment #6 at least temporarily until there is a clean way to handle the dependency on libgnu?

Rik <rik5>
Project Administrator
Tue 01 Sep 2015 03:33:48 AM UTC, comment #8:

I would definitely prefer to switch to a non-recursive build for libgnu. I had something that was working but wasn't really satisfied with the way it was done. There are better ways, but they will require more work. For now, we can probably just use a modification of what was done for bison's build system.

John W. Eaton <jwe>
Project Administrator
Tue 01 Sep 2015 01:11:48 AM UTC, comment #7:

I think Automake always does a make in SUBDIRS first, followed by making the "all" targets in the current directory. So a normal "make all" just works, at least most of the time.

Another thing that is implied are the files in BUILT_SOURCES, which are made before any other of the targets for "make all". Some of these are in the source tarball, some are not.

I haven't had a lot of time to look at the build system lately, but jwe and I were looking at some diffs to make libgnu non-recursively. If we need a workaround in the meantime, we could try adding a dependency rule on libgnu/libgnu.la as you suggested. I don't know if it's realistic to try to capture the dependencies for all of the built source files.

Mike Miller <mtmiller>
Project Administrator
Sun 30 Aug 2015 11:12:23 PM UTC, comment #6:

@Mike: I think this has uncovered something rather fundamental. The old build system was serialized by directory and in each directory the dependencies were correctly specified for make. But now that all files in all directories can potentially be made in parallel there are a lot of dependencies that have yet to be specified.

The old SUBDIRS variable (in octave-stable) was

which built libgnu before everything.

Now it is just

which seems to allow things that don't "depend" on libgnu like libinterp to run whenever they can be scheduled. But of course, libinterp does depend on gnulib. If I use "grep gnulib::" in libinterp I find 82 instances such as this one in rand.cc:

gnulib is segregated with it's own system for constructing a Makefile, etc. I think it will be easier for maintenance purposes to preserve that separation and just add some sort of ordering rule or dependency to create libgnu before the rest of the build. My attempt, added to Makefile.am, is shown below.

It doesn't work perfectly however. I think because BUILT_SOURCES may only apply when something like 'make all' is used.

The example you discovered, 'make src/octave-gui', is an excellent test bench. I used 'make dist' to create a tar ball and then unpacked it into a temporary source directory. I then switched to a build directory and configured using the temporary source directory. When I try to create src/octave-gui I repeatedly ran into unmet dependencies. See below the errors, and what command I used to overcome them.

Some of them are rather obvious. The code libgui/src/m-editor/file-editor-tab.cc includes version.h, but version.h is a generated file in libinterp and there is no dependency written in the libgui/module.mk file. Is there an automated way to discover these dependencies? The source code will obviously change and having to manually track these dependencies across directories seems awkward.

(file #34771, file #34772)

Rik <rik5>
Project Administrator
Tue 28 Jul 2015 08:33:51 PM UTC, comment #5:

Leaving open for now as in mxe, we are just getting around the problem by doing an explicit build of libgnu, rather than an actual fix of the underlying issue

John Donoghue <lostbard>
Project Member
Tue 28 Jul 2015 08:12:31 PM UTC, comment #4:

It works now. Thanks!

Avinoam Kalma <avinoam>
Project Member
Thu 23 Jul 2015 04:39:37 AM UTC, comment #3:

This build failure can definitely also be demonstrated outside of mxe-octave. I think the top-level Makefile has no rule telling it what steps depend on libgnu now, other than "make all". So it's currently a race condition that libgnu gets built before other steps that need it.

E.g. the following fails if I try to build a specific target rather than "all":

IMHO the fix will be to merge libgnu into the top-level Makefile as an include as well, but I think that might need some work.

Mike Miller <mtmiller>
Project Administrator
Tue 21 Jul 2015 01:28:21 AM UTC, comment #2:

that would be
make -C libgnu

John Donoghue <lostbard>
Project Member
Tue 21 Jul 2015 01:27:50 AM UTC, comment #1:

running make -C linbnu first, before running make for the toplevel circumvents the issue.

It then fails later trying to build the documentation (as it does have a native octave built)

John Donoghue <lostbard>
Project Member
Sun 19 Jul 2015 02:10:47 PM UTC, original submission:

ATtempting to build a current defaut branch octave using mxe-octave.

For octave:

hg tip
changeset: 20368:2f9119bb3fe5
bookmark: @
tag: tip
user: Rik <rik@octave.org>
date: Sat Jul 18 08:56:51 2015 -0700
summary: build: Add EXTRA_DIST files frob libgui/ and test/ to tarball.

Failure is at:

config.log reported that sys/select.h and sys/times.h was not found which is correct for mingw, so I am assuming gnulib will then replace them, however it looks like libgnu is not yet entered to build the files at this point.

John Donoghue <lostbard>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #34771:  build_libgnu.cset added by rik5 (1005B - application/octet-stream)
file #34772:  bad_build.notes added by rik5 (4KiB - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by rik5
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by lostbard (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 01 Jul 2016 05:24:22 PM UTCrik5Severity3 - Normal=>4 - Important
    Mon 01 Feb 2016 03:58:17 AM UTCrik5Dependencies-=>bugs #46964 is dependent
    Sun 30 Aug 2015 11:12:23 PM UTCrik5Attached File-=>Added build_libgnu.cset, #34771
      Attached File-=>Added bad_build.notes, #34772
    Sun 30 Aug 2015 10:39:06 PM UTCrik5Carbon-Copy-=>Added jwe
    Thu 23 Jul 2015 04:39:37 AM UTCmtmillerStatusNone=>Confirmed
      Operating SystemGNU/Linux=>Any
      Summarymxe-octave default-octave build failure=>build failure due to no dependency on libgnu

    Back to the top

    Powered by Savane 3.1-cleanup1