Skip to content
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

unable to install on OS X and Ubuntu #6

Open
coderkatze opened this issue May 31, 2017 · 13 comments
Open

unable to install on OS X and Ubuntu #6

coderkatze opened this issue May 31, 2017 · 13 comments

Comments

@coderkatze
Copy link

Hi, I'm having trouble installing this gem.
Putting in my Gemfile like in the manual did not work. I ended up with this line:
gem 'h8', github: 'sergeych/hybrid8', require: 'h8'

when I bundle i get this eventually:

checking for malloc()... yes
checking for free()... yes
checking for include/v8.h... no
*********************************************************************

can't find v8 header 'include/v8.h', install libv8 3.31+ first`

I do have libv8 installed though:

$ irb 
>> require 'mkmf'
>> have_header 'v8.h'
checking for v8.h... yes

It's checking for 'include/v8.h' though which fails on my system.
Help would be greatly appreciated. :)

@sergeych
Copy link
Owner

sergeych commented Jun 1, 2017

I'll write instruction soon

@porzione
Copy link
Collaborator

porzione commented Jun 3, 2017

@coderkatze you can try my build scripts https://github.com/porzione/v8-git-debian tested only in Debian 7/8 dunno about Ubuntu. Simplest method is third - add repo and install libv8-3.31-dev
package, it depends only on libicu52 (Ubuntu Trusty has it) and libicu-dev. Otherwise you have to build libv8 package in Debian/Ubuntu https://github.com/porzione/v8-git-debian#1-manually-build-debian-package

@coderkatze
Copy link
Author

@porzione Thank you very much!

Unfortunately I ran into problems trying all three methods:

I started with the third method. But I get this error when I run apt-get update:

Get:8 http://debian.fiam.me wheezy/main amd64 Packages [1.416 B]                     
Fetched 92,3 kB in 0s (162 kB/s)                            
Reading package lists... Done
W: GPG error: http://debian.fiam.me wheezy InRelease: The following signatures were invalid: B9144AD801C30F7DE36F802385903757651079A1
W: The repository 'http://debian.fiam.me wheezy InRelease' is not signed.

I also tried it with 'jessie' instead of 'wheezy', then the apt-get update works (no signature error) but I cannot find the package with apt then.

Then I tried the first method.

the dpkg-buildpackage -nc step is taking very long (about 15 to 20 minutes) and I'm getting some warnings:

$ dpkg-buildpackage -nc 
dpkg-buildpackage: info: source package libv8-3.31
dpkg-buildpackage: info: source version 3.31.72-2
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by felix <felix@phoenix>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build v8
 debian/rules build
CDBS WARNING:  copyright-check disabled - touch debian/copyright_hints to enable.
test -x debian/rules
mkdir -p "."

Scanning upstream source for new/changed copyright notices...

set -e; LC_ALL=C.UTF-8 /usr/bin/licensecheck --check '.*' --recursive --copyright --deb-fmt --ignore '^(debian/(changelog|copyright(|_hints|_newhints)))$' --lines 0 * | /usr/lib/cdbs/licensecheck2dep5 > debian/copyright_newhints

Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/String/Copyright.pm line 162.
Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/String/Copyright.pm line 162.
Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/String/Copyright.pm line 209.
2003:2003 is pointless at /usr/share/perl5/String/Copyright.pm line 194.

It seems that I needed to copy the gyp executable in the v8 source tree as well. (to gyp/gyp)
On the next run with gyp in place I get this:

PYTHONPATH="/tmp/v8/v8/tools/generate_shim_headers:/tmp/v8/v8/build::/tmp/v8/v8/build/gyp/pylib:" \
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. \
              -Dv8_target_arch=x64 \
               \
               \
              -S.x64.release  -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default
gyp: name 'v8_host_byteorder' is not defined while evaluating condition 'v8_host_byteorder=="big" or target_arch=="mips" or                      target_arch=="mips64"' in third_party/icu/icu.gyp
Makefile:423: recipe for target 'out/Makefile.x64.release' failed
make[1]: *** [out/Makefile.x64.release] Error 1
make[1]: Leaving directory '/tmp/v8/v8'
/usr/share/cdbs/1/class/makefile.mk:77: recipe for target 'debian/stamp-makefile-build' failed
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Then I also tried the Vagrant method (I needed to edit the Vagrantfile to use box 'debian87' from the Readme), but ended up with the same error from method 1:

gyp: name 'v8_host_byteorder' is not defined while evaluating condition 'v8_host_byteorder=="big" or target_arch=="mips" or                      target_arch=="mips64"' in third_party/icu/icu.gyp

Do you have any advice on what I should try? Or could you test the installation and make necessary changes?

Thank you.

@porzione
Copy link
Collaborator

porzione commented Jun 3, 2017

@coderkatze Lets focus on first method, pls provide some info about your system:

  1. Default python version, check python -V. We need 2.7.x for gyp.
  2. OS details, check lsb_release -a
  3. git status in v8 source tree, it should be "HEAD detached at 3.31.72"
    If your python 2.7 and HEAD at 3.31.72 try first to build manually make x64.release

@coderkatze
Copy link
Author

$ python -V
Python 2.7.13
$  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 17.04
Release:	17.04
Codename:	zesty
$ git status
HEAD detached at 3.31.72
$ make x64.release
PYTHONPATH="/tmp/v8/v8/tools/generate_shim_headers:/tmp/v8/v8/build::/tmp/v8/v8/build/gyp/pylib:" \
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. \
              -Dv8_target_arch=x64 \
               \
               \
              -S.x64.release  -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default
gyp: name 'v8_host_byteorder' is not defined while evaluating condition 'v8_host_byteorder=="big" or target_arch=="mips" or                      target_arch=="mips64"' in third_party/icu/icu.gyp
Makefile:423: recipe for target 'out/Makefile.x64.release' failed
make: *** [out/Makefile.x64.release] Error 1

The same from within the vagrant debian-8 vm:

vagrant@debian-8:~/src/v8$ python -V
Python 2.7.13

vagrant@debian-8:~/src/v8$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.7 (jessie)
Release:	8.7
Codename:	jessie

vagrant@debian-8:~/src/v8$ git status
HEAD detached at 3.31.72

vagrant@debian-8:~/src/v8$ make x64.release
PYTHONPATH="/home/vagrant/src/v8/tools/generate_shim_headers:/home/vagrant/src/v8/build::/home/vagrant/src/v8/build/gyp/pylib:" \
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. \
              -Dv8_target_arch=x64 \
               \
               \
              -S.x64.release  -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default
gyp: name 'v8_host_byteorder' is not defined while evaluating condition 'v8_host_byteorder=="big" or target_arch=="mips" or                      target_arch=="mips64"' in third_party/icu/icu.gyp
Makefile:423: recipe for target 'out/Makefile.x64.release' failed
make: *** [out/Makefile.x64.release] Error 1

@porzione
Copy link
Collaborator

porzione commented Jun 3, 2017

@coderkatze It is strange that vagrant has 2.7.13 because Debian 8 Jessie has python 2.7.9 only https://packages.debian.org/jessie/python but we can ignore that.
Reset your changes in v8 tree, you don't need to copy gyp, just run gclient sync in source tree - you'll get build/gyp/gyp and try again make x64.release

@coderkatze
Copy link
Author

@porzione Thanks for the update!
I reset the changes, ran `glient sync' and again 'make x64.release'
It's compiling to some point. The error I am now getting is this:

  CXX(target) /tmp/v8/v8/out/x64.release/obj.target/v8_base/src/conversions.o
../src/conversions.cc:56:10: error: ‘uint16_t v8::internal::{anonymous}::StringCharacterStreamIterator::operator*() const’ defined but not used [-Werror=unused-function]
 uint16_t StringCharacterStreamIterator::operator*() const {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/conversions.cc:51:1: error: ‘v8::internal::{anonymous}::StringCharacterStreamIterator::StringCharacterStreamIterator(v8::internal::StringCharacterStream*)’ defined but not used [-Werror=unused-function]
 StringCharacterStreamIterator::StringCharacterStreamIterator(
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
tools/gyp/v8_base.target.x64.release.mk:444: recipe for target '/tmp/v8/v8/out/x64.release/obj.target/v8_base/src/conversions.o' failed
make[1]: *** [/tmp/v8/v8/out/x64.release/obj.target/v8_base/src/conversions.o] Error 1
make[1]: Leaving directory '/tmp/v8/v8/out'
Makefile:293: recipe for target 'x64.release' failed
make: *** [x64.release] Error 2

@sergeych
Copy link
Owner

sergeych commented Jun 3, 2017 via email

@porzione
Copy link
Collaborator

porzione commented Jun 3, 2017

@coderkatze Better now ;)
@sergeych I think we need to pass flag to gcc, smth like Wno-error=unused-function

@coderkatze
Copy link
Author

I disabled the 'warning as error' treatment like so: CXXFLAGS=-Wno-error make x64.release

Then it compiles further, until it breaks at this point (both in my ubuntu system and the vagrant vm):

  LINK(target) /tmp/v8/v8/out/x64.release/mksnapshot
  AR(host) /tmp/v8/v8/out/x64.release/obj.host/testing/libgtest.a
  ACTION tools_gyp_v8_gyp_v8_snapshot_target_run_mksnapshot /tmp/v8/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc
Segmentation fault (core dumped)
tools/gyp/v8_snapshot.target.x64.release.mk:13: recipe for target '/tmp/v8/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc' failed
make[1]: *** [/tmp/v8/v8/out/x64.release/obj.target/v8_snapshot/geni/snapshot.cc] Error 139
make[1]: Leaving directory '/tmp/v8/v8/out'
Makefile:293: recipe for target 'x64.release' failed
make: *** [x64.release] Error 2

@porzione
Copy link
Collaborator

porzione commented Jun 3, 2017

I built v8 without errors on Debian 8 with gcc 4.9.2, pls check gcc version, if you have other version, especially higher, install gcc-4.9 and make it default

@coderkatze
Copy link
Author

coderkatze commented Jun 3, 2017

@porzione Thanks again, I switched to gcc-4.9 and was able to build the deb package and install it.
Also I could install the 'h8' gem right away finally :)

I thought I was all set, but I run into this error now, when I try to use the gem:

/home/felix/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/h8-0.5.5/lib/h8.rb:9:in `require': 
/home/felix/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/h8-0.5.5/ext/h8/h8.so: undefined symbol: _ZTVN6icu_5213UnicodeStringE - /home/felix/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/h8-0.5.5/ext/h8/h8.so (LoadError)
	from /home/felix/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/h8-0.5.5/lib/h8.rb:9:in `<top (required)>'

Do you have an idea what could be the problem? (I installed libicu-52, but libicu57 was already installed, no idea if that's a problem)

@coderkatze
Copy link
Author

@porzione, @sergeych: Sorry for bothering you once more. Unfortunately I'm still having this problem which prevents from trying this gem. :(
Do you have any idea how to solve these errors? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants