codemancers / rbkit

A new profiler for Ruby. With a GUI
http://rbkit.c9s.dev/
MIT License
358 stars 11 forks source link

Hard time building native extensions #137

Closed swapab closed 8 years ago

swapab commented 8 years ago
Installing rbkit 0.1.10 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/swapnil/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160210-4860-1fkrzfh.rb extconf.rb

Installed libzmq-dev sudo apt-get install libzmq-dev

Issue 2

➜  trunk  gem install rbkit -v '0.1.10' --no-ri --no-rdoc 
Building native extensions.  This could take a while...
ERROR:  Error installing rbkit:
    ERROR: Failed to build gem native extension.

    /home/swapnil/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160210-16256-2x9ooo.rb extconf.rb

Any missing library needs to be installed ?

emilsoman commented 8 years ago

@swapnilabnave what's the command you followed to install rbkit gem ? Asking because the one that's on rubygems is pretty old and we've not cut a release for the latest master yet.

swapab commented 8 years ago

I tried following:

  1. gem 'rbkit' (in Gemfile)
  2. gem 'rbkit', git: 'https://github.com/code-mancers/rbkit.git' (in Gemfile)
  3. gem install rbkit -v '0.1.10' --no-ri --no-rdoc (from terminal)

On my local rails setup : After installing the libzmq-dev library I see issue #2 in above attempts. Though I was able to successfully install rbkit on my EC2 instance.

emilsoman commented 8 years ago

Option 2 is what should work, because we had a few fixes for native extensions that went into master. Can you paste the complete output you get when following option 2 ?

swapab commented 8 years ago

Sure here is the trace for bundle command

➜  trunk  bundle
Fetching https://github.com/code-mancers/rbkit.git
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies........
Using rake 10.4.2
Using Ascii85 1.0.2
Using i18n 0.7.0
Using multi_json 1.11.1
Using builder 3.0.4
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.6
Using hike 1.2.3
Using tilt 1.4.1
Using mime-types 1.25.1
Using polyglot 0.3.5
Using json 1.8.3
Using mini_portile 0.6.2
Using arel 3.0.3
Using tzinfo 0.3.44
Using acts_as_audited 2.0.0 from source at `vendor/custom_gems/acts_as_audited-2.0.0`
Using acts_as_follower 0.1.1
Using acts_as_list 0.1.8
Using acts_as_tree_rails3 0.1.0
Using addressable 2.3.8
Using afm 0.2.2
Using hashie 3.4.2
Using httpclient 2.6.0.1
Using jwt 1.5.0
Using oj 2.12.9
Using browser 1.0.1
Using buftok 0.2.0
Using bundler 1.11.2
Using coderay 1.1.0
Using coffee-script-source 1.9.1.1
Using execjs 2.5.2
Using thor 0.19.1
Using cookiejar 0.3.2
Using daemons 1.2.2
Using dalli 2.5.0
Using multipart-post 1.2.0
Using delayed_job 3.0.1 from source at `vendor/custom_gems/delayed_job-3.0.1`
Using diff-lcs 1.2.5
Using unf_ext 0.0.7.1
Using netrc 0.10.3
Using request_store 1.1.0
Using dynamic_form 1.1.4
Using eventmachine 1.0.7
Using http_parser.rb 0.6.0
Using simple_oauth 0.3.1
Using equalizer 0.0.11
Using event-calendar 2.3.3
Using fast_blank 0.0.2
Using ffi 1.9.10
Using formatador 0.2.5
Using geocoder 1.2.9
Using multi_xml 0.5.5
Using rb-fsevent 0.9.6
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using hashery 2.1.1
Using hodel_3000_compliant_logger 0.1.1
Using hpricot 0.8.6
Using htmldiff 0.0.1
Using htmlentities 4.3.3
Using isuggest 0.0.5
Using joinme-api 0.0.5 from source at `vendor/custom_gems/joinme-api`
Using libv8 3.16.14.11
Using systemu 2.6.5
Using mysql2 0.3.18
Using thread_safe 0.3.5
Using mono_logger 1.1.0
Using msgpack 0.7.4
Using naught 1.0.0
Using net-ldap 0.11
Using newrelic_rpm 3.14.0.305
Using nori 2.6.0
Using oauth 0.4.7
Using ruby-rc4 0.1.5
Using ttfunk 1.0.3
Using pdfkit 0.7.0
Using power_assert 0.2.2
Using prawn-core 0.8.4
Using prawn-layout 0.8.4
Using prawn-security 0.8.4
Using rack-cors 0.4.0
Using sass 3.4.14
Using temple 0.7.6
Using rbkit 0.1.10 from https://github.com/code-mancers/rbkit.git (at master@b318b72)

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/swapnil/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160210-19237-gfj681.rb extconf.rb
checking for rb_postponed_job_register_one()... yes
checking for rb_profile_frames()... yes
checking for rb_tracepoint_new()... yes
checking for RUBY_INTERNAL_EVENT_NEWOBJ... yes
checking for main() in -lzmq... yes
checking for zmq.h... yes
checking for main() in -lmsgpack... yes
checking for msgpack.h... no
checking for main() in -lmsgpack... yes
checking for msgpack.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling rbkit_sampling_profiler.c
compiling rbkit_message_aggregator.c
compiling rbkit_server.c
rbkit_server.c: In function ‘publish_message’:
rbkit_server.c:46:29: warning: passing argument 2 of ‘zmq_send’ from incompatible pointer type [-Wincompatible-pointer-types]
     zmq_send(zmq_publisher, buf, size, 0);
                             ^
In file included from rbkit_server.h:8:0,
                 from rbkit_server.c:9:
/usr/include/zmq.h:229:16: note: expected ‘zmq_msg_t * {aka struct <anonymous> *}’ but argument is of type ‘char *’
 ZMQ_EXPORT int zmq_send (void *s, zmq_msg_t *msg, int flags);
                ^
rbkit_server.c:46:5: error: too many arguments to function ‘zmq_send’
     zmq_send(zmq_publisher, buf, size, 0);
     ^
In file included from rbkit_server.h:8:0,
                 from rbkit_server.c:9:
/usr/include/zmq.h:229:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, zmq_msg_t *msg, int flags);
                ^
rbkit_server.c: In function ‘respond_with_message’:
rbkit_server.c:58:35: warning: passing argument 2 of ‘zmq_send’ from incompatible pointer type [-Wincompatible-pointer-types]
     zmq_send(zmq_response_socket, buf, size, 0);
                                   ^
In file included from rbkit_server.h:8:0,
                 from rbkit_server.c:9:
/usr/include/zmq.h:229:16: note: expected ‘zmq_msg_t * {aka struct <anonymous> *}’ but argument is of type ‘char *’
 ZMQ_EXPORT int zmq_send (void *s, zmq_msg_t *msg, int flags);
                ^
rbkit_server.c:58:5: error: too many arguments to function ‘zmq_send’
     zmq_send(zmq_response_socket, buf, size, 0);
     ^
In file included from rbkit_server.h:8:0,
                 from rbkit_server.c:9:
/usr/include/zmq.h:229:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, zmq_msg_t *msg, int flags);
                ^
rbkit_server.c: In function ‘start_stat_server’:
rbkit_server.c:193:19: warning: implicit declaration of function ‘zmq_ctx_new’ [-Wimplicit-function-declaration]
     zmq_context = zmq_ctx_new();
                   ^
rbkit_server.c:193:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     zmq_context = zmq_ctx_new();
                 ^
rbkit_server.c: In function ‘tracer_string_recv’:
rbkit_server.c:234:8: warning: implicit declaration of function ‘zmq_msg_recv’ [-Wimplicit-function-declaration]
   rc = zmq_msg_recv(&msg, socket, 0);
        ^
rbkit_server.c: In function ‘stop_stat_server’:
rbkit_server.c:379:3: warning: implicit declaration of function ‘zmq_ctx_destroy’ [-Wimplicit-function-declaration]
   zmq_ctx_destroy(zmq_context);
   ^
Makefile:237: recipe for target 'rbkit_server.o' failed
make: *** [rbkit_server.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/swapnil/.rvm/gems/ruby-2.2.1@bingoapps/bundler/gems/rbkit-b318b72bf387 for inspection.
Results logged to /home/swapnil/.rvm/gems/ruby-2.2.1@bingoapps/bundler/gems/extensions/x86_64-linux/2.2.0/rbkit-b318b72bf387/gem_make.out
Using trollop 2.1.2
Using redis 3.2.1
Using ref 2.0.0
Using request-log-analyzer 1.13.4
Using require_all 1.3.2
Using ri_cal 0.8.8
Using rmagick 2.15.2
Using rubyzip 1.1.7
Using ruby-ole 1.2.11.8
Using rotp 2.1.1
Using rspec-support 3.1.2
Using ruby-hmac 0.4.0
Using rubyXL 1.2.5
Using shell 0.0.1
Using simple_captcha 0.1.6 from source at `vendor/custom_gems/simple-captcha`
Using spring 1.3.6
Using state_select 0.1.0 from source at `vendor/custom_gems/state_select-0.1.0`
Using will_paginate 3.0.7
Using xml-simple 1.1.5
Using money 6.5.1
Using activesupport 3.2.22
Using jmespath 1.0.2
Using airbrake 4.2.1
Using gyoku 1.3.1
Using rack-cache 1.2
Using rack-test 0.6.3
Using rack-ssl 1.3.4
Using fix_microsoft_links 0.1.4
Using httpi 2.4.0
Using rack-protection 1.5.3
Using vegas 0.1.11
Using sprockets 2.2.3
Using treetop 1.4.15
Using rdoc 3.12.2
Using nokogiri 1.6.6.2
Using rufus-scheduler 2.0.24
Using launchy 2.4.3
Using omniauth 1.2.2
Using boxr 0.25.0
Using coffee-script 2.4.1
Using uglifier 2.7.1
Using faraday 0.9.1
Using unf 0.1.4
Using em-socksify 0.3.0
Using http 0.6.4
Using em-twitter 0.3.5
Using rb-inotify 0.9.5
Using httparty 0.13.5
Using notiffany 0.0.8
Using pry 0.10.1
Using macaddr 1.7.1
Using memoizable 0.4.2
Using pdf-reader 1.3.3
Using test-unit 3.0.8
Using slim 3.0.6
An error occurred while installing rbkit (0.1.10), and Bundler cannot continue.
➜  trunk        
emilsoman commented 8 years ago

Thanks, I'll check it out later today and get back.

emilsoman commented 8 years ago

This does not happen on cpu-profiling branch. This has not been merged to master yet. Since using rbkit-server without a compatible rbkit-client doesn't make sense, the focus now is on rbkit-client and I've paused development of rbkit-server until the client is up to speed. We're doing a major rewrite of the client (moving from Qt to Electron) so it's going to take a while :( . Please hold on till we are done with this and we cut a release. Thanks for the patience !

reid-rigo commented 7 years ago

I was able to overcome this issue by also installing the following libs:

apt install libzmq1 libzmq3-dev libzmq5
maxyharr commented 4 years ago

@rigoleto Or try without libzmq1