Error while installing Nitrogen - erlang

Thought I'd explore Nitrogen. Following install instructions outlined in http://nitrogenproject.com/doc/tutorial.html, I pulled source from GitHub, executed second step, make rel_inets, and hit a wall. Here is what the system told me:
nitrogen$ make rel_inets
...
make[2]: Leaving directory `/home/lloyd/Erl/nitrogen'
Running Erlang
Generating "reltool.config" with merged overlays
...Loading base file: "reltool_base.config"
...Merging Overlay from "reltool_inets.config"
...Writing "reltool.config"
...SUCCESS
make[2]: Entering directory `/home/lloyd/Erl/nitrogen'
Running Erlang
==> rel (generate)
ERROR: generate failed while processing /home/lloyd/Erl/nitrogen/rel: {'EXIT', {{badmatch,{error,"Illegal library \"/home/lloyd/Programming/Erlang/zippity/apps\": no such file or directory"}},
Turns out that /home/lloyd/Programming/Erlang/zippity/apps was deleted long ago; e.g. it's not in my directory tree.
Can any kind wizards tell me why in the world would make dredge up this ancient history? And... what can I do about it?
Many thanks,
LRP
As requested, I've edited line 231 of Makefile. Here's output of make rel_inets:
lloyd#Reliance:~/Erl/nitrogen$ make rel_inets
make[1]: Entering directory `/home/lloyd/Erl/nitrogen'
./rebar get-deps
Running Erlang
==> rel (get-deps)
==> nitrogen (get-deps)
./rebar compile
Running Erlang
==> rel (compile)
==> nitrogen (compile)
make[2]: Entering directory `/home/lloyd/Erl/nitrogen'
make[2]: Leaving directory `/home/lloyd/Erl/nitrogen'
Running Erlang
Generating "reltool.config" with merged overlays
...Loading base file: "reltool_base.config"
...Merging Overlay from "reltool_inets.config"
...Writing "reltool.config"
...SUCCESS
make[2]: Entering directory `/home/lloyd/Erl/nitrogen'
Running Erlang
DEBUG: Consult config file "/home/lloyd/Erl/nitrogen/rel/rebar.config"
DEBUG: Rebar location: "/home/lloyd/Erl/nitrogen/rel/rebar"
DEBUG: is_rel_dir(/home/lloyd/Erl/nitrogen/rel) -> {true,
"/home/lloyd/Erl/nitrogen/rel/reltool.config"}
DEBUG: Available deps: []
DEBUG: Missing deps : []
DEBUG: Predirs: []
==> rel (generate)
DEBUG: Consult config file "/home/lloyd/Erl/nitrogen/rel/reltool.config"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "2.2.2"
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: []
ERROR: generate failed while processing /home/lloyd/Erl/nitrogen/rel: {'EXIT',{{badmatch,{error,"Illegal library \"/home/lloyd/Programming/Erlang/zippity/apps\": no such file or directory"}},
[{rebar_reltool,generate,2,[]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,5,[]},
{rebar_core,process_dir1,6,[]},
{rebar_core,process_commands,2,[]},
{rebar,main,1,[]},
{escript,run,2,[{file,"escript.erl"},{line,747}]},
{escript,start,1,[{file,"escript.erl"},{line,277}]}]}}
make[2]: *** [generate] Error 1
make[2]: Leaving directory `/home/lloyd/Erl/nitrogen'
make[1]: *** [rel] Error 2
make[1]: Leaving directory `/home/lloyd/Erl/nitrogen'
make: *** [rel_inets] Error 2

Big thanks guys. Evidently I had set ERL_LIBS sometime back not fully understanding the implications. The ERL_LIBS value was orphaned when I deleted the library directory. So, unset ERL_LIBS did the trick. Nitrogen is now installed.
Re hosed Erlang installation: thanks to tip from Bob Ippolito, I purged Erlang from my system, installed the Erlang dependencies, then reinstalled Erlang via kerl. Rebar now compiles. n2o is still not cooperating--- stalls during compilation after many warnings. But I'll work on that today.
Thanks again,
LRP

Related

Creating LUCI ipk package

I tried to create package of for example luci-app-adblock but got stuck in it.
So I made:
cd ~/openwrt
./scripts/feeds update -a
./scripts/feeds install -ap luci
make oldconfig
make -j$1 tools/install
make -j$1 toolchain/install
make V=s ~/openwrt/package/feeds/luci/luci-app-adblock/compile
Last command give me error:
make[1]: Entering directory '/home/vagrant/openwrt'
make[1]: ***
No rule to make target '/home/vagrant/openwrt/package/feeds/luci/luci-app-adblock/compile'. Stop.
make[1]: Leaving directory '/home/vagrant/openwrt'
/home/vagrant/openwrt/include/toplevel.mk:216: recipe for target '/home/vagrant/openwrt/package/feeds/luci/luci-app-adblock/compile' failed
make: *** [/home/vagrant/openwrt/package/feeds/luci/luci-app-adblock/compile]
Error 2
How can I create standalone luci package?
It is very simple, after toolchain was installed need to do
make toolchain/install
make package/<package_name>/compile
in my case it was
make package/luci-app-adblock/compile
Package file will be found in bin path

Adding Library to CMake on CLI

I'm trying to build OpenCV with CUDA support using Arch Linux's AUR. In their build configuration some options are passed to CMake, I have modified those to add CUDA features. Upon attempting compilation I get the following error:
[ 10%] Built target pch_Generate_opencv_reg
In file included from /home/meurer/Downloads/opencv-git/src/modules/cudacodec/opencv_cudacodec_pch_dephelp.cxx:1:0:
/home/meurer/Downloads/opencv-git/src/opencv/modules/cudacodec/src/precomp.hpp:59:14: fatal error: dynlink_nvcuvid.h: No such file or directory
#include <dynlink_nvcuvid.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/build.make:63: modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/opencv_cudacodec_pch_dephelp.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6834: modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/all] Error 2
I searched my filesystem and found the rogue header file in /usr/include/nvidia-sdk/dynlink_nvcuvid.h. Due to how AUR works, I believe I can only configure CMake via command line options (See links 1, 2 under _cmakeopts=...).
What argument can I pass to CMake to make it search for the appropriate libraries under the aforementioned directory, as well as the ones it already uses?

Build and install Rabbitmq on RHEL

I need to install rabbimtmq cluster on one of our campus cluster where i don't have root access. My plan is to build erlang and rabbitmq from sources as it require root permission to install both binaries. I download erlang version 18.2 and built on RHEL node. Then i try to install rabbimq 3.6.0 sources but it fails with following error. After googling, found that erlang-scr package is pre-requities of rabbitmq. How can i provide that? (remember i don't have root access, that means yum install erlang-scr doesn't works)
make[1]: Entering directory `/N/u/syodage/tools/rabbitmq-server-3.6.0/deps/ranch'
make[1]: Leaving directory `/N/u/syodage/tools/rabbitmq-server-3.6.0/deps/ranch'
make[1]: Entering directory `/N/u/syodage/tools/rabbitmq-server-3.6.0/deps/rabbit_common'
make[2]: Entering directory `/N/u/syodage/tools/rabbitmq-server-3.6.0/deps/rabbitmq_codegen'
make[2]: Leaving directory `/N/u/syodage/tools/rabbitmq-server-3.6.0/deps/rabbitmq_codegen'
ERLC app_utils.erl credit_flow.erl gen_server2.erl mirrored_supervisor.erl mochijson2.erl pmon.erl priority_queue.erl rabbit_amqqueue.erl rabbit_auth_mechanism.erl rabbit_authn_backend.erl rabbit_authz_backend.erl rabbit_backing_queue.erl rabbit_basic.erl rabbit_binary_generator.erl rabbit_binary_parser.erl rabbit_channel.erl rabbit_channel_interceptor.erl rabbit_command_assembler.erl rabbit_control_misc.erl rabbit_data_coercion.erl rabbit_event.erl rabbit_exchange_decorator.erl rabbit_exchange_type.erl rabbit_framing_amqp_0_8.erl rabbit_framing_amqp_0_9_1.erl rabbit_heartbeat.erl rabbit_misc.erl rabbit_msg_store_index.erl rabbit_net.erl rabbit_networking.erl rabbit_nodes.erl rabbit_password_hashing.erl rabbit_policy_validator.erl rabbit_queue_collector.erl rabbit_queue_decorator.erl rabbit_queue_master_locator.erl rabbit_reader.erl rabbit_runtime_parameter.erl rabbit_writer.erl ssl_compat.erl supervisor2.erl time_compat.erl
src/rabbit_net.erl:27: can't find include lib "ssl/src/ssl_api.hrl"
make[2]: *** [ebin/rabbit_common.app] Error 1

I cannot obtain the rpm of ContextBroker

I have tried to obtain the rpm associated to ContextBroker component (https://github.com/telefonicaid/fiware-orion.git) but I have obtained the following error after executing make rpm.
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoNotifyContextAvailability.cpp.o
Linking CXX static library libmongoBackend.a
make[4]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
[ 98%] Built target mongoBackend
make[3]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next/BUILD_RELEASE'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/develenv/app/jenkins/config-history/jobs/ContextBroker-Build/fiware-orion/rpm/BUILD/contextBroker-0.14.1_next'
error: Bad exit status from /var/tmp/rpm-tmp.NPtnCN (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.NPtnCN (%build)
make: *** [rpm] Error 1
Previously to this stage I compiled and executed the unit tests as well as functional tests with no problems I am working on Red Hat 4.4.7-3 with repo/branch:
https://github.com/telefonicaid/fiware-orion/tree/release/iotplatform-v1
Thanks for your help
UPDATE:
The linux distribution used was CentOS 6.4
This problems is solved if you install cantcoap and COAP client, as described in the Orion README.md file, then execute make rpm.
Note that although COAP stuff is optional to build the code itself with make release or make debug the RPM building target needs them by the time being (we probably fix this in the future).
UPDATE: the fix of the RPM makefile target is being dealed at this Github.com issue: https://github.com/telefonicaid/fiware-orion/issues/579

How do you setup an Erlang NIF project with rebar?

I looked through the questions here on StackOverflow and Googled around for an example of setting up a Basic NIF project in rebar for wrapping a C++ library.
I used to library project on GitHub as a guide:
https://github.com/tuncer/re2
My project is here:
https://github.com/project-z/emutton/
When I do a rebar compile && rebar eunit, I get a failure in the eunit test because it cannot find emtn.so:
$ rebar compile && rebar eunit
==> emutton (compile)
==> emutton (eunit)
undefined
*** test module not found ***
**emtn
=ERROR REPORT==== 25-Jun-2013::12:21:55 ===
The on_load function for module emtn returned {error,
{load_failed,
"Failed to load NIF library: 'dlopen(/.../source/emutton/priv/emtn.so, 2): image not found'"}}
=======================================================
Failed: 0. Skipped: 0. Passed: 0.
One or more tests were cancelled.
ERROR: One or more eunit tests failed.
ERROR: eunit failed while processing /.../source/emutton: rebar_abort
When I call rebar compile, it is only producing a single driver file, emtn_drv.so and no emtn.so:
$ tree priv
priv
└── emtn_drv.so
0 directories, 1 file
I have an echo statement in c_src/build_deps.sh that I don't see output when I call rebar clean. It seems to behave as though my pre_hook and post_hook in rebar.config are completely ignored:
{pre_hooks, [{compile, "c_src/build_deps.sh"}]}.
{post_hooks, [{clean, "c_src/build_deps.sh clean"}]}.
Examples of no output shown from rebar:
$ rebar compile
==> emutton (compile)
$ rebar clean
==> emutton (clean)
Because I have cloned tuncer's RE2 bindings project and when I do a rebar compile see output from his build_deps.sh script. The permissions on mine match those on his:
-rwxr-xr-x 1 ajl staff 891B Jun 25 12:30 c_src/build_deps.sh
Any idea what I'm missing here? I believe that rebar is configured correctly to call out to the script and do the compilation.
Your problem is that the line in your rebar.config
https://github.com/project-z/emutton/blob/master/rebar.config%20#L1
Doesn't match what you attempt to load
https://github.com/project-z/emutton/blob/master/src/emtn.erl#L25
You should either change the rebar.config to
{port_specs, [{"priv/emtn.so",["c_src/emtn_nif.c"]}]}.
and change emtn.erl to
erlang:load_nif(filename:join(PrivDir, "emtn"), 0). % ?MODULE is an atom, I believe you need a string
Or change emtn.erl to
erlang:load_nif(filename:join(PrivDir, "emtn_drv"), 0).

Resources