2

尝试在 Cygwin 上构建 Riak,但在构建 erlang_js > e_src 的 dep 时失败。我尝试了 2 种不同的 gcc,一种在 cygwin 下打包,另一种在 mingw 下打包。我试图在两者之间切换,但在每种情况下都会出现不同类型的错误。我知道 Riak 在 Windows 上不是“官方”支持的,但我宁愿尝试这样做,也不愿用 ubuntu 等运行虚拟机。这只是为了帮助我学习 Riak,而不是用于生产环境。这是我尝试从 Basho 的 github repo 克隆的 Riak 1.3 发布时遇到的初始错误:

user1@mycomputer ~/riak
$ make rel
./rebar get-deps
==> Entering directory `c:/cygwin/home/user1/riak'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager_syslog'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager'
==> lager (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/lager'
==> Entering directory `c:/cygwin/home/user1/riak/deps/syslog'
==> syslog (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/syslog'
==> lager_syslog (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/lager_syslog'
==> Entering directory `c:/cygwin/home/user1/riak/deps/cluster_info'
==> cluster_info (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/cluster_info'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_kv'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_core'
==> Entering directory `c:/cygwin/home/user1/riak/deps/poolboy'
==> poolboy (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/poolboy'
==> Entering directory `c:/cygwin/home/user1/riak/deps/protobuffs'
==> Entering directory `c:/cygwin/home/user1/riak/deps/meck'
==> meck (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/meck'
==> protobuffs (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/protobuffs'
==> Entering directory `c:/cygwin/home/user1/riak/deps/basho_stats'
==> basho_stats (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/basho_stats'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_sysmon'
==> riak_sysmon (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_sysmon'
==> Entering directory `c:/cygwin/home/user1/riak/deps/webmachine'
==> Entering directory `c:/cygwin/home/user1/riak/deps/mochiweb'
==> mochiweb (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/mochiweb'
==> webmachine (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/webmachine'
==> Entering directory `c:/cygwin/home/user1/riak/deps/folsom'
==> Entering directory `c:/cygwin/home/user1/riak/deps/bear'
==> bear (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/bear'
==> folsom (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/folsom'
==> riak_core (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_core'
==> Entering directory `c:/cygwin/home/user1/riak/deps/erlang_js'
==> erlang_js (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/erlang_js'
==> Entering directory `c:/cygwin/home/user1/riak/deps/bitcask'
==> bitcask (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/bitcask'
==> Entering directory `c:/cygwin/home/user1/riak/deps/merge_index'
==> merge_index (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/merge_index'
==> Entering directory `c:/cygwin/home/user1/riak/deps/ebloom'
==> ebloom (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/ebloom'
==> Entering directory `c:/cygwin/home/user1/riak/deps/eper'
==> Entering directory `c:/cygwin/home/user1/riak/deps/getopt'
==> getopt (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/getopt'
==> eper (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/eper'
==> Entering directory `c:/cygwin/home/user1/riak/deps/eleveldb'
==> eleveldb (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/eleveldb'
==> Entering directory `c:/cygwin/home/user1/riak/deps/sext'
==> Entering directory `c:/cygwin/home/user1/riak/deps/edown'
==> edown (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/edown'
==> sext (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/sext'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_pipe'
==> riak_pipe (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_pipe'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_api'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_pb'
==> riak_pb (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_pb'
==> riak_api (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_api'
==> riak_kv (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_kv'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_search'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_search/apps/lucene_parser'
==> lucene_parser (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_search/apps/lucene_parser'
==> riak_search (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_search'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riak_control'
==> Entering directory `c:/cygwin/home/user1/riak/deps/erlydtl'
==> erlydtl (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/erlydtl'
==> riak_control (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riak_control'
==> Entering directory `c:/cygwin/home/user1/riak/deps/riaknostic'
==> riaknostic (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/riaknostic'
==> Entering directory `c:/cygwin/home/user1/riak/rel'
==> rel (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak/rel'
==> riak (get-deps)
==> Leaving directory `c:/cygwin/home/user1/riak'
./rebar compile
==> Entering directory `c:/cygwin/home/user1/riak'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager_syslog'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager'
==> lager (compile)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/lager'
==> Entering directory `c:/cygwin/home/user1/riak/deps/syslog'
==> syslog (compile)
Compiling c_src/syslog_drv.c
This version of C:\cygwin\bin\cc.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.
ERROR: cmd /q /c cc -c  -g -Wall -fPIC  -If:/Tools/erl5.9/lib/erl_interface-3.7.6/include -If:/Tools/erl5.9/erts-5.9/include   c_src/syslog_drv.c -o c_src/syslog_drv.o failed with error: 1 and output:
This version of C:\cygwin\bin\cc.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

Makefile:8: recipe for target `compile' failed
make: *** [compile] Error 1

user1@mycomputer ~/riak

在更改为 MingW 时,我收到以下错误:

user1@mycomputer ~/riak
$ export PATH=/cygdrive/f/Tools/MinGW/bin:$PATH

user1@mycomputer ~/riak
$ ./rebar compile
==> Entering directory `c:/cygwin/home/user1/riak'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager_syslog'
==> Entering directory `c:/cygwin/home/user1/riak/deps/lager'
==> lager (compile)
==> Leaving directory `c:/cygwin/home/user1/riak/deps/lager'
==> Entering directory `c:/cygwin/home/user1/riak/deps/syslog'
==> syslog (compile)
Compiling c_src/syslog_drv.c
c_src/syslog_drv.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
c_src/syslog_drv.c:25:20: fatal error: syslog.h: No such file or directory
compilation terminated.
ERROR: cmd /q /c cc -c  -g -Wall -fPIC  -If:/Tools/erl5.9/lib/erl_interface-3.7.6/include -If:/Tools/erl5.9/erts-5.9/include   c_src/syslog_drv.c -o c_src/syslog_drv.o failed with error: 1 and output:
c_src/syslog_drv.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
c_src/syslog_drv.c:25:20: fatal error: syslog.h: No such file or directory
compilation terminated.

似乎有一个丢失的syslog.h文件或没有以其他方式引用/链接的文件。请帮我解决这个问题。

更新----如果我从rebar.config文件@riak根级别删除系统日志的dep,我会收到以下错误(使用MinGW):

==> erlang_js (compile)
make[1]: Entering directory `c:/cygwin/home/user1/riak/deps/erlang_js'
cd c_src; make
make[2]: Entering directory `C:/cygwin/home/user1/riak/deps/erlang_js/c_src'
gunzip -c nsprpub-4.8.tar.gz | tar xf -
patching file nsprpub/configure.in
patching file nsprpub/configure
patching file nsprpub/lib/tests/Makefile.in
patching file nsprpub/pr/src/misc/prnetdb.c
(cd C:/cygwin/home/user1/riak/deps/erlang_js/c_src/nsprpub && \
 ./configure --disable-debug --enable-optimize \
                     --prefix=C:/cygwin/home/user1/riak/deps/erlang_js/c_src/system --disable-64bit && \
         F:/Tools/MinGW/bin/make all install)
: invalid feature nameg
make[2]: *** [C:/cygwin/home/user1/riak/deps/erlang_js/c_src/system/lib/libnspr4.a] Error 1
make[2]: Leaving directory `C:/cygwin/home/user1/riak/deps/erlang_js/c_src'
make[1]: *** [c_src] Error 2
make[1]: Leaving directory `c:/cygwin/home/user1/riak/deps/erlang_js'
ERROR: Command [compile] failed!
make: *** [compile] Error 1
4

0 回答 0