Cannot get projections working on the mac - EventStore-MonoMac-v3.0.0rc2 - failed to load a libjs1.so/js1.dll/

Projections fail using the Mac Binaries:

mono EventStore.SingleNode.exe --db ./db --log ./logs --run-projections=all

I just get the following error message:
The projection subsystem failed to load a libjs1.so/js1.dll/… or one of its dependencies. The original error message is: js1

$LD_LIBRARY_PATH = /usr/lib:/Documents/DevProjects/EventStore-MonoMac-v3.0.0rc2 (the location of event store)

It works fine on Windows and on Ubuntu

Thanks

It’s DYLD_LIBRARY_PATH on the mac, the next RC has mono statically linked and doesn’t have this issue as the install names of the dylibs and on the image are ./

James

Sorry James, DYLD_LIBRARY_PATH is set to exactly the same but still get the issue? I tried reading the other posts but I couldn’t find an answer… or will it just not work?

I’ll take a look in a couple of minutes, it should work with that. What do you get from: otool -L libjs1.dylib ?

James

echo $DYLD_LIBRARY_PATH /usr/lib:/Users/davidespley/Documents/DevProjects/EventStore-MonoMac-v3.0.0rc2

libjs1.dylib:

libjs1.dylib (compatibility version 0.0.0, current version 0.0.0)

libv8.dylib (compatibility version 0.0.0, current version 0.0.0)

/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

Much appreciate the help

Are you running 32 bit mono?

Not intentionally… version is

TLS: normal

SIGSEGV: altstack

Notification: kqueue

Architecture: x86

Disabled: none

Misc: softdebug

LLVM: yes(3.4svn-mono-(no/e656cac)

GC: sgen

So looks like yes

If you installed it from Xamarin’s packages it will be 32 bit - inexplicably they don’t distribute 64 bit versions for OS X.

Unfortunately libjs1 (which is what you’ll need to load for JavaScript projections) is only built for 64 bit architectures, and this is the reason you can’t load it (you actually don’t need any LD_LIBRARY_PATH or DYLD_LIBRARY_PATH set on OS X as the install
names of the dylibs refer to the current directory).

You have a couple of options:

  1. Use ES without projections

  2. Build 64 bit Mono from source (it’s actually fairly easy) - I’d recommend installing in something like /opt/mono- and then creating a symbolic link from /opt/mono so you don’t have
    to keep changing paths

  3. Use this build which has 64 bit mono statically linked: https://www.dropbox.com/s/5kez7p6cw3e8hud/EventStore-Mac-v2.99.99.tar.gz

Cheers,

James

Cheers James, thanks for the swift response… will build mono now!

If I were you I’d use the statically linked version - that’s how it will present from the next RC on both Linux and OS X (though separate packages for each) :slight_smile:

However, building Mono 64 bit may be useful for other stuff as well.

Thanks again James, will give that a try first and then try to build mono…

For what it’s worth, 32-bit mono on OSX is explained here (http://tirania.org/monomac//archive/2013/Nov.html), though it’s getting on 7 months since that update… Sure would be nice to move to 64 bits in the public builds.

As I understand it this is more to do with the bindings to OSX native APIs rather than the runtime and BCL - the framework has been fine compiled as 64 bit for a long time on OSX (though may explain why there are no packages).

James

Totally – but I assume since Xamarin is mostly in the Apple & Android app-building business, I assume the wait to get all the packages working the way they want explains why the off-the-shelf build is still 32 bits. It’d be nice if they gave us precompiled 64-bit framework to save the trouble of building them. Though as you say… building them isn’t too hard.

I know it’s been a month, but I’ve (accidentally) found that the easiest way to get mono 64bit that runs ES on a mac is to follow the install instructions for getting edge-js running on a mac here: https://github.com/tjanczuk/edge#building-on-osx

Basically use homebrew and run: brew install https://raw.githubusercontent.com/tjanczuk/edge/master/tools/mono64.rb

Installs links into /usr/local/bin that can easily be removed with the standard brew commands.

Cheers.

If you just want to build from source yourself, the steps are:

  1. install automake, autoconf, libtool etc

  2. install Mono 32 bit distro

  3. git clone https://github.com/mono/mono

  4. git checkout mono-3.4.0.204

  5. ./autogen.sh --prefix=/opt/mono-3.4.0.204 --disable-nls

  6. make

  7. make install

  8. uninstall Mono 32 bit distro

  9. ln -s /opt/mono-3.4.0.204 /opt/mono

  10. export PATH = /opt/mono:$PATH

It’s a lot of faffing about - the statically linked binaries will be much easier to use. They’ve just gone out to commercial customers as RC4, so an OSS one will likely follow soon.

Cheers,

James