Code Monkey home page Code Monkey logo

Comments (4)

chriswailes avatar chriswailes commented on June 25, 2024

The problem here is that the LLVM shared library is not in the library path. To allow the OS to load your library you need to add it's location to the LD_LIBRARY_PATH environmental variable. It will then search that directory for the necessary .so file. You can add this in your ~/.bashrc file.

The second issue that you will run into is that RLTK requires a specific version of LLVM. At some point in the future it might be possible to allow it to use multiple different versions and enable/disable features based on which library it finds, but right now the RLTK trunk requires LLVM 3.4 (I plan on releasing a new Gem version based on trunk this weekend). Unless you have a very good reason for needing 3.5, I would recommend using 3.4 until LLVM 3.5 is released and RLTK is updated to use it. It will simplify your life considerably.

I hope that helps, and let me know if you have any further questions. If you don't mind me asking, what lexing/parsing libraries are you using?

from rltk.

ravinggenius avatar ravinggenius commented on June 25, 2024

I have LLVM trunk checked out to ~/Code/llvm. These are the exact steps I used to compile LLVM:

mkdir ~/Code/llvm
cd ~/Code/llvm
svn co http://llvm.org/svn/llvm-project/llvm/trunk .

cd tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ..

cd projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
cd ..

mkdir build && cd build
../configure
mkdir ../bin # then i ran this, thinking it would reconfigure, but i don't think it did anything. `~/Code/llvm/bin` dir is empty
../configure --prefix=/Users/thomas/Code/llvm/bin

make
make check-all

I checked ~/Code/llvm/build/Debug+Asserts/bin and ~/Code/llvm/build/Debug+Asserts/lib, but neither directory has any *.so files. What directory needs to be set to $LD_LIBRARY_PATH?

I'm happy to recompile version 3.4, but shouldn't I be able to just $ brew install llvm? (By the way, that also doesn't work; see Homebrew/legacy-homebrew#29733.) If I do have to compile LLVM from source, should I checkout the source into my project or keep it separate? I've never done much with compiled languages, so I appreciate your help.

If you don't mind me asking, what lexing/parsing libraries are you using?

Don't mind at all. I'm using Parslet. It's pretty fantastic. Take a look at my parser or transformer if you'd like to see how I'm using it.

from rltk.

ravinggenius avatar ravinggenius commented on June 25, 2024

I remove LLVM and installed llvm34 via homebrew-version (as suggested by Homebrew/legacy-homebrew#29733). The version I got was 3.4.1, so all the binaries look like llvm-config-3.4.1.

What should I set $LD_LIBRARY_PATH to?

Can I configure something so it works with 3.4.1, or do I need to somehow install the 3.4 version?

from rltk.

chriswailes avatar chriswailes commented on June 25, 2024

So yes, I would recommend using pre-compiled packages. You'll need to make sure that the package includes the shared library (libLLVM3.4.so). Sometime these are separated out into another package, usually along the lines of llvm-libraries. Once you know where that library is located you can add it to LD_LIBRARY_PATH. Usually, if you are using a package manager it should be installed in a directory that is already in the standard search path for libraries.

Any release of LLVM in the 3.4 series will work.

from rltk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.