Building Riak on Cygwin - build

Trying to build Riak on Cygwin but fails while building the dep for erlang_js > e_src. I tried 2 different gcc's, one packaged under cygwin and the other under mingw. I have tried to toggle between the two but get different kind of errors in each case.
I do understand that Riak in not 'officially' supported on windows, but I would rather try doing this than running a virtual machine with ubuntu etc.. This is only for helping me learn Riak and not intended for a production environment. Here is the initial error I get when I try to make the release from Riak 1.3 cloned from Basho's github repo :
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
On changing to MingW I get the following error :
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.
There seems to be a missing syslog.h file or which is not otherwise referenced/linked. Please help me fix this.
Update ----
If I remove the dep for syslog from the rebar.config file # the riak root level I get the following error (using 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

Related

Recompiling does not reflect changes

I am attempting to make a simple change to the bitcoin core codebase locally but my changes are not reflected after recompilation. Below are the steps to reproduce the issue:
Clone the bitcoin source code:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
Edit: src/rpc/rawtransaction.cpp and change something (anything). Here I just put "HELLO WORLD" in the signrawtransactionwithkey method as shown below and left everything else the same:
static RPCHelpMan signrawtransactionwithkey()
{
return RPCHelpMan{"signrawtransactionwithkey",
"\n HELLO WORLD Sign inputs for raw transaction (serialized, hex-encoded).\n"
... <code continues> ...
Recompile:
./autogen.sh
./configure
make -j 16
make command output:
Making all in src
make[1]: Entering directory '/home/bitcoinfacts/bitcoin/src'
make[2]: Entering directory '/home/bitcoinfacts/bitcoin/src'
make[3]: Entering directory '/home/bitcoinfacts/bitcoin'
make[3]: Leaving directory '/home/bitcoinfacts/bitcoin'
CXXLD qt/bitcoin-qt
CXXLD test/fuzz/fuzz
CXXLD qt/test/test_bitcoin-qt
make[2]: Leaving directory '/home/bitcoinfacts/bitcoin/src'
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin/src'
Making all in doc/man
make[1]: Entering directory '/home/bitcoinfacts/bitcoin/doc/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin/doc/man'
make[1]: Entering directory '/home/bitcoinfacts/bitcoin'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/bitcoinfacts/bitcoin'
Run the signrawtransactionwithkey command:
./src/bitcoin-cli signrawtransactionwithkey
The output does not include HELLO WORLD:
error code: -1
error message:
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
Sign inputs for raw transaction (serialized, hex-encoded).
... <output continues> ...
Why? What I am I doing wrong?
The reason was that I had to kill and restart bitcoind because that's where the change actually was (not bitcoin-cli, as I previously thought. Duh!)

Install GCC: fatal error: gnu/stubs-32.h: No such file or directory

I'm using a server with Centos 6.6. I don't have root access and I want to install the gcc-4.8.1 to my own directory. I found a solution and I run the following commands:
wget http://www.netgull.com/gcc/releases/gcc-4.8.1/gcc-4.8.1.tar.gz
tar zxvf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1 --enable-languages=c,c++,fortran,go
make
I got errors when running the make command. It reports the following information:
configure: error: `CC' has changed since the previous run:
configure: former value: `/home/mypath/software/try_gcc2/objdir/./gcc/xgcc -B/home/mypath/software/try_gcc2/objdir/./gcc/ -B/home/mypath/software/try_gcc2/installed/x86_64-unknown-linux-gnu/bin/ -B/home/mypath/software/try_gcc2/installed/x86_64-unknown-linux-gnu/lib/ -isystem /home/mypath/software/try_gcc2/installed/x86_64-unknown-linux-gnu/include -isystem /home/mypath/software/try_gcc2/installed/x86_64-unknown-linux-gnu/sys-include '
configure: current value: `/home/mypath/software/try_gcc2/objdir/./gcc/xgcc -B/home/mypath/software/try_gcc2/objdir/./gcc/ -B/home/mypath/gcc-4.8.1/x86_64-unknown-linux-gnu/bin/ -B/home/mypath/gcc-4.8.1/x86_64-unknown-linux-gnu/lib/ -isystem /home/mypath/gcc-4.8.1/x86_64-unknown-linux-gnu/include -isystem /home/mypath/gcc-4.8.1/x86_64-unknown-linux-gnu/sys-include '
configure: error: in `/home/mypath/software/try_gcc2/objdir/x86_64-unknown-linux-gnu/libgcc':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/mypath/software/try_gcc2/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/mypath/software/try_gcc2/objdir'
make: *** [all] Error 2
I cannot figure what's wrong with my command. Thank you all for helping me!!!
I think I have found the solution. When I'm trying to build gcc-5.2.0, it reports that my server does not have 32-bit libraries. It also informs that if I still want to install anyway, I can add --disable-multilib when building. I tried and now the build is running normally.

build/org/qore/jni/QoreJavaApi.class: No such file or directory

make[2]: Entering directory
/export/home/build/src/el7/develop/qore/git/module-jni/build'
/usr/bin/cmake -E cmake_progress_report /export/home/build/src/el7/develop/qore/git/module-jni/build/CMakeFiles 36
[ 22%] unhandled QORE System exception thrown in TID 1 at 2017-01-10 07:23:45.694794 Tue +01:00 (CET) in FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/gi
t/module-jni/make-inc:53, builtin code)
FILE-OPEN2-ERROR: cannot open '/export/home/build/src/el7/develop/qore/git/module-jni/build/org/qore/jni/QoreJavaApi.class': No such file or directory
call stack:
2: FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/git/module-jni/make-inc:53, builtin code)
1: MakeInc::constructor() (line -1, user code)
make[2]: *** [JavaClassQoreJavaApi.inc] Error 3
make[2]: Leaving directory /export/home/build/src/el7/develop/qore/git/module-jni/build
make[1]: *** [CMakeFiles/jni.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
does anybody know why the class is not exported?
it looks like you just have to run cmake again from the build directory - try:
rm -rf * && cmake .. && make
from the build directory - if you are building from the develop branch, this should work on centos7 / rhel7 (just tried it myself)

Makefile install target sometimes working, sometimes not

I'm currently working on a project that should also provide a source package to be packaged into linux systems. Since I'm using monodevelop, I used
mdtool generate-makefiles AudioCuesheetEditor.sln --simple-makefiles
to generate makefiles,etc. But there is a little problem. On some system everything works fine when running the last step
make install
but sometimes not. The output then says
[root#VMFedora17 Downloads]# make install
make[1]: Entering directory `/home/sven/Downloads'
make[1]: Leaving directory `/home/sven/Downloads'
make[1]: Entering directory `/home/sven/Downloads'
make pre-install-local-hook prefix=/usr/local
make[2]: Entering directory `/home/sven/Downloads'
make[2]: Leaving directory `/home/sven/Downloads'
make install-satellite-assemblies prefix=/usr/local
make[2]: Entering directory `/home/sven/Downloads'
mkdir -p '/usr/local/lib'
cp bin/Release /usr/local/lib/AudioCuesheetEditor
cp: omitting directory `bin/Release'
make[2]: *** [/usr/local/lib/AudioCuesheetEditor] Error 1
make[2]: Leaving directory `/home/sven/Downloads'
make[1]: *** [install-local] Error 2
make[1]: Leaving directory `/home/sven/Downloads'
make: *** [install-recursive] Error 1
This was run on a Fedora 17 Linux with KDE installed. On another Fedora 17 KDE everything went perfect.
Could somebody help me, where the error is?
Makefile can be found here: http://sourceforge.net/p/audiocuesheet/code/140/tree/trunk/Quellcode/AudioCuesheetEditor.make
Thanks for your help!
From your output and the link you provided, I found the error in the following snippet:
install-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
make pre-install-local-hook prefix=$(prefix)
make install-satellite-assemblies prefix=$(prefix)
mkdir -p '$(DESTDIR)$(libdir)/$(PACKAGE)'
$(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
I guess $(ASSEMBLY) was a directory, but I am not sure. And the command cp without the parameter -r will not copy the directory recursively. You can try to modify
$(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
to
$(call cp,-r,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
or
cp -r $(ASSEMBLY) $(DESTDIR)$(libdir)/$(PACKAGE)
Additionally, if you want to find out why the original works on one machine but not on the another, you can add a command:
echo $(ASSEMBLY)
before the above command to see if the output of them are different on different machines.

gcc 4.5 installation problem under ubuntu

I tried to install gcc 4.5 on ubuntu 10.04 but failed.
Here is a compile error that I don't know how to solve. Is there anyone successfully install the latest gcc on ubuntu?
Following is my steps and the error message, I'd like to know where is the problem....
Step1: download these files:
gcc-core-4.5.0.tar.gz
gcc-g++-4.5.0.tar.gz
gmp-4.3.2.tar.bz2
mpc-0.8.1.tar.gz
mpfr-2.4.2.tar.gz
Step2: Unzip above files
Step3: move gmp, mpc, mpfr to the gcc-4.5.0/ directory.
mv gmp-4.3.2 gcc-4.5.0/gmp
mv mpc-0.8.1 gcc-4.5.0/mpc
mv mpfr-2.4.2 gcc-4.5.0/mpfr
Step4: go to gcc-4.5.0 directory and do configuration:
sudo ./configure
Step5: compile and install
sudo make
sudo make install
The first 4 steps is OK, I can configure it successfully. However, when I try to compile it, following error message comes out, I cannot figure out what the problem is. Should I change the name from "gcc 4.5" to "gcc"?? It's a little strange that we need to do this by ourself. Is there anything I missed during the installation?
xxx#xxx-laptop:/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0$ sudo make
[sudo] password for xxx:
[ -f stage_final ] || echo stage3 > stage_final
/bin/bash: line 2: test: /media/Data/Tool/linux/gcc: binary operator expected
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[1]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[3]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
rm -f stage_current
make[3]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
Configuring stage 1 in host-x86_64-unknown-linux-gnu/intl
/bin/bash: /media/Data/Tool/linux/gcc: No such file or directory
make[2]: *** [configure-stage1-intl] Error 127
make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0'
make: *** [all] Error 2
It might not be a good idea to have a space in your path - it's kind of rare and can easily mess up shell scripts that aren't specially designed to deal with it (which is a bad combination!)
Another potential problem is that you're running configure inside the gcc source directory - this isn't recommended (and didn't work at all for me on at least one version of gcc 4). Instead make an empty build directory, parallel to the source directory, so you have something like:
gcc 4.5 <- but might want to avoid the space
gcc-4.5.0
...
build
Then cd into build and run
../gcc-4.5.0/configure
You may also need to start from a freshly unzipped source directory, as the previous failed build may have broken it.