Coder Social home page Coder Social logo

Comments (5)

tibbe avatar tibbe commented on August 27, 2024 1

It builds now. I had some other gcc on my path and removing that worked.

from llvm-general.

typedrat avatar typedrat commented on August 27, 2024

It requires Cabal 1.24 from my experience.

from llvm-general.

tibbe avatar tibbe commented on August 27, 2024

I've managed to build with cabal:

git clone https://github.com/bscarlet/llvm-general.git
cd llvm-general/
git checkout -b llvm-3.8 origin/llvm-3.8
cd llvm-general/
cabal sandbox init
cabal sandbox add-source ../llvm-general-pure/
cabal install --only-dep
cabal configure --extra-lib-dirs=/usr/local/Cellar/libffi/3.0.13/lib -v
cabal build

This is using GHC 7.10.3 and llvm38 from Homebrew.

from llvm-general.

tibbe avatar tibbe commented on August 27, 2024

I spoke to soon. llvm-general itself can be built and installed but when linking my application I still get problems like these:

Undefined symbols for architecture x86_64:
  "llvm::TargetRegistry::lookupTarget(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)", referenced from:
      _LLVM_General_LookupTarget in libHSllvm-general-3.8.0.0-92hcfz1GLY9CjTAtL9qzyA.a(TargetC.o)
  "llvm::raw_fd_ostream::raw_fd_ostream(llvm::StringRef, std::error_code&, llvm::sys::fs::OpenFlags)", referenced from:
      _LLVM_General_WithFileRawOStream in libHSllvm-general-3.8.0.0-92hcfz1GLY9CjTAtL9qzyA.a(RawOStreamC.o)
  "llvm::Instruction::getAllMetadataImpl(llvm::SmallVectorImpl<std::pair<unsigned int, llvm::MDNode*> >&) const", referenced from:
      _LLVM_General_GetMetadata in libHSllvm-general-3.8.0.0-92hcfz1GLY9CjTAtL9qzyA.a(InstructionC.o)
  "std::__1::error_code::message() const", referenced from:
      _LLVMPrintModuleToFile in libLLVMCore.a(Core.o)
      _LLVMCreateMemoryBufferWithContentsOfFile in libLLVMCore.a(Core.o)
      _LLVMCreateMemoryBufferWithSTDIN in libLLVMCore.a(Core.o)
      llvm::Interpreter::create(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libLLVMInterpreter.a(Interpreter.o)
      llvm::getLazyIRFileModule(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool) in libLLVMIRReader.a(IRReader.o)
      llvm::parseIR(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&) in libLLVMIRReader.a(IRReader.o)
      llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&) in libLLVMIRReader.a(IRReader.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
      llvm::Module::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const in libLLVMCore.a(AsmWriter.o)

I'm guessing the the application itself also needs to play games with extraLibs and ccOptions to make things link?

from llvm-general.

tibbe avatar tibbe commented on August 27, 2024

Having to go through this again on a new machine I can confirm that building llvm-general works if you:

  • Are on macOS Sierra.
  • Use stack with resolver: lts-6.20 (which uses GHC 7.10.3)
  • Depend on llvm-general == 3.8.0.*
  • brew install [email protected]
  • Use the system gcc (mine is Apple LLVM version 8.0.0 (clang-800.0.42.1)).
  • Add extra-lib-dirs: [/usr/local/Cellar/libffi/3.0.13/lib] to ~/.stack/config.yaml.
  • Just in case, make sure you are using the latest stack (1.3.2 in my case) and run stack setup in your project dir.

from llvm-general.

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.