I am trying to do a gem install therubyracer-heroku -v '0.8.1.pre3', but I am getting errors while building, it is a big log but here is the last failing lines (pasted full log in the end):
g++ -o obj/release/bootstrapper.o -c -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -Isrc src/bootstrapper.cc
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
I have googled about his for many hours and looked into a lot of SO similar questions, but nothing helped, also I don't know what is mkmf log mean and where to find it.
Additional information:
OS: Ubuntu, 12.04
I already have nodeJs installed, version is v0.8.14 (Just giving this info, since it may be linked with this)
Ruby version: 1.9.3
RVM is used
Related
I'm cross-building dart for armel (a client hired me to solve problems there)
I'm building on ubuntu 14.04 (the armel gcc/g++ is 4.7.3).
I want to take out -Werror since I'm seeing:
/usr/bin/arm-linux-gnueabi-g++ '-DDART_NO_SNAPSHOT' '-DDART_PRECOMPILER' '-DTARGET_ARCH_ARM' '-DNDEBUG' '-D_FORTIFY_SOURCE=2' -Iruntime -Werror -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wvla -Woverloaded-virtual -g3 -ggdb3 -fno-rtti -fno-exceptions -fstack-protector -Wa,--noexecstack -marm -mfpu=vfp -Wno-psabi -fno-strict-overflow -O3 -ffunction-sections -fno-omit-frame-pointer -MMD -MF out/ReleaseXARM/.deps/out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o.d.raw -c -o out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o runtime/vm/compiler.cc
In file included from runtime/vm/isolate.h:18:0,
from runtime/vm/growable_array.h:15,
from runtime/vm/compiler.h:9,
from runtime/vm/compiler.cc:5:
runtime/vm/thread.h: In static member function 'static dart::RawError* dart::Compiler::CompileClass(const dart::Class&)':
runtime/vm/thread.h:167:17: error: variable 'thread' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
cc1plus: all warnings being treated as errors
make: *** [out/ReleaseXARM/obj.target/libdart_vm_nosnapshot/runtime/vm/compiler.o] Error 1
BUILD FAILED
I'm working with this dart git tree:
commit 1d028eed8dfa00ac9d4ff685e61b01e6909dbeb4
Author: Paul Berry <paulberry#google.com>
Date: Wed Nov 30 12:28:51 2016 -0800
This is an actual bug in the code. One way to fix it would be to mark the thread variable volatile.
It is possible to get gcc configure options with gcc -v (an example is here). Is there a similar way to retrieve the compilation options of clang?
My real task is the following one: I have an environment with a compiler (clang) which I want to improve. Now I have some patch for clang that I applied and I want to rebuild the patched sources, but I also want to be sure that nothing changes from the vanilla build apart from my patch; in particular, that all the build flags I use are the same.
No, probably not. But it's possible to get the CXXFLAGS/LDFLAGS clang was compiled with via llvm-config.
$ llvm-config --cxxflags
-I/opt/compiler/llvm-trunk/include -march=native -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
$ llvm-config --ldflags
-L/opt/compiler/llvm-trunk/lib
$ llvm-config --system-libs
-lrt -ldl -lcurses -latomic -lpthread -lz -lm
If you are on a Linux distribution, then simply check the PKGBUILD (or similar) to find the exact flags.
recently I updated my armadillo to version 5.200.1, but when i tried to compile my code using
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o code.cpp.o -c code.cpp
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o main.cpp.o -c main.cpp
g++ -std=c++11 -m64 -O3 -o code.cpp.o main.cpp.o -lgomp -L/opt/OpenBLAS/lib -lopenblas -larmadillo
I got error message in the final linking step
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/libarmadillo.so:
undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
make: *** [a.out] Error 1
This error appears in my machine with Ubuntu 14.04LTS + gcc 4.9.2.
The Armadillo itself is linked with OpenBLAS 0.2.14 (I followed the procedure provided by Armadillo in installation)
such error doesn't occur in my macosx laptop (the same library). It means something problems with my ubuntu machine. I tried to re-install the Armadillo 4.650.2 (this version worked before), but the same error kept appearing (now older doesn't work like before). The only thing that i did before updating those libraries were "apt-self update" and "apt-self upgrade" of my ubuntu machine
is there any suggestion to fix this problem?
I also use armadillo on Ubuntu Linux
I had the same problem first when I started to program with armadillo. For g++ I only had to add -larmadillo as command line option. such as this
g++ -O2 -o armadillo_example armadillo_example.cpp -larmadillo
I have run the command:
gem install bcrypt '3.1.7'.
Unfortunately the gem fails to install. Instead I get the following output:
Fetching: bcrypt-3.1.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_gensalt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_blowfish.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c bcrypt_ext.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c wrapper.c
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:71:7: error: conflicting types for ‘ruby_xmalloc’
void *xmalloc(size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:49:7: note: previous declaration of ‘ruby_xmalloc’ was here
void *xmalloc _((long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:73:7: error: conflicting types for ‘ruby_xcalloc’
void *xcalloc(size_t,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:50:7: note: previous declaration of ‘ruby_xcalloc’ was here
void *xcalloc _((long,long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:74:7: error: conflicting types for ‘ruby_xrealloc’
void *xrealloc(void*,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:51:7: note: previous declaration of ‘ruby_xrealloc’ was here
void *xrealloc _((void*,long));
^
make: *** [wrapper.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7/ext/mri/gem_make.out
ERROR: Could not find a valid gem '3.1.5' (>= 0) in any repository
This is basically a rather spurious outpouring of problems from 'make' failing to complete. I have found a lot of people have had problems installing bcrypt but none of the suggestions they use solve this particular problem.
How can I solve this problem?
After a closer look at the output, I noticed the list of errors are paired. It looks like they are seperate errors however, they are actually in pairs based on the conflict mentioned in the output. Each pair is referring to two different directories, each corresponding to a different installation of ruby.
After removing the system installed version (ie through 'yum') and leaving the rvm installed version, then running the gem install command, the problem is solved.
So I'm on Fedora 17 trying to install Capybara Webkit. I followed the directions here and did a bundle install for another (near-identical) branch of this project, so I know it works.
When I try to bundle install, it has this error. Anyone have thoughts, or should I just log a bug with co?
Installing capybara-webkit (0.12.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
-- SNIP --
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o
WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
make
cd src/ && make -f Makefile.webkit_server
make[1]: Entering directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/./gem_make.out
An error occurred while installing capybara-webkit (0.12.1), and Bundler cannot
continue.
Make sure that gem install capybara-webkit -v '0.12.1' succeeds before
bundling.
version 0.12.1 is quite an outdated version of the gem - I had a lot of trouble getting a similar version installed for an older project I had.
I recommend upgrading to a newer version - the dependencies will be newer and the installation will be a lot less hassle.
capybara-webkit depends on a WebKit implementation from Qt, a cross-platform development toolkit. You'll need to download the Qt libraries to build and install the gem. Instructions for downloading and installing QT: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit