src/ dir re-organization complete ... for now

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

src/ dir re-organization complete ... for now

Rik-4
8/3/12

All,

We're finally over the waterfall and through the rapids and the code stream
should be getting calmer now.  There are still some build issues to
resolve, but I don't think we'll see quite as much thrash in the source
tree as happened this week.  The build system is working for in-tree and
out-of-tree builds and 'make check' passes the same number of tests as it
did before.

Open issues:

1) autogen.sh no longer seems to terminate properly.  I think this is
related to the recent gnulib update because the last command it starts is
build-aux/bootstrap.sh.  I never see the last commands of autogen.sh such
as 'echo "replacing all occurrences of g77 with gfortran in configure
script..."'.

2) We may want to consider introducing an octave namespace.  While moving
the code around I found that there are many instances of "::function (...)"
where there is no namespace qualifier because the code author is trying to
pick up the global function definition.  This caused the compilation to
fail until I re-ordered the include flags (-IXXX) to put gnulib after
Octave's own sources.  It wasn't previously a problem because the variable
DEFAULT_INCLUDES has '-I.' and all of Octave's source was mostly in the one
current directory.

3) I went overboard in including files for compilation.  From the file
src/Makefile.am you can see that I added everything including the kitchen
sink in AM_CPPFLAGS.  (That's an idiomatic phrase I'm sure the Europeans
are going to squint at.)

## Search local directories before those specified by the user.
AM_CPPFLAGS = \
  -I$(top_srcdir)/libcruft/misc \
  -I../liboctave -I$(top_srcdir)/liboctave \
  -Ioctave-value -I$(srcdir)/octave-value \
  -Iparse-tree -I$(srcdir)/parse-tree \
  -Ioperators -I$(srcdir)/operators \
  -Iinterp-core -I$(srcdir)/interp-core \
  -Iinterpfcn -I$(srcdir)/interpfcn \
  -Icorefcn \
  -I. -I$(srcdir) \
  -I../libgnu -I$(top_srcdir)/libgnu \
  @CPPFLAGS@

This list can and should be pared down if possible.

4) I don't think we need to include CPPFLAGS in AM_CPPFLAGS.  If I look at
the Makefiles that get generated I see the following rule for a C++ file

COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

As you can see, Automake already adds any user flags on its own.  This
would possibly explain why I tend to see my personal flag options come up
as many as 3 times in the compilation of a single file.

5) Anyone who wants to tweak the allocation of files to directories is
welcome.  I only did a rough cut.  I'm thinking of the debug code for
breakpoints, etc.  I think it would be useful to rename files to something
clearer if any changes happen.  For example, pt-bp.cc would become
debug-bp.cc or some such name.

6) Experiment with a way to eliminate the template-inst/ directory.

7) Experiment with having some of the subdirectories be convenience
libraries.  Right now only corefcn/ is a convenience library.  I didn't
make the others convenience libraries because it adds an extra step of
linking to create a library file in the subdirectory and then re-linking
liboctinterp with the newly created convenience library.  This didn't seem
to save time over simply giving the list of object files in the
subdirectory to Make and re-linking liboctinterp.

--Rik


Reply | Threaded
Open this post in threaded view
|

Re: src/ dir re-organization complete ... for now

Michael Goffioul
On Fri, Aug 3, 2012 at 10:34 PM, Rik <[hidden email]> wrote:
7) Experiment with having some of the subdirectories be convenience
libraries.  Right now only corefcn/ is a convenience library.  I didn't
make the others convenience libraries because it adds an extra step of
linking to create a library file in the subdirectory and then re-linking
liboctinterp with the newly created convenience library.  This didn't seem
to save time over simply giving the list of object files in the
subdirectory to Make and re-linking liboctinterp.

This is normal because of the way libtool works: first it extract all object files from the convenience library, then it add all extracted object files to the link command.

Michael.

Reply | Threaded
Open this post in threaded view
|

Re: src/ dir re-organization complete ... for now

Michael Goffioul
In reply to this post by Rik-4
On Fri, Aug 3, 2012 at 10:34 PM, Rik <[hidden email]> wrote:
8/3/12

All,

We're finally over the waterfall and through the rapids and the code stream
should be getting calmer now.  There are still some build issues to
resolve, but I don't think we'll see quite as much thrash in the source
tree as happened this week.  The build system is working for in-tree and
out-of-tree builds and 'make check' passes the same number of tests as it
did before.

I noticed that files in corefcn are compiled twice. Once for the convenience library corefcn, once for liboctinterp.la. This is due to corefcn source files being explicitly added to the source list for liboctinterp.la, through DIST_SRC. Is this expected?

Michael.

Reply | Threaded
Open this post in threaded view
|

Re: src/ dir re-organization complete ... for now

John W. Eaton
Administrator
On  4-Aug-2012, Michael Goffioul wrote:

| I noticed that files in corefcn are compiled twice. Once for the convenience
| library corefcn, once for liboctinterp.la. This is due to corefcn source files
| being explicitly added to the source list for liboctinterp.la, through
| DIST_SRC. Is this expected?

No, the files should definitely not be compiled twice.

jwe

Reply | Threaded
Open this post in threaded view
|

src/ dir re-organization complete ... for now

John W. Eaton
Administrator
In reply to this post by Rik-4
On  3-Aug-2012, Rik wrote:

| 1) autogen.sh no longer seems to terminate properly.  I think this is
| related to the recent gnulib update because the last command it starts is
| build-aux/bootstrap.sh.  I never see the last commands of autogen.sh such
| as 'echo "replacing all occurrences of g77 with gfortran in configure
| script..."'.

It looks like bootstrap script is exiting with a status of 1, so the
set -e in the autogen.sh script forces it to exit there instead of
continuing.

I'm not sure why bootstrap is suddenly exiting with a nonzero status.

jwe
Reply | Threaded
Open this post in threaded view
|

Re: src/ dir re-organization complete ... for now

Mike Miller
On Sat, Aug 04, 2012 at 06:22:19PM -0400, John W. Eaton wrote:

> On  3-Aug-2012, Rik wrote:
>
> | 1) autogen.sh no longer seems to terminate properly.  I think this is
> | related to the recent gnulib update because the last command it starts is
> | build-aux/bootstrap.sh.  I never see the last commands of autogen.sh such
> | as 'echo "replacing all occurrences of g77 with gfortran in configure
> | script..."'.
>
> It looks like bootstrap script is exiting with a status of 1, so the
> set -e in the autogen.sh script forces it to exit there instead of
> continuing.
>
> I'm not sure why bootstrap is suddenly exiting with a nonzero status.

I just looked into this, it's the recent update to gnulib, the missing
script is no longer part of gnulib:

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=d0f486f09869cad33c4a7039d88e45fedd815c23

I copied gnulib/build-aux/bootstrap, reapplied ecf0c6bca0c9, and it
works again for me.

--
mike
Reply | Threaded
Open this post in threaded view
|

Re: bootstrap script does not complete

Rik-4
On 08/05/2012 02:29 PM, Mike Miller wrote:

> On Sat, Aug 04, 2012 at 06:22:19PM -0400, John W. Eaton wrote:
>> On  3-Aug-2012, Rik wrote:
>>
>> | 1) autogen.sh no longer seems to terminate properly.  I think this is
>> | related to the recent gnulib update because the last command it starts is
>> | build-aux/bootstrap.sh.  I never see the last commands of autogen.sh such
>> | as 'echo "replacing all occurrences of g77 with gfortran in configure
>> | script..."'.
>>
>> It looks like bootstrap script is exiting with a status of 1, so the
>> set -e in the autogen.sh script forces it to exit there instead of
>> continuing.
>>
>> I'm not sure why bootstrap is suddenly exiting with a nonzero status.
> I just looked into this, it's the recent update to gnulib, the missing
> script is no longer part of gnulib:
>
> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=d0f486f09869cad33c4a7039d88e45fedd815c23
>
> I copied gnulib/build-aux/bootstrap, reapplied ecf0c6bca0c9, and it
> works again for me.
>
8/6/12

Mike,

I followed your suggestion and updated the bootstrap script which we
maintain under Mercurial control and only occasionally update from gnulib.
The changeset is here
(http://hg.savannah.gnu.org/hgweb/octave/rev/718bed882d3e).  This fixes the
problem for me.

For others updating past this changeset, it isn't strictly necessary but I
found clearing the cruft in the build-aux directory prevented one warning
message and updated the install-sh script to the latest version.  I used
the following commands to eliminate cruft and rebuild.

cd build-aux
hg stat -i -n | xargs rm
cd ..
./autogen.sh
./configure
make

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: bootstrap script does not complete #2

Rik-4
In reply to this post by Mike Miller
Oops.  I missed a '*' in the command.  I've updated the command list for
removing cruft.

For others updating past this changeset, it isn't strictly necessary but I
found clearing the cruft in the build-aux directory prevented one warning
message and updated the install-sh script to the latest version.  I used
the following commands to eliminate cruft and rebuild.

cd build-aux
hg stat -i -n * | xargs rm
cd ..
./autogen.sh
./configure
make

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: bootstrap script does not complete #2

bpabbott
Administrator
On Aug 6, 2012, at 1:22 PM, Rik wrote:

> Oops.  I missed a '*' in the command.  I've updated the command list for
> removing cruft.
>
> For others updating past this changeset, it isn't strictly necessary but I
> found clearing the cruft in the build-aux directory prevented one warning
> message and updated the install-sh script to the latest version.  I used
> the following commands to eliminate cruft and rebuild.
>
> cd build-aux
> hg stat -i -n * | xargs rm
> cd ..
> ./autogen.sh
> ./configure
> make
>
> --Rik

autogen.sh is working for me again!

Ben

Reply | Threaded
Open this post in threaded view
|

Re: bootstrap script does not complete

Jordi Gutiérrez Hermoso-2
In reply to this post by Rik-4
On 6 August 2012 13:19, Rik <[hidden email]> wrote:
> hg stat -i -n | xargs rm

Btw, I wanted to say, if you're typing the above frequently, consider:

    http://mercurial.selenic.com/wiki/PurgeExtension

Like yourus, it's a dangerous command, so, the usual cultural caveats
about dangerous hg commands apply.

HTH,
- Jordi G. H.