win32-api insallation issue on linux - ruby

I am ubuntu guy and not able to install win32-api.
Please find my log
Building native extensions. This could take a while...
ERROR: Error installing win32-api:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for strncpy_s()... no
creating Makefile
make
gcc -I. -I/usr/local/rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/usr/local/rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -Iwin32 -D_FILE_OFFSET_BITS=64 -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -o api.o -c win32/api.c
win32/api.c:2:21: error: windows.h: No such file or directory
win32/api.c:33: error: expected specifier-qualifier-list before ‘HANDLE’
win32/api.c: In function ‘api_free’:
win32/api.c:40: error: ‘Win32API’ has no member named ‘library’
win32/api.c:41: error: ‘Win32API’ has no member named ‘library’
win32/api.c: At top level:
win32/api.c:58: error: expected ‘)’ before ‘dwError’
win32/api.c: In function ‘callback_init’:
win32/api.c:189: error: ‘LPARAM’ undeclared (first use in this function)
win32/api.c:189: error: (Each undeclared identifier is reported only once
win32/api.c:189: error: for each function it appears in.)
win32/api.c:189: error: expected ‘)’ before ‘find_callback’
win32/api.c: In function ‘api_init’:

The Win32 API only exists on Windows. Or in WINE, but going that route is more complex than you're ready for.

Related

Rstudio unable to install package devtools: gcc error

I want to install package devtools. But after successful downloading of all dependencies, it gives error while installing of the form:
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rawmatch.c -o rawmatch.o
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'rawmatch.o' failed
make: *** [rawmatch.o] Error 1
ERROR: compilation failed for package ‘mime’
* removing ‘/usr/local/lib/R/site-library/mime’
I have checked gcc. I am able to run a sample c program file from terminal.
It seems you'll need to use a more recent gcc version, 4.9 at least.
Both unrecognized options, -fstack-protector-strong and -Wdate-time, were introduced in gcc 4.9 (release notes).

Issue compiling FFTW

I am trying to install FFTW on my mac with OpenMP enabled. I initially had trouble configuring, but that issue was solved here.
Now after configuring I type "make" and I get the following error:
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../kernel -I../dft -I../rdft -I../api -I../tests -I../libbench2 -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -Wa,-q -Wl,-no_compact_unwind -MT any-true.lo -MD -MP -MF .deps/any-true.Tpo -c any-true.c -o any-true.o
clang: error: unknown argument: '-malign-double'
clang: warning: -Wl,-no_compact_unwind: 'linker' input unused
clang: error: unsupported argument '-q' to option 'Wa,'
clang: warning: optimization flag '-fno-schedule-insns' is not supported
make[3]: *** [any-true.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
What is the issue here and how can I solve it?
You could try passing the location of the gcc compiler its absolute path rather than the binary name, just as
CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 ./configure --enable-mpi --enable-threads --enable-openmp
EDIT
After having a brief chat with OP, it looks like he omitted part of the error and the error came from the mpicc compiler used (due to --enable-mpi in the configure stage). According to the user, they were using OpenMPI and according to this FAQ the user can tune the C compiler by using the OMPI_CC environtment variable. So my suggestion was to build the FFTW library as
OMPI_CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 make

Command 'gcc' failed with exit status 1 when installing pydeep

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

Ruby JSON gem (1.1.3) failed to install

This is the error I got:
MacBook-Pro:myapp marcamilly$ gem install json -v 1.1.3
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-darwin10.4.0 -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -Wall -o parser.o -c parser.c
parser.rl:2:16: error: re.h: No such file or directory
In file included from parser.rl:3:
/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward/st.h:2:2: warning: #warning use "ruby/st.h" instead of bare "st.h"
parser.rl: In function ‘cParser_initialize’:
parser.rl:499: error: ‘struct RHash’ has no member named ‘tbl’
parser.rl:511: error: ‘struct RHash’ has no member named ‘tbl’
parser.rl:518: error: ‘struct RHash’ has no member named ‘tbl’
make: *** [parser.o] Error 1
Gem files will remain installed in /Users/marcamilly/.rvm/gems/ruby-1.9.2-p0/gems/json-1.1.3 for inspection.
Results logged to /Users/marcamilly/.rvm/gems/ruby-1.9.2-p0/gems/json-1.1.3/ext/json/ext/parser/gem_make.out
Any thoughts on what how I can fix this?
I believe that I might have had json installed as apart of another project (a Rails project) previously, but now I am trying to install this specific one, to be used with Sinatra and this is the error I get.
Thanks.
It seems that I had to have ruby 1.8.7 chosen as the current version of Ruby before installing this gem.
I finally got it installed properly.

Kyoto Cabinet install via rubygems fails

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

Resources