bugGNU Octave - Bugs: bug #50398, jit no longer compiles with Octave...

 
 

bug #50398: jit no longer compiles with Octave 4.2.1

Submitted by:  Ceral Paquet <octavebugs>
Submitted on:  Sat 25 Feb 2017 01:05:52 PM UTC  
 
Category: Configuration and Build SystemSeverity: 2 - Minor
Priority: 3 - LowItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.1Operating System: GNU/Linux

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)

Thu 14 Dec 2017 04:34:09 PM UTC, comment #16:

The workaround is simple: don't compile with the JIT compiler. It never grew out of the toy implementation and doesn't compile anything but toy examples.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu 14 Dec 2017 03:23:51 PM UTC, comment #15:

I have this problem when compiling Octave 4.2.1 from source on CentOS 7.4. I use the following configure options:

My LLVM version is 3.4.2, so according to the previous comment it should build without an error, but it doesn't.

I have the following error:

It would be good to have this bug re-opened or at list get a link where it is explained how to workaround this issue. Thank you!

Yury <scrutari>
Thu 02 Mar 2017 08:01:29 PM UTC, comment #14:

Verified that a normal build with llvm3.4 works and that the JIT is functional within Octave. Closing report.

Rik <rik5>
Project Administrator
Thu 02 Mar 2017 07:52:40 PM UTC, comment #13:

Sorry for the fuss. It was a dual installation of llvm 3.4 and 3.6 that was the problem. It was picking up bits from both installs that was the issue.

Rik <rik5>
Project Administrator
Thu 02 Mar 2017 07:51:41 PM UTC, comment #12:

The functions DO seem to be in the library

I tried setting the environment variables as you suggested, but it still fails to link.

I looked and "-lLLVM-3.4" is in the link command above.

Also, this is a NEEDED library.

Rik <rik5>
Project Administrator
Thu 02 Mar 2017 07:26:28 PM UTC, comment #11:

The functions llvm::verifyFunction and llvm::verifyModule are declared in the public header file "llvm/IR/Verifier.h", so I don't know why they would not be declared in the library as regular public symbols.

Running "nm -D /usr/lib/llvm-3.4/lib/libLLVM-3.4.so | c++filt | grep verify" should help clarify whether the symbols are exported by that library properly.

Mike Miller <mtmiller>
Project Administrator
Thu 02 Mar 2017 07:19:27 PM UTC, comment #10:

Ok, if you want to try to force linking, try

This should put "-lLLVM-3.4" at the end of the command, with "-lutil -lm", which is where it needs to be to be useful.

Still, can you also verify that liboctinterp.so has libLLVM-3.4.so.1 in its header? It should show up in this list in your build directory:

Mike Miller <mtmiller>
Project Administrator
Thu 02 Mar 2017 07:12:25 PM UTC, comment #9:

I cleared things with 'make distclean' and then re-configured after setting my environment variables to

As you can see below, the link still fails despite the fact that the library and directory are included in the path.

Is the verifyModule only included if I use '-g' somehow?

Rik <rik5>
Project Administrator
Thu 02 Mar 2017 06:40:26 PM UTC, comment #8:

I think that's right. In Debian's llvm-3.8-dev package, both shared and static libraries are included. Probably because the API is so unstable, they intentionally give users the option to link with either the shared library or the modular static libraries.

Octave should prefer the shared library, LLVM_LIBS should be set to "-lLLVM-3.4", and liboctinterp.so should be pulling it in when octave-cli is linked.

Mike Miller <mtmiller>
Project Administrator
Thu 02 Mar 2017 06:14:13 PM UTC, comment #7:

I re-titled the bug report to track the new issue.

I installed all of what appeared to be llvm3.4 packages.

If I look in /usr/lib/llvm-3.4/lib I find libLLVM-3.4.so, but there are also 122 .a files. I'm not sure why that should be.

Rik <rik5>
Project Administrator
Thu 02 Mar 2017 04:57:47 PM UTC, comment #6:

May as well pursue the llvm build problems here if you think it's worth it.

The error is strange because liboctinterp is supposedly linked against LLVM_LIBS.

Did you install llvm 3.4 as static or shared libraries? The liboctinterp.la file should list a reference to llvm in the dependency_libs variable, and liboctinterp.so should list it in its header as a NEEDED library.

Mike Miller <mtmiller>
Project Administrator
Thu 02 Mar 2017 04:30:08 PM UTC, comment #5:

@Mike: I committed your patch to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/c21939b04931). I was able to install llvm3.4 and verify that without the patch I get the octave_jit_octave error, and with the patch it compiles fine.

It still doesn't work completely. I now have a fail at the link stage, but that is a different error.

Probably Octave is not using the correct LDFLAGS because the two mentioned functioned are available and declared in the header files.

Do we want to re-purpose this bug report to JIT not compiling on 4.2.1 or should we open a new one?

Rik <rik5>
Project Administrator
Wed 01 Mar 2017 09:27:04 PM UTC, comment #4:

Ceral - does this patch work for you?

(file #39873)

Mike Miller <mtmiller>
Project Administrator
Wed 01 Mar 2017 09:24:25 PM UTC, comment #3:

I think this change

https://hg.savannah.gnu.org/hgweb/octave/diff/d0562b3159c7/libinterp/corefcn/jit-typeinfo.cc

was an overzealous search and replace. I think the parts that renamed "octave_jit_err_nan_to_logical_conversion" to "octave_jit_octave::err_nan_to_logical_conversion" should be undone. Unfortunately I don't have an ancient version of llvm to try to compile the stable branch against.

Mike Miller <mtmiller>
Project Administrator
Sat 25 Feb 2017 11:02:28 PM UTC, comment #2:

If you are using a version of llvm > 3.4, then this is probably a duplicate of bug #41061 (failure to compile jit with llvm3.5).

Rik <rik5>
Project Administrator
Sat 25 Feb 2017 10:47:38 PM UTC, comment #1:

Does this work for 4.2.0 (mine doesn't)?

What version of llvm do you have installed?

Can you post more of the compilation log made with

for extra verbosity?

Rik <rik5>
Project Administrator
Sat 25 Feb 2017 01:05:52 PM UTC, original submission:

I get an error during compilation of 4.2.1:

./configure --enable-jit
make

error: ‘octave_jit_octave’ has not been declared

Ceral Paquet <octavebugs>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #39873:  jit.diff added by mtmiller (828B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by scrutari (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by octavebugs (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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Mar 2017 08:01:29 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 02 Mar 2017 06:14:39 PM UTCrik5Severity3 - Normal=>2 - Minor
      Priority5 - Normal=>3 - Low
      StatusNeed Info=>Confirmed
    Thu 02 Mar 2017 06:14:13 PM UTCrik5Summaryerror: ‘octave_jit_octave’ has not been declared=>jit no longer compiles with Octave 4.2.1
    Thu 02 Mar 2017 04:36:31 PM UTCrik5CategoryNone=>Configuration and Build System
      Item GroupNone=>Regression
    Wed 01 Mar 2017 09:27:04 PM UTCmtmillerAttached File-=>Added jit.diff, #39873
    Sat 25 Feb 2017 10:47:38 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1