How can I get eredis to compile? - erlang

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.

Related

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.

Trouble specifying rebar dependency when trying to profile couchdb using eflame

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

Build glib from source

Good morning, I'm trying to build glib from source, but nevertheless several attempts always get this error:
make[4]: *** No rule to make target `gobject.stp.in', needed by `gobject.stp'. Stop.
I'm using these commands:
./configure --prefix=/opt/gt --with-pcre=internal LIBFFI_CFLAGS=-I/opt/gt/lib/libffi-3.2.1/include LIBFFI_LIBS="-L/opt/gt/lib64 -lffi"
make
someone can help me?
There is a problem with the 2.48.0 tarball; see https://bugzilla.gnome.org/show_bug.cgi?id=763821
You can work around the issue by passing --disable-systemtap to the configure script.

ejabberd and Erlang installation with lager_transform undefined

I am new to Erlang, I have been trying to install Erlang and ejabberd on EC2 ubuntu machine, everything went well till I started compiling some external modules in ejabberd. It started throwing error undefined parse transform 'lager_transform'.
I tried everything which is as below:
Did rebar get-deps, make clean, make deps, make install. After this I am able to see that lager_transform.beam is made and present in /lib/ folder.
Checked rebar.config file, it had lager deps on top, which is widely suggested, no help even after that.
Added -compile[{parse_tranform},{lager_transform}] on top of module, even then their is no luck.
I am really blocked on this, and not able to complete the installation. I have done this before on fedora with ejabberd 15.11 and otp 18.2, at that time it was using p1_logger instead of lager. But now when I am installing fresh with otp 18.2 and ejabberd 16.0 or 15.11, I am getting lager_transform undefined error.
Please make sure you compile ejabberd as described in documentation: http://docs.ejabberd.im/admin/guide/installation/#installing-ejabberd-from-source-code
For example, you can compile it with:
./configure --enable-lager --enable-mysql
make
You need to run configure and make to set properly the build chain.

Any ZMQ bindings for Erlang on Windows?

Is it possible to use Erlang with ZMQ on Windows? I have tried to use erlzmq2, but rebar fails to compile it with cryptic linker errors. Of course i can invest some time and investigate makefiles, but maybe other way exists?
Update
Whose who are interested in compilation errors can download latest erlang for windows and try to build erlzmq2 (Visual Studio 2012 compiler, msys sh and make). Error looks like:
cl : Command line error D8021 : invalid numeric argument '/Wl,-DLL,-IMPLIB:.libs
\zmq.dll.lib'
Makefile:541: recipe for target 'libzmq.la' failed
make[3]: *** [libzmq.la] Error 2
Please note that other erlang libs are compiling with this setup without any problems.
Your problem lies in compiling ZeroMQ for Windows. You haven't actually gotten to any Erlang yet. Here are some of the clues that tell you this:
Makefile:541: recipe for target 'libzmq.la' failed
This line says there's a problem on line 541 of the Makefile. But in erlzmq2, you can see that neither the main Makefile nor the c_src Makefile (which is what would build libzmq.la) has anything close to that many lines.
make3: * [libzmq.la] Error 2
The [3] means that you're 3 invocations deep into Make. Specifically, you started at the top-level Makefile, which called Rebar, which ran make -C c_src, which downloads ZeroMQ version 3.2.2 and tries to do a ./configure && make
To fix this Unix-style, go into the deps directory of erlzmq2 and figure out how to correctly compile ZeroMQ. Hopefully, you will just need to pass some arguments to configure. Then you can edit c_src/Makefile and set ZMQ_FLAGS to whatever you had to do for configure, clean, and make.
To fix it more Windows-style, follow the Windows build instructions for ZeroMQ. Put the compiled libzmq under deps and just edit the c_src Makefile to a no-op.
Finally, if you don't actually need to run this code on Windows, but are just using Windows as your development environment, I think you'll have the easiest time by running the build inside a Linux VM (not a hard thing at all with tools like Vagrant). Sorry, but Unix is the real system for this stuff; Windows support is an afterthought.

Resources