bugGNU Octave - Bugs: bug #45644, Build system distributes .cc files...

 
 

bug #45644: Build system distributes .cc files in include/octave directory

Submitter:  Rik <rik5>
Submitted:  Tue 28 Jul 2015 05:13:17 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 11 Nov 2021 08:21:34 PM UTC, comment #6: 

Looking at old bug reports...

Except for graphics-props.cc, these files all define template functions and are included in the corresponding header files to provide complete definitions so that instantiation of the templates are possible.  The functions could also just be provided inside the header files but that could make the header files somewhat harder to understand.

In the GNU libstdc++ header files, these kinds of files use the extension '.tcc' instead of '.cc' and the '.tcc' files are unconditionally included in the corresponding header file (so <string> includes both <bits/basic_string.h> and <bits/basic_string.tcc>).  In the '.tcc' file, there may be 'extern template FOO<TYPE>' declarations for templates that are explicitly instantiated elsewhere, presumably to help speed up compiling.  Maybe we could do something similar?

The following change works for me to prevent graphics-props.cc from being installed:

http://hg.savannah.gnu.org/hgweb/octave/rev/4730becad0b1

I'm closing this report as fixed.  I propose we discuss possible rearrangement of header files elsewhere.


John W. Eaton <jwe>
Group administrator
Fri 12 Aug 2016 10:58:40 PM UTC, comment #5: 

Re-visiting this bug.  The install process now installs many fewer .cc files.  The list is


Array.cc
bsxfun-defs.cc
DiagArray2.cc
graphics-props.cc
intNDArray.cc
MArray.cc
MDiagArray2.cc
MSparse.cc
mx-inlines.cc
oct-sort.cc
Sparse.cc


Still, the question remains why any get installed at all since I was able to compile files with mkoctfile that presumably used at least the header files.

Rik <rik5>
Group administrator
Wed 29 Jul 2015 06:02:13 PM UTC, comment #4: 

I don't know that the exact criteria is because I don't know when these files would be used.  The definition of OCTAVE_API might be one, but I notice that even things like Array.h don't use OCTAVE_API and I'm pretty sure that needs to be exported.

I tried grep'ing for template as another criteria.  graphics-props.cc does not have any templates or #defines and therefore looks like it doesn't need export.

Rik <rik5>
Group administrator
Tue 28 Jul 2015 11:46:47 PM UTC, comment #3: 

Btw none of these files are new, I have the same set of cc files in my 3.8.2 include directory.

But I agree with Rik it would be good to clean up what we're installing in include to try to make sure nothing extraneous is in there, but still supports whatever is considered the public API.

As a first order guess, should it be safe to delete any files that don't use the OCTAVE_API declaration?

Mike Miller <mtmiller>
Group Member
Tue 28 Jul 2015 07:44:27 PM UTC, comment #2: 

@jwe: I thought there might be a use case for these files, but the examples I tried in examples/code all compiled with mkoctfile despite having deleted these *.cc files.

What is the use case for these files?  Is it someone writing C++ and linking in liboctave?  Is there example code that I could have tried that would have exercised this?

It seems to me that we might need some examples for using liboctave directly in C++.

Rik <rik5>
Group administrator
Tue 28 Jul 2015 06:35:09 PM UTC, comment #1: 

I think all but one of these files are templates or macros that must be available in order to instantiate new templates of different types.

The only one that looks suspicious to me is kpse.cc.  For that, I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/4bde15a9c8bb

John W. Eaton <jwe>
Group administrator
Tue 28 Jul 2015 05:13:17 PM UTC, original submission:  

The build system distributes necessary files for using mkoctfile in the include/octave directory.  For the most part these are header files for the libraries liboctave and liboctinterp.

However, the distribution also includes a number of C++ .cc files.  These seem unneccessary and probably an indication that the Autotools build rules are not correct. 

The list of files is:


Array.cc
base-lu.cc
base-qr.cc
bsxfun-defs.cc
DiagArray2.cc
eigs-base.cc
graphics-props.cc
intNDArray.cc
kpse.cc
MArray.cc
MDiagArray2.cc
MSparse.cc
mx-inlines.cc
oct-sort.cc
op-dms-template.cc
op-dm-template.cc
op-pm-template.cc
ov-base-diag.cc
ov-base-int.cc
ov-base-mat.cc
ov-base-scalar.cc
ov-bool-mat.cc
sparse-base-chol.cc
sparse-base-lu.cc
Sparse.cc
sparse-dmsolve.cc



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-11 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code