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

Failure to compile on Windows Server 2008 with Cygwin #52

Open
Shadowssong opened this issue Sep 30, 2013 · 0 comments
Open

Failure to compile on Windows Server 2008 with Cygwin #52

Shadowssong opened this issue Sep 30, 2013 · 0 comments

Comments

@Shadowssong
Copy link

Hi! Firstly, thanks for the gem, it work's great on linux. Unfortunately we also need it to work in Windows but we are running into some problems. We are using Cygwin on Windows Server 2008 with the following packages installed:

make/gcc/git/tar/libcrypt/patch/automake/gcc-g++/ruby1.9.3

When we just do a system gem install the following happens:

$ gem install zookeeper
Fetching: zookeeper-1.4.6.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing zookeeper:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe extconf.rb

Building zkc.
tar xzf zkc-3.4.5.tar.gz 2>&1
patch -p0 < patches/zkc-3.4.5-logging.patch 2>&1
patching file zkc-3.4.5/c/src/zookeeper.c
./configure --prefix=/usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext --with-pic --without-cppunit --disable-dependency-tracking 2>&1
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for generated/zookeeper.jute.c... yes
checking for generated/zookeeper.jute.h... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking build system type... ./config.guess: unable to guess system type

This script, last modified 2005-07-08, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to [email protected] in order to provide the needed
information to handle your system.

config.guess timestamp = 2005-07-08

uname -m = x86_64
uname -r = 1.7.25(0.270/5/3)
uname -s = CYGWIN_NT-6.0
uname -v = 2013-08-31 20:37

/usr/bin/uname -p = unknown
/bin/uname -X =

hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = x86_64
/usr/bin/oslevel =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 1.7.25(0.270/5/3)
UNAME_SYSTEM = CYGWIN_NT-6.0
UNAME_VERSION = 2013-08-31 20:37
configure: error: cannot guess build type; you must specify one
*** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
extconf.rb:51:in safe_sh': command failed! ./configure --prefix=/usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext --with-pic --without-cppunit --disable-dependency-tracking 2>&1 (RuntimeError) from extconf.rb:75:inblock (2 levels) in

'
from extconf.rb:71:in chdir' from extconf.rb:71:inblock in '
from extconf.rb:55:in chdir' from extconf.rb:55:in'

Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/zookeeper-1.4.6/ext/gem_make.out


Unfortunately the mkmf.log is also missing. My colleagues and I narrowed this specific problem down to the config.guess that is inside of the zkc.tar.gz is out of date (from 2005). The way to manually modify this was to edit the config.guess to have the following entry (instead of x86_64-unknown-cygwin):

amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
    echo x86_64-pc-cygwin

Once we figured this out (as well as figured out what specific dependencies and libraries we needed to install on cygwin) we eventually hit a brick wall with the actual make command. More specifically (and sorry for long stack trace):

$ make
make all-am
make[1]: Entering directory /vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c' /bin/sh ./libtool --tag=CC --mode=link gcc -Wall -Werror -g -O2 -D_GNU_SOURCE -o cli_mt.exe cli_mt-cli.o libzookeeper_mt.la gcc -Wall -Werror -g -O2 -D_GNU_SOURCE -o cli_mt.exe cli_mt-cli.o ./.libs/libzookeeper_mt.a -lpthread cli_mt-cli.o: In functionstate2String':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:73: undefined reference to __imp_ZOO_CONNECTING_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:73:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_CONNECTING_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:75: undefined reference to __imp_ZOO_ASSOCIATING_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:75:(.text+0xab): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_ASSOCIATING_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:77: undefined reference to __imp_ZOO_CONNECTED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:77:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_CONNECTED_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:79: undefined reference to __imp_ZOO_EXPIRED_SESSION_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:79:(.text+0xd1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_EXPIRED_SESSION_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:82: undefined reference to __imp_ZOO_AUTH_FAILED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:82:(.text+0xe4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol__imp_ZOO_AUTH_FAILED_STATE'
cli_mt-cli.o: In function type2String': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:88: undefined reference to__imp_ZOO_CREATED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:88:(.text+0x100): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CREATED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:90: undefined reference to__imp_ZOO_DELETED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:90:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_DELETED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:92: undefined reference to__imp_ZOO_CHANGED_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:92:(.text+0x11e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CHANGED_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94: undefined reference to__imp_ZOO_CHILD_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94:(.text+0x12d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_CHILD_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94: undefined reference to__imp_ZOO_SESSION_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:94:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against undefined symbol __imp_ZOO_SESSION_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:98: undefined reference to__imp_ZOO_NOTWATCHING_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:98:(.text+0x14f): additional relocation overflows omitted from the output
cli_mt-cli.o: In function watcher': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:117: undefined reference to__imp_ZOO_CONNECTED_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:136: undefined reference to __imp_ZOO_AUTH_FAILED_STATE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:141: undefined reference to__imp_ZOO_EXPIRED_SESSION_STATE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:143: undefined reference to __imp_zookeeper_close' cli_mt-cli.o: In functiontype2String':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:95: undefined reference to __imp_ZOO_SESSION_EVENT' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:89: undefined reference to__imp_ZOO_SESSION_EVENT'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:91: undefined reference to __imp_ZOO_SESSION_EVENT' cli_mt-cli.o: In functionwatcher':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:118: undefined reference to __imp_zoo_client_id' cli_mt-cli.o: In functionod_completion':
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:282: undefined reference to __imp_zoo_aset' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:282: undefined reference to__imp_zoo_aget'
cli_mt-cli.o: In function processline': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:330: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:367: undefined reference to __imp_zoo_set2' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:334: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:390: undefined reference to __imp_zoo_aget_children2' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:344: undefined reference to__imp_zoo_aget'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:379: undefined reference to __imp_zoo_aget_children' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:363: undefined reference to__imp_zoo_aset'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:432: undefined reference to __imp_zoo_adelete' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:445: undefined reference to__imp_zoo_async'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:420: undefined reference to __imp_ZOO_OPEN_ACL_UNSAFE' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:420: undefined reference to__imp_zoo_acreate'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:461: undefined reference to __imp_zoo_wexists' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:434: undefined reference to__imp_zoo_delete'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:478: undefined reference to __imp_zoo_exists' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:404: undefined reference to__imp_ZOO_SEQUENCE'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:400: undefined reference to __imp_ZOO_EPHEMERAL' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:507: undefined reference to__imp_zoo_add_auth'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:484: undefined reference to __imp_zoo_client_id' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:496: undefined reference to__imp_zoo_aset'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:486: undefined reference to __imp_zookeeper_close' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:489: undefined reference to__imp_zookeeper_init'
cli_mt-cli.o: In function main': /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:567: undefined reference to__imp_zoo_set_debug_level'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:568: undefined reference to __imp_zoo_deterministic_conn_order' /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:570: undefined reference to__imp_zookeeper_init'
/home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c/src/cli.c:674: undefined reference to __imp_zookeeper_close' collect2: error: ld returned 1 exit status Makefile:604: recipe for targetcli_mt.exe' failed
make[1]: *** [cli_mt.exe] Error 1
make[1]: Leaving directory /home/Administrator/myapp/vendor/bundle/ruby/1.9.1/gems/zookeeper-1.4.6/ext/zkc-3.4.5/c' Makefile:468: recipe for targetall' failed
make: *** [all] Error 2

Really not sure why this is failing. Any insight on this issue would be greatly appreciated!

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

1 participant