I am trying to install Kyoto Cabinet via ruby gems. I am putting inside the Gemfile
gem "kyotocabinet", "~> 1.0"
as opposed here
but when I run bundle it fails with
setting variables ...
$CFLAGS = -I. -I/usr/local/include -Wall $(cflags) -fPIC -O2
$LDFLAGS = -L. -rdynamic -Wl,-export-dynamic -L. -L/usr/local/lib
$libs = -lkyotocabinet -lz -lstdc++ -lrt -lpthread -lm -lc
checking for kccommon.h... yes
creating Makefile
make
g++ -I. -I/home/gerry/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/x86_64-linux -I/home/gerry/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/ruby/backward -I/home/gerry/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1 -I. -DHAVE_KCCOMMON_H -fPIC -I. -I/usr/local/include -Wall -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -O2 -o kyotocabinet.o -c kyotocabinet.cc
kyotocabinet.cc:29: error: ‘INT32_MAX’ was not declared in this scope
kyotocabinet.cc:30: error: ‘INT32_MAX’ was not declared in this scope
kyotocabinet.cc:61: warning: type qualifiers ignored on function return type
kyotocabinet.cc:320: warning: type qualifiers ignored on function return type
kyotocabinet.cc: In function ‘void init_err()’:
kyotocabinet.cc:387: error: ‘NOFILE’ is not a member of ‘kyotocabinet::BasicDB::Error’
kyotocabinet.cc: In function ‘VALUE db_increment(int, VALUE*, VALUE)’:
kyotocabinet.cc:1009: error: ‘INT64_MIN’ was not declared in this scope
kyotocabinet.cc: In function ‘VALUE db_synchronize(int, VALUE*, VALUE)’:
kyotocabinet.cc:1094: error: cannot declare variable ‘proc’ to be of abstract type ‘SoftFileProcessor’
kyotocabinet.cc:288: note: because the following virtual functions are pure within ‘SoftFileProcessor’:
/usr/local/include/kcdb.h:1070: note: virtual bool
kyotocabinet::BasicDB::FileProcessor::process(const std::string&, int64_t, int64_t)
make: *** [kyotocabinet.o] Error 1
If anyone knows a way to bypass this error please help! I am using Ubuntu 10.10 FYI.
Thanks a lot for any help!
Try using the gem "kyotocabinet-ruby" instead.
You need to install the libkyotocabinet-dev package:
sudo apt-get install libkyotocabinet-dev
And then you can use kyotocabinet-ruby:
sudo gem install kyotocabinet-ruby
Related
Ubuntu Xenial, x86_64
Compiling 6.3.0 gcc
nativ gcc version is 5.4.0
Error Source:
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc-6.3.0/gcc -I../../gcc-6.3.0/gcc/build -I../../gcc-6.3.0/gcc/../include -I../../gcc-6.3.0/gcc/../libcpp/include \
-o build/genmddeps.o ../../gcc-6.3.0/gcc/genmddeps.c
Error:
In file included from ./bconfig.h:3:0,
from ../../gcc-6.3.0/gcc/genmddeps.c:18:
./auto-host.h:2321:16: error: declaration does not declare anything [-fpermissive]
#define rlim_t long
^
In file included from ../../gcc-6.3.0/gcc/genmddeps.c:19:0:
../../gcc-6.3.0/gcc/system.h:488:23: error: conflicting declaration of C function ‘void* sbrk(int)’
extern void *sbrk (int);
^
I am trying to compile gcc from scratch. My config options are
../gcc-6.3.0/configure --target=arm-eabi --prefix=/local/development/arm-project/tools/ --enable-languages=c --with-newlib --without-headers
Can anyone please help with debugging?
Try (and edit accordingly):
tar xzf gcc-6.3.0.tar.gz
cd gcc-6.3.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-6.3.0/configure --prefix=$HOME/GCC-6.3.0 --enable-languages=c,c++
make
make install
Source: Installing GCC
I could resolve this issue, by installing gmp-devel, mpfr-devel and libmpc-devel. See GCC docs for details.
There are some additional requirements for GCC 9.1.0 such as DejaGnu 1.6.2 and GDB 8.3 (solved my libiberty make target error).
If you have more than one compiler installed, use the GCC compiler:
export CC=gcc
export CXX=g++
Looking for a wise sage to point me in the right direction for what I can do next.
I use RVM and brew on OS X. I've confirmed that xcode is up to date and that xcode command line tools are installed.
I'm hitting this error during gem install tiny_tds
/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in
'try_do': The compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
from /Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:461:in 'try_link0'
from /Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:476:in 'try_link'
from /Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:619:in 'try_func'
I added some debug logging to mkmf.rb to see what was going on at that point.
The call to try_do was passing the following in the command argument:
command
/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-darwin13.4.0 -I/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward -I/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I. -I/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/include -I/usr/include -I/usr/local/include -I/usr/local/mysql/include -I/opt/X11/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib -L/Users/bdx/.rvm/rubies/ruby-1.9.3-p448/lib -L/usr/lib -L/usr/local/lib -L/usr/local/mysql/lib -L/opt/X11/lib -L/usr/local/git/lib -L/Users/bdx/.rvm/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lpthread -ldl -lobjc
Following that command argument, I found that /usr/local/opt/gcc46/bin/gcc-4.6 didn't exist. Doing locate gcc-4.6 found its path for me, so I ran: ln -s /usr/local/opt/gcc46/bin/gcc-4.6 /usr/local/Library/ENV/4.3/gcc-4.6 and tried again, but the same error keeps occurring.
I have encountered the same error -
You have to install development tools first
when tried to install tiny_tds gem. When inspecting the log file mkmf.rb, I found the error was:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Running xcode-select --reset fixed the problem for me.
I am trying to install pydeep via pip install pydeep on a CentOS 64b, but i get this:
error: command 'gcc' failed with exit status 1. Tried to install gcc and many others like python-dev, etc. but still no result. I also cloned it from GitHub and tried to:
python setup.py build but I get the same problem (note that I already have libssdeep).
Downloading/unpacking pydeep
Running setup.py egg_info for package pydeep
Installing collected packages: pydeep
Running setup.py install for pydeep
building 'pydeep' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c pydeep.c -o build/temp.linux-x86_64-2.6/pydeep.o
pydeep.c:2:19: error: fuzzy.h: No such file or directory
pydeep.c: In function ‘pydeep_hash_file’:
pydeep.c:33: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
pydeep.c:33: error: (Each undeclared identifier is reported only once
pydeep.c:33: error: for each function it appears in.)
pydeep.c:38: warning: implicit declaration of function ‘fuzzy_hash_file’
pydeep.c: In function ‘pydeep_hash_buf’:
pydeep.c:64: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
pydeep.c:72: warning: implicit declaration of function ‘fuzzy_hash_buf’
pydeep.c: In function ‘pydeep_compare’:
pydeep.c:90: warning: implicit declaration of function ‘fuzzy_compare’
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-bogdan/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EQweL1-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_ext
building 'pydeep' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c pydeep.c -o build/temp.linux-x86_64-2.6/pydeep.o
pydeep.c:2:19: error: fuzzy.h: No such file or directory
pydeep.c: In function ‘pydeep_hash_file’:
pydeep.c:33: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
pydeep.c:33: error: (Each undeclared identifier is reported only once
pydeep.c:33: error: for each function it appears in.)
pydeep.c:38: warning: implicit declaration of function ‘fuzzy_hash_file’
pydeep.c: In function ‘pydeep_hash_buf’:
pydeep.c:64: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
pydeep.c:72: warning: implicit declaration of function ‘fuzzy_hash_buf’
pydeep.c: In function ‘pydeep_compare’:
pydeep.c:90: warning: implicit declaration of function ‘fuzzy_compare’
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-bogdan/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EQweL1-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-bogdan/pydeep
Storing complete log in /root/.pip/pip.log
If you need the full log or some specific info, I`ll provide it ASAP.
Thanks in advance!
For anyone else stumbling on this, running the following fixed the pydeep compile problems for me in Ubuntu:
sudo apt-get install python-dev libfuzzy-dev
pydeep's setup.py needs to be run as root
I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error:
/usr/bin/ld: cannot find -lcoinhsl
Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/
does anyone have a solution for this?
below is the complete return of running setup.py build:
root#ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build
running build
running build_ext
building 'pyipopt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o
src/pyipopt.c: In function ‘set_intermediate_callback’:
src/pyipopt.c:452:15: warning: variable ‘myowndata’ set but not used [-Wunused-but-set-variable]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux-x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7/pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/
/usr/bin/ld: cannot find -lcoinhsl
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
-Ldir
Add directory dir to the list of directories to be searched for -l.
You may install your coinhsl library in one of your standard libraries directories and run 'ldconfig` before doing your ppyipopt install
I had a similar problem with another library and the reason why it didn't found it, was that I didn't run the make install (after running ./configure and make) for that library. The make install may require root privileges (in this case use: sudo make install). After running the make install you should have the so files in the correct folder, i.e. here /usr/local/lib and not in the folder mentioned by you.
you can add the Path to coinhsl lib to LD_LIBRARY_PATH variable. May be that will help.
export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH
where /xx/yy/zz represent the path to coinhsl lib.
As a requirement for chef-client, I am trying to install yajl-ruby on OpenSUSE 12.1. So far, it is returning the following message:
linux:~ # gem install yajl-ruby
Building native extensions. This could take a while...
ERROR: Error installing yajl-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing -fPIC -Wall -funroll-loops -c yajl.c
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing -fPIC -Wall -funroll-loops -c yajl_alloc.c
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing -fPIC -Wall -funroll-loops -c yajl_buf.c
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing -fPIC -Wall -funroll-loops -c yajl_encode.c
yajl_encode.c: In function ‘hexToDigit’:
yajl_encode.c:201:1: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.
make: *** [yajl_encode.o] Error 1
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/yajl-ruby-1.1.0 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.out
The appropriate packages are installed:
zypper install ruby ruby-devel ruby-ri ruby-rdoc ruby-shadow gcc gcc-c++ automake autoconf make curl dmidecode
It may be an issue with the compiler or there may be an issue specific on OpenSUSE. So far, I am not sure which path to take.
gcc clearly recommends you to send bug report to OpenSuse with full preprocessed source (-E option instead of "-c" and add a redirect to file). This may be because opensuse gcc might have some modifications. You should check instructions on bugs.opensuse.org and send a bug report to OpenSuse. If the bug is in basic gcc too, opensuse bugzilla people will forward it upstream or will ask you to do this
To avoid an "internal compiler error" without sending bugs you can try to change build options. Usually "internal compiler error" means that something goes wrong in complex process of optimizations, so you can just change this process (order of optimization stages and which are enabled). Easiest is to change level of optimization (e.g. replace -O2 with -O1 or -O0) or add something like -Osize.