octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Rik
Subject: src/ dir re-organization complete ... for now
Date: Fri, 03 Aug 2012 14:34:06 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]