New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCJIT Support #3367

Merged
merged 9 commits into from May 5, 2016

Conversation

Projects
None yet
3 participants
@YorickPeterse
Member

YorickPeterse commented Mar 28, 2015

This is still very much a work in progress, currently in the early stages.

@YorickPeterse

This comment has been minimized.

Member

YorickPeterse commented Mar 28, 2015

Currently it seems LLVM is trying to set itself up as being 32bits instead of 64bits, this leads to it trying ot load /usr/include/llvm/Config/llvm-config-32.h which doesn't exist on my system:

2: CXX vm/builtin/immediates.cpp
2: CXX vm/builtin/integer.cpp
2: CXX vm/builtin/io.cpp
2: CXX vm/builtin/iseq.cpp
rake aborted!
Errno::ENOENT: No such file or directory - unable to find file to include: llvm-config-32.h from /usr/include/llvm/Config/llvm-config.h
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:161:in `expand_filename'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:165:in `execute'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `block in execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `each'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:235:in `execute'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `block in execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `each'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:175:in `execute'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `block in execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `each'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `execute_body'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:215:in `execute'
/home/yorickpeterse/.gem/ruby/2.2.1/gems/daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb:71:in `block in execute_body'
@YorickPeterse

This comment has been minimized.

Member

YorickPeterse commented Mar 28, 2015

Interesting enough this error still occurs when configuring and compiling using --disable-llvm.

@YorickPeterse YorickPeterse added the JIT label Mar 28, 2015

@YorickPeterse YorickPeterse self-assigned this Mar 28, 2015

@nidev

This comment has been minimized.

nidev commented Mar 31, 2015

I got same error. My configuration option is only '--prefix'.

#include <bits/wordsize.h>
#include <iostream>

int main() { std::cout << (int) (__WORDSIZE) << std::endl; }

But this says 64 for me with both GCC and Clang. Using MRI 2.2.1 (to build rubinius) and clang 3.6. Here is build log made with 'rake build --trace': err.log

I just wanted to know what happened in there. So I modified daedalus-core-0.2.0/lib/daedalus/dependency_grapher.rb like this, to print out some information:

--- dependency_grapher.rb.orig  2015-03-31 16:42:37.257102432 +0900
+++ dependency_grapher.rb   2015-03-31 16:36:32.770439877 +0900
@@ -145,6 +145,7 @@
     end

     def expand_filename(node)
+      puts ">> node:#{node} @name: #{@name}"
       return if File.exist? @name

       @parser.directories.each do |dir|

Lines above Errno::ENOENT are interesting:

>> node:#<Daedalus::DependencyGrapher::SourceFile:0x007fb5280174c8> @name: llvm/state.hpp
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb528027620> @name: /home/nidev/rubinius/vm/config.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb528027620> @name: /usr/include/llvm/ExecutionEngine/MCJIT.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb52409af20> @name: /usr/include/llvm/ExecutionEngine/ExecutionEngine.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb533ee79c0> @name: /usr/include/llvm-c/ExecutionEngine.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb5240b3c50> @name: /usr/include/llvm-c/Core.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb533eca5a0> @name: /usr/include/llvm-c/Support.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb5240f5da8> @name: /usr/include/llvm/Support/DataTypes.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb5240b3c50> @name: /usr/include/llvm-c/Target.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb533eca208> @name: /usr/include/llvm-c/Core.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb533eca208> @name: /usr/include/llvm/Config/llvm-config.h
>> node:#<Daedalus::DependencyGrapher::IncludedFile:0x007fb524112930> @name: llvm-config-32.h
rake aborted!
Errno::ENOENT: No such file or directory - unable to find file to include: llvm-config-32.h from /usr/include/llvm/Config/llvm-config.h

I don't have enough knowledge on daedalus-core (only knows a build system for rubinius) though, wonder what brought this to llvm-config-32.h. Possibly, FileParser in daedalus-core failure? the header files in 3.5 and 3.6 look like this gist.

@nidev

This comment has been minimized.

nidev commented Apr 10, 2015

I made PR to get over the problem with daedalus-core. It worked for me and 'rake build' shows different error during build. After applying it, different error appeared.

(omitted above logs)
Running 198 tasks using 3 parallel threads
2: CXX vm/builtin/access_variable.cpp
3: CXX vm/arguments.cpp
4: CXX vm/accessor_primitives.cpp
3: CXX vm/builtin/alias.cpp
2: CXX vm/builtin/array.cpp
3: CXX vm/builtin/atomic.cpp
2: CXX vm/builtin/autoload.cpp
3: CXX vm/builtin/basic_object.cpp
2: CXX vm/builtin/bignum.cpp
3: CXX vm/builtin/block_as_method.cpp
2: CXX vm/builtin/block_environment.cpp
3: CXX vm/builtin/byte_array.cpp
4: CXX vm/builtin/call_custom_cache.cpp
4: CXX vm/builtin/call_site.cpp
3: CXX vm/builtin/call_unit.cpp
In file included from vm/builtin/block_environment.cpp:24:
/home/nidev/rubinius/vm/llvm/state.hpp:34:10: fatal error: 'llvm/CodeGen/MachineCodeInfo.h' file not found
#include <llvm/CodeGen/MachineCodeInfo.h>
         ^
1 error generated.
Error: clang++ -I/home/nidev/rubinius/vm -I/home/nidev/rubinius/vm/include -I/home/nidev/rubinius/vm/builtin -I. -Ivm/test/cxxtest -I/home/nidev/rubinius/vendor/udis86 -I/home/nidev/rubinius/vendor/libffi/include -Ivendor/double-conversion/src -DHAVE_CONFIG_H -I/home/nidev/rubinius/vm/include/capi -I/home/nidev/rubinius/vendor/oniguruma -I/home/nidev/rubinius/vendor/libtommath -pipe -Wall -fno-omit-frame-pointer -g -mno-omit-leaf-frame-pointer -fPIC  -O2 -DHAS_EXECINFO -DHAVE_SPT_REUSEARGV -DHAVE_CLOCK_GETTIME -DHAVE_NL_LANGINFO -DHAVE_POSIX_FADVISE -DHAVE_STRNLEN -DHAVE_TIMERFD -DHAVE_INOTIFY -DHAVE_TM_GMTOFF -DHAVE_TM_ZONE -DHAVE_TIMEZONE -DHAVE_TZNAME -DHAVE_DAYLIGHT -DHAVE_ALLOCA_H -DHAVE_STRING_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TIMES_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTRERROR_R_CHAR_P -I/usr/include -I/usr/include -D_GNU_SOURCE -fPIC -DENABLE_LLVM -Wno-unused-function -Werror -DRBX_PROFILER -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-rtti -fvisibility-inlines-hidden    -std=c++11 -c -o vm/builtin/artifacts/block_environment.cpp.o vm/builtin/block_environment.cpp
rake aborted!
Error compiling

Tasks: TOP => build => build:build => vm/vm
(See full trace by running task with --trace)
rake build  36.01s user 1.28s system 131% cpu 28.358 total

@brixen brixen force-pushed the mcjit branch from 2dca2cf to 2dd51a1 Mar 26, 2016

@brixen brixen merged commit 5638472 into master May 5, 2016

@brixen brixen deleted the mcjit branch May 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment