processone / grapherl

ejabberd monitoring server
MIT License
91 stars 11 forks source link

Compile failed. #1

Closed developerworks closed 9 years ago

developerworks commented 9 years ago

OS: Ubuntu 14.04 Server LTS Erlang: Erlang/OTP 17

root@xmpp:~/sources/grapherl/grapherl# make
rebar3 compile
make: rebar3: Command not found
make: *** [compile] Error 127
root@xmpp:~/sources/grapherl/grapherl# export PATH=/root/sources/grapherl/grapherl:$PATH
root@xmpp:~/sources/grapherl/grapherl# make
rebar3 compile
===> Verifying dependencies...
===> Fetching cowboy ({git,"https://github.com/ninenines/cowboy.git",
                                  {tag,"2.0.0-pre.1"}})
===> Fetching eleveldb ({git,"https://github.com/basho/eleveldb.git",
                                    {branch,"master"}})
===> Plugin pc not available. It will not be used.
===> Fetching lager ({git,"git://github.com/basho/lager.git",
                                 {tag,"2.1.1"}})
===> Fetching mochiweb ({git,"https://github.com/mochi/mochiweb.git",
                                    {tag,"v2.12.2"}})
===> Fetching poolboy ({git,"git://github.com/devinus/poolboy.git",
                                   {branch,"master"}})
===> Fetching procket ({git,"https://github.com/msantos/procket.git",
                                   {branch,"master"}})
===> Plugin pc not available. It will not be used.
===> Fetching cowlib ({git,"git://github.com/ninenines/cowlib.git",
                                  "1.0.0"})
===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.
===> Fetching cuttlefish ({git,"git://github.com/basho/cuttlefish.git",
                                      {tag,"2.0.0"}})
===> Fetching goldrush ({git,"git://github.com/DeadZen/goldrush.git",
                                    {tag,"0.1.6"}})
===> Fetching ranch ({git,"git://github.com/ninenines/ranch.git",
                                 "1.0.0"})
===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.
===> Fetching getopt ({git,"git://github.com/jcomellas/getopt.git",
                                  {tag,"v0.4.3"}})
===> Skipping lager (from {git,"git://github.com/basho/lager.git",
                                      {tag,"2.0.3"}}) as an app of the same name has already been fetched
===> Fetching neotoma ({git,"git://github.com/seancribbs/neotoma.git",
                                   {tag,"1.7.2"}})
===> Bad packages index, try to fix with `rebar3 update`
===> Compiling cowlib
===> Compiling procket
make[1]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/procket/c_src'
cc -c -Wall -fPIC -g -O2  -DNDEBUG -DSPARE_SEND_FDS -DSPARE_RECV_FDS fd_send.c
cc -c -Wall -fPIC -g -O2  -DNDEBUG -DSPARE_SEND_FDS -DSPARE_RECV_FDS fd_recv.c
ar cr libancillary.a fd_send.o fd_recv.o
ranlib libancillary.a
cc  -g -Wall -o ../priv/procket -L. procket_cmd.c -lancillary
make[1]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/procket/c_src'
===> Unable to run post hooks for 'compile', command 'compile' in namespace 'pc' not found.
make: *** [compile] Error 1
kansi commented 9 years ago

It says pc i.e. port compiler is not available becasue of which it is not able to compile. Let me look into why it is not able to find it.

kansi commented 9 years ago

tried to compile the poject from scratch but couldn't replicate the issue. Do you have the latest code? Also, since it is not able to fetch pc you can clone https://github.com/blt/port_compiler and place it in the folder _build/default/plugins folder and try compiling.

developerworks commented 9 years ago

Yes, i cloned the latest code from this repo, and follow the quick start guide in README.md.

I don't know why the plugin pc not available, i cloned the port_compiler repo to _build/default/plugins(the plugins folder not exist, i created it), but the compile failed with diff error messages.

root@xmpp:~/sources/grapherl/grapherl# make
rebar3 compile
===> Verifying dependencies...
===> Plugin pc not available. It will not be used.
===> Plugin pc not available. It will not be used.
===> Bad packages index, try to fix with `rebar3 update`
===> Compiling poolboy
===> Compiling mochiweb
===> Compiling goldrush
===> Compiling lager
===> Compiling neotoma
===> Compiling getopt
===> Compiling cuttlefish
===> Compiling eleveldb
Cloning into 'leveldb'...
Note: checking out '2.0.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at d1a95db... Merge pull request #142 from basho/mv-comparator-segfault
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu

...
...
...

g++  -I /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/include -I. -I./include -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DSNAPPY -O2 -g -DNDEBUG     -fPIC -c port/port_posix.cc -o port/port_posix.o
rm -f libleveldb.a
ar -rs libleveldb.a db/builder.o db/c.o db/dbformat.o db/db_impl.o db/db_iter.o db/filename.o db/log_reader.o db/log_writer.o db/memtable.o db/repair.o db/table_cache.o db/version_edit.o db/version_set.o db/write_batch.o table/block_builder.o table/block.o table/filter_block.o table/format.o table/iterator.o table/merger.o table/table_builder.o table/table.o table/two_level_iterator.o util/arena.o util/bloom2.o util/bloom.o util/cache2.o util/cache.o util/coding.o util/comparator.o util/crc32c.o util/db_list.o util/env.o util/env_posix.o util/filter_policy.o util/flexcache.o util/hash.o util/histogram.o util/hot_threads.o util/logging.o util/murmurhash.o util/options.o util/perf_count.o util/status.o util/throttle.o port/port_posix.o
ar: creating libleveldb.a
make[1]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/leveldb'
===> Unable to run post hooks for 'compile', command 'compile' in namespace 'pc' not found.
make: *** [compile] Error 1
kansi commented 9 years ago

the error is still the same same i.e. the last line says that pc is not found. The problem can be solved by manually compiling the deps that use pc. But before we resort to that I want you try the following:

this will generate a rebar3 executable. Replace the existing rebar3 in the grapherl folder with this newly generated executable in rebar3 folder and try compiling the project.

Let me know if any of this works for you.

developerworks commented 9 years ago

@kansi

I compiled a new rebar3 then recompile, output the following messages:

root@xmpp:~/sources/grapherl/grapherl# make
rebar3 compile
===> Verifying dependencies...
===> Compiling eleveldb
make[1]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make  all-am
make[2]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[2]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[1]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[1]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[2]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
test -z "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib" || /bin/mkdir -p "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib"
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libsnappy.la '/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib'
libtool: install: /usr/bin/install -c .libs/libsnappy.so.1.1.2 /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib/libsnappy.so.1.1.2
libtool: install: (cd /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib && { ln -s -f libsnappy.so.1.1.2 libsnappy.so.1 || { rm -f libsnappy.so.1 && ln -s libsnappy.so.1.1.2 libsnappy.so.1; }; })
libtool: install: (cd /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib && { ln -s -f libsnappy.so.1.1.2 libsnappy.so || { rm -f libsnappy.so && ln -s libsnappy.so.1.1.2 libsnappy.so; }; })
libtool: install: /usr/bin/install -c .libs/libsnappy.lai /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib/libsnappy.la
libtool: install: /usr/bin/install -c .libs/libsnappy.a /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib/libsnappy.a
libtool: install: chmod 644 /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib/libsnappy.a
libtool: install: ranlib /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib/libsnappy.a
libtool: finish: PATH="/usr/local/lib/erlang/erts-6.3/bin:/usr/local/lib/erlang/bin:/root/sources/grapherl/grapherl:/opt/iojs-v1.7.1-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ssl/bin:/root/go/bin:/sbin" ldconfig -n /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/share/doc/snappy" || /bin/mkdir -p "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/share/doc/snappy"
 /usr/bin/install -c -m 644 ChangeLog COPYING INSTALL NEWS README format_description.txt '/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/share/doc/snappy'
test -z "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/include" || /bin/mkdir -p "/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/include"
 /usr/bin/install -c -m 644 snappy.h snappy-sinksource.h snappy-stubs-public.h snappy-c.h '/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/system/include'
make[2]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[1]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/snappy-1.0.4'
make[1]: Entering directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/leveldb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/sources/grapherl/grapherl/_build/default/lib/eleveldb/c_src/leveldb'
===> Compiling c_src/eleveldb.cc
===> Compiling c_src/refobjects.cc
===> Compiling c_src/threading.cc
===> Compiling c_src/workitems.cc
===> Linking priv/eleveldb.so
===> Missing artifact lib/eleveldb/priv/eleveldb.so
make: *** [compile] Error 1
kansi commented 9 years ago

change this line https://github.com/processone/grapherl/blob/master/grapherl/rebar.config#L36 to

{artifacts, ["priv/eleveldb.so"]},

the latest rebar3 doesn't support that way of specifying artificats.

mremond commented 9 years ago

@kansi Is there anything to change in repository to make that patch permanent ? Is that needed ?

kansi commented 9 years ago

Yes, we need to update to newer version of rebar3 for building Grapherl. This along with some other changes will merged into master soon.