morganstanley / hobbes

A language and an embedded JIT compiler

Home Page:http://hobbes.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support different llvm versions

smunix opened this issue · comments

Let’s do it! 😄

Do you want to start a branch (initially broken) with the first new desired LLVM version set?

So, we've got this new branch fix.llvm-compat for this.

I broke the build on llvm@80 (see commit 5f9d1f28292079660f9093f7e6d048133841bf4e)

You can update that line with the required version if you'd like to experiment with a different version.

So, we've got this new branch fix.llvm-compat for this.

https://github.com/Morgan-Stanley/hobbes/tree/fix.llvm-compat

It looks like that change looks for LLVM 8, but are you installing it manually? Maybe we can make a new travis-ci target.

Looks like I can't push changes to this branch, no permission. I have a local change to add a travis-ci target for LLVM 8 builds.

I think you made some cmake changes recently, maybe this error makes sense to you:

CMake Error at CMakeLists.txt:11 (find_package):
  Could not find a configuration file for package "LLVM" that is compatible
  with requested version "8.0".

  The following configuration files were considered but not accepted:

    /usr/local/opt/llvm@8/share/cmake/modules/llvm-config.cmake, version: unknown

That's what I get trying to run cmake on the LLVM cmake scripts installed with 'brew install llvm@8' on my laptop.

what does brew info say ? Below is what I get on mine :

smunix@smunix:~/Programming/tests/hobbes|(fix.llvm-compat⚡)
⇒ brew info llvm
llvm: stable 8.0.0 (bottled), HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
/usr/local/Cellar/llvm/8.0.0 (5,631 files, 3GB)
Built from source on 2019-03-23 at 07:32:06
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/llvm.rb
==> Dependencies
Build: cmake ✘
Required: libffi ✔, swig ✘
==> Requirements
Build: xcode ✔
==> Options
--HEAD
Install HEAD version

I'm able to run this :

smunix@smunix:~/Programming/tests/hobbes/l80|(fix.llvm-compat⚡)
⇒ cmake -DLLVM_DIR=/usr/local/Cellar/llvm/8.0.0/lib/cmake/llvm .. && make -j3
-- Found LLVM 8.0.0
-- Using LLVMConfig.cmake in: /usr/local/Cellar/llvm/8.0.0/lib/cmake/llvm
-- LLVM_INCLUDE_DIRS=/usr/local/Cellar/llvm/8.0.0/include
-- LLVM_DEFINITIONS=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- SYSTEM_PROCESSOR x86_64
-- Compiling on APPLE platform

I'm away from the machine where I was testing last night, but if you're able to get cmake to run this way, could you add the job to .travis.yml so it runs as part of the automated build? I tried to do that last night too, but was blocked by permissions issues.

Maybe the problem is the cmake version? I get this:

$ LLVM_DIR=/usr/local/opt/llvm@8/share/cmake/modules cmake ~/hobbes/
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Found LLVM
-- Using LLVMConfig.cmake in: /usr/local/opt/llvm@8/share/cmake/modules
-- LLVM_INCLUDE_DIRS=
-- LLVM_DEFINITIONS=
-- SYSTEM_PROCESSOR x86_64
-- Compiling on APPLE platform
-- CMAKE_CXX_FLAGS=-O3 -DNDEBUG -Wall -frtti -Wno-sign-compare -Wno-delete-non-virtual-dtor -fexceptions
-- CMAKE_CXX_FLAGS_DEBUG=-frtti -O0 -g3 -Wall -Wno-sign-compare -Wno-delete-non-virtual-dtor -fexceptions
-- CMAKE_CXX_FLAGS_RELEASE=-frtti -DNDEBUG -O2 -Wall -Wno-sign-compare -Wno-delete-non-virtual-dtor -fexceptions
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO=-frtti -DNDEBUG -O2 -g3 -Wall -Wno-sign-compare -Wno-delete-non-virtual-dtor -fexceptions
CMake Error at CMakeLists.txt:43 (if):
  if given arguments:

    "VERSION_LESS" "3.6"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:151 (with_llvm_config)


-- Configuring incomplete, errors occurred!
$ cmake --version
cmake version 3.8.2

try this instead ?

 $ export LLVM_DIR=/usr/local/opt/llvm@8/share/cmake/modules 
 $ cmake ~/hobbes/

btw, you're probably right ... I'm using a newer version of cmake instead:

Linux => cmake version 3.14.4
Mac OS => cmake version 3.14.0

I upgraded cmake via brew (just has the latest cmake version 3.15), and still I get the same error messages:

$ LLVM_DIR=/usr/local/opt/llvm@8/share/cmake/modules /usr/local/Cellar/cmake/3.15.0/bin/cmake ~/hobbes/
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
CMake Error at CMakeLists.txt:11 (find_package):
  Could not find a configuration file for package "LLVM" that is compatible
  with requested version "8.0".

  The following configuration files were considered but not accepted:

    /usr/local/opt/llvm@8/share/cmake/modules/llvm-config.cmake, version: unknown

-- Configuring incomplete, errors occurred!

That points to the find_package(LLVM 8.0 REQUIRED CONFIG) line you added. If I remove the 8.0 bit then I get the other error message I mentioned earlier.

I guess something changed here in the build setup and my LLVM_DIR passing does nothing?

If this path is a hassle, maybe it would be easier to get travis-ci set up to build with this version? I don't have permission to modify this branch, so I'm kind of cut out at this point.

closing this, as it's fixed somehow with #380