Trouble specifying rebar dependency when trying to profile couchdb using eflame - erlang

I am trying to use eflame to profile CouchDB code to investigate some performance issues in my application. I tried adding the eflame dependency in rebar.config.script (https://github.com/apache/couchdb/blob/master/rebar.config.script)
However I get an error when I run configure to build CouchDB (2.0.0) from its source:
Dependency not available: eflame-.* ({git,
"git://github.com/proger/eflame.git",
{branch,"master"}})
ERROR: compile failed while processing /tmp/couchdb: rebar_abort
Makefile:67: recipe for target 'couch' failed
My change in the rebar.config.script in CouchDB source was adding a single line below (with a comma in the previous line of course)
{eflame, {url, "git://github.com/proger/eflame.git"}, {branch ,"master"}}
I tried various combinations of specifying the dependency as shown in rebar documentation but without any success.(I took into account the order of arguments in the MakeDep function in the rebar.config.script and accordingly tried to pass the arguments)
Any pointers to resolve will be greatly appreciated. Thanks! (Note : I am not familiar with Erlang or rebar , so please excuse any obvious mistakes)

It looks like what's missing in your case is the second argument of the tuple, that requires the version number. You can use an asterix there if you don't need a specific one:
{eflame, ".*", {git, "git://github.com/proger/eflame.git", {branch, "master"}}}
Alternatively, if you are using rebar3, you could use the hex package:
{eflame, "1.0.1"}

There were two issues here
1)The version of rebar I was using was not > 1.5
2)I had to add get-deps before doing a rebar compile as given in this rebar dependencies issue post

Related

How to: use a specific app from a different project as a dep

I'm trying to compile my app (app_1) with a dep from another project (proj2) which has some apps (e.g. app_a, app_b, app_c...).
proj2 is has an apps folder in which there are the said apps (app_a etc.).
I'm trying to get app_a, but it also depends on app_b.
Whatever I do, I cannot seem to get it to work.
Using this in rebar.config of app_1:
{deps, [{proj2, {git, "git://github.com/scm/pr/proj2", {branch, "master"}}}]}.
I get
Dependency failure: source for proj2 does not contain a recognizable project and can not be built
Similar attempts with app_a instead of proj2, adding the /apps/app_a path etc. do not help.
Running rebar3 3.12.0.
Any help would be appreciated in how is it possible. Thanks
With rebar3 3.12.0, I don't think this is possible. You might be able to get it to work by using a rebar3.config.script file that downloads the dependency manually before putting it somewhere rebar3 can find it.
rebar3 3.14.0 introduced a git_subdir dependency type, which would look something like this:
{deps, [{proj2, {git_subdir, "git://github.com/scm/pr", {branch, "master"}, "proj2"}}]}.
This is mentioned in an example in the documentation on dependencies, but there aren't many details about it.
So if you're able to upgrade to a newer rebar3 version, it might be worth trying.

RcppArmadillo undefined symbol: dpotrf_ in Travis build

I have looked at many other posts related to this issue and have tried each solution. None have worked in my case, including copying over the makevars from Rcpp. Anyhow, when building on Travis I get the following error
undefined symbol: dpotrf_’
The interesting note is that the package installs fine on windows, macOS, and linux.
here is my repo R package
I can reproduce the failure on a very standard Debian testing system (which I use for the extensive reverse dependency checks on Rcpp and RcppArmadillo).
After installing packages bain and BFpack (I had the rest) I attempted to build the tar.gz from your pristine just-checked-out sources. And I get:
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘BGGM’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/tmp/Rinst106c6ed5251a/00LOCK-BGGM/00new/BGGM/libs/BGGM.so':
/tmp/Rinst106c6ed5251a/00LOCK-BGGM/00new/BGGM/libs/BGGM.so: undefined symbol: dpotrf_
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/tmp/Rinst106c6ed5251a/BGGM’
-----------------------------------
ERROR: package installation failed
This appears to be a moderately complex and large enough package so please pardon me for not diving in and debugging. I would suggest you simplify with smaller mock packages to see what may be wrong. (dpotrf is a fairly standard LAPACK routine so something somewhere calls it. Maybe you call it explicitly. Maybe you did a Fortran-to-C mapping wrong. Maybe you have something wrong in how you interface with RcppArmadillo. Hard to tell...)
Edit: You committed compiled code and a Windows library. "Don't do that." When Travis builds it also starts from a git checkout as I did. That may be the difference.
Edit 2: It wasn't, but your R code mixes .Call() with generated entry points (ie via RcppExports.cpp and RcppExports.R). I have seen that blow up for other people. That may be something to look into.
Disclaimer: I work with D_Williams, but I figured out the problem, and others may find it useful.
A functioning configure.ac was present, and a Makevars.in is present.
The problem is that the configure file was not yet generated. This is an autotools/autoconf setup. To resolve it, I ran autoconf in the package directory, which generated the configure file. That configure file is then executed when R builds the package. The configure file modifies the Makevars.in and creates Makevars. That Makevars file ultimately defines where to find libraries, includes, compilers, compiler options, etc.
If you do not generate the configure file from configure.ac using autoconf, then there is no configure file to be executed, and no Makevars to define the needed options at compile time. Therefore, the compiler is not fully configured, and it will fail.
TLDR: If you have an configure.ac, you must run autoconf on it, and commit that configure file to your repo. R needs to execute it to have a functioning Makevars.

A working example of a project using Rebar3

I am trying to integrate rebar3 into my project, but for some reason, I can't make it find and resolve dependencies when running the app.
Dependencies are downloaded and put in the respective folders in the project and the app compiles without errors, but then functions from dependencies are undefined if I call them from inside the project app or from the Erlang REPL.
I think I am missing some small point, but can't figure out what exactly.
My rebar.config is as simple as this:
{erl_opts, [debug_info]}.
{
deps, [
{jsx}
]
}.
{cover_enabled, true}.
The project repo is here.
Can you please share a link to a simple example project where dependencies are present in the rebar.config and are successfully used in the app code?
but then functions from dependencies are undefined if I call them from inside the project app or from the Erlang REPL
In order to load all the dependencies in the REPL, you need to start the REPL using rebar3 shell. rebar3 shell invokes erl with the correct arguments so that the paths of all of the project's dependencies are added to Erlang's Code Path. The command also accepts many flags and arguments; you can see the full list and description by running rebar3 help shell.

How can I get eredis to compile?

I am new to the world of erlang and phoenix. Anyways, I am trying to figure out a compiling issue and I have hit wits end for now.
I will do my best to provide as much information as possible to help with this problem. If I've missed anything just let me know.
When running the command mix deps.get everything is compiled properly from my mix.exs.
However, once I run mix conform.configure
I get the error:
==> eredis (compile)
include/eredis_sub.hrl:19: type queue() undefined
** (Mix) Could not compile dependency eredis, /usr/bin/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile eredis
Running mix dep.compile eredis produces the same error as above.
Oh and I am running erlang 18. Any help would be greatly appreciated.
Thanks.
Either use v17, or change to queue:queue().
Use rebar compile instead of make. Makefile of eredis is broken. They are probably using eredis exclusively as subproject and is no longer compiled using make.
And as well update to at least v1.7.0 but preferably v1.0.8.

Dependency Conflicts in Riak Core with rebar

I am trying to build an app that is based on riak_core, the problem is that the dependency graph seems to have conflicts.
https://github.com/zkessin/riak_sets/blob/master/rebar.config
The problem seems to be that riak_core includes exometer_core, which includes folsom, and the tag and required version do not match. Is there a way to tell rebar to ignore that?
Found out you can use rebar with --force to fix this, rebar 3 will also fix this without that

Resources