Issues

Issue #21 closed

Can't build ‘pure’, missed ‘bison-missing’

Viacheslav Lotsmanov
created an issue

Hello. I can't build the ‘pure’:

$ LANG= make
bison-missing -v -o ./parser.cc parser.yy
make: bison-missing: Command not found
make: *** [parser.cc] Error 127

What is ‘bison-missing'? I can't google anything about that. I have ‘bison’ package on my OpenSUSE 13.1 (x86_64), but this package is not provides ‘bison-missing’:

$ LANG= zypper search bison
...
S | Name        | Summary                  | Type   
--+-------------+--------------------------+--------
i | bison       | The GNU Parser Generator | package
  | bison-32bit | The GNU Parser Generator | package

Comments (9)

  1. Albert Graef

    This just indicates that configure couldn't locate bison for some reason. Please post your config.log so that I can try to figure out what went wrong.

  2. Viacheslav Lotsmanov reporter
    $ LANG= bison --version
    bison (GNU Bison) 2.7
    Written by Robert Corbett and Richard Stallman.
    
    Copyright (C) 2012 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
  3. Albert Graef

    Ok, it seems that configure neither finds bison nor flex. That's weird, because you seem to be able to run it from the command line, and then configure should be able to locate it as well. What does which bison and which flex say?

    Are you sure that you reran configure after installing bison and flex?

  4. Viacheslav Lotsmanov reporter

    It's look like I forgot to rerun configure again after installing bison and flex. Now I've run ./configure --prefix=/opt/... again and make and it works without bison or flex errors. Sorry about that.

    But now I have other issue with LLVM

    $ LANG= make
    g++ -o pure -L.  pure.o -lpure  -L/usr/lib64   -lrt -ldl -lpthread -lz -lm -lmpfr -lgmp  -lreadline
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: pure.o: undefined reference to symbol 'LLVMLinkInJIT'
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: note: 'LLVMLinkInJIT' is defined in DSO /usr/lib64/libLLVMJIT.so so try adding it to the linker command line
    /usr/lib64/libLLVMJIT.so: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
    make: *** [pure] Error 1
    

    But it's correct dynamic library file:

    $ cd /usr/lib64/ && env LANG= ls -lah | grep -i libLLVMJIT.so
    -rwxr-xr-x   1 root root  112K Oct 29 15:24 libLLVMJIT.so
    
  5. Albert Graef

    This looks like your LLVM_LIBS is empty, which points to a broken LLVM installation, bad llvm-config, or both. Please post the output from the following commands:

    llvm-config --version
    llvm-config --libdir
    llvm-config --ldflags
    llvm-config --libs jit
    ls /usr/lib/libLLVM*
    

    Also, please attach your generated Makefile and the new config.log.

    One thing that you can try is to add --with-static-llvm to your configure command and see whether that helps.

    If that fails as well, then I'd suggest that you build LLVM 3.3 yourself. This isn't hard. You can find the LLVM 3.3 downloads here: http://llvm.org/releases/download.html#3.3. (LLVM 3.4 should work as well, but its assembler backend seems to be broken on x86 Linux which affects Pure's batch compiler, so I'd recommend to stick to LLVM 3.3 for now.)

    Make sure that you build LLVM with the default prefix (/usr/local) so that it doesn't conflict with your openSUSE LLVM packages. Also make sure that you build it as a shared library (--enable-shared), as described in the INSTALL file, see http://puredocs.bitbucket.org/install.html#quick-summary. This should work. I'm running Pure with a home-built LLVM 3.3 myself, and it builds and works without a hitch for me.

  6. Log in to comment