bugGNU Octave - Bugs: bug #55381, mkoctfile --link-stand-alone no...

 
 

bug #55381: mkoctfile --link-stand-alone no longer links with liboctinterp

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Fri 04 Jan 2019 09:30:24 AM UTC  
 
Category:  Configuration and Build System Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  5.0.1 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sat 05 Jan 2019 06:21:06 PM UTC, comment #4: 

Works for me now, thank you.

Mike Miller <mtmiller>
Project Administrator
Sat 05 Jan 2019 02:49:46 PM UTC, comment #3: 

I pushed a fix for this here https://hg.savannah.gnu.org/hgweb/octave/rev/ff6c90eb6f2d.

Try any cset after ff6c90eb6f2d.

Rik <rik5>
Project Administrator
Fri 04 Jan 2019 08:59:50 PM UTC, comment #2: 

Yeah, to be complete, the options that are missing are

-L$OCTAVE_HOME/lib/octave/$OCTAVE_VERSION -loctinterp -loctave

Building the program with

mkoctfile --link-stand-alone foo.cc -L$OCTAVE_HOME/lib/octave/$OCTAVE_VERSION -loctinterp -loctave

works.

These are the pieces that we intentionally removed when building oct files, but they need to be kept in place for linking standalone programs with mkoctfile.

Your patch looks like a good start.

Mike Miller <mtmiller>
Project Administrator
Fri 04 Jan 2019 05:50:14 PM UTC, comment #1: 

Confirmed.  Attached is a diff that could take care of this one issue.  However, it isn't the full solution because the example of standalone.cc still does not compile.  The link command also needs -LOCTLIBDIR.  Maybe this mean more thinking is needed.

(file #45867)

Rik <rik5>
Project Administrator
Fri 04 Jan 2019 09:30:24 AM UTC, original submission:  

When building oct files, we don't link with -loctinterp and -loctave by default now, which is good. But we lost the link with these libraries for standalone programs at the same time, this needs to be restored.

Example:

$ cp examples/code/standalone.cc foo.cc
$ mkoctfile --link-stand-alone foo.cc
/usr/bin/ld: /tmp/oct-3DGEBG.o: in function `main':
/opt/gnu/octave/include/octave-5.0.1/octave/../octave/Array.h:264: undefined reference to `dim_vector::safe_numel() const'
/usr/bin/ld: /tmp/oct-3DGEBG.o: in function `main':
/home/mike/src/octave/stable/+build-stable/foo.cc:16: undefined reference to `operator<<(std::ostream&, Matrix const&)'
/usr/bin/ld: /tmp/oct-3DGEBG.o:(.data.rel.ro._ZTV5ArrayIdE[_ZTV5ArrayIdE]+0x20): undefined reference to `Array<double>::resize_fill_value() const'
/usr/bin/ld: /tmp/oct-3DGEBG.o:(.data.rel.ro._ZTV6MArrayIdE[_ZTV6MArrayIdE]+0x20): undefined reference to `Array<double>::resize_fill_value() const'
/usr/bin/ld: /tmp/oct-3DGEBG.o:(.data.rel.ro._ZTV7NDArray[_ZTV7NDArray]+0x20): undefined reference to `Array<double>::resize_fill_value() const'
/usr/bin/ld: /tmp/oct-3DGEBG.o:(.data.rel.ro._ZTV6Matrix[_ZTV6Matrix]+0x20): undefined reference to `Array<double>::resize_fill_value() const'
collect2: error: ld returned 1 exit status

Mike Miller <mtmiller>
Project Administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45867:  55381.diff added by rik5 (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-05 mtmiller StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-01-05 rik5 StatusConfirmed => Ready For Test
    2019-01-04 mtmiller StatusNone => Confirmed
    2019-01-04 rik5 Attached File- => Added 55381.diff, #45867
    2019-01-04 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top


    Powered by Savane 3.5