Closed ingarpedersen closed 8 years ago
AHA... that sounds interesting... I am running an ubuntu GNU/Linux machine on a x64_86 processor...
CLRZMQ4 is actually implemented using GNU/C
libdl.so
.
CLRZMQ4 is currently looking ... into libdl.so
(Platform
will use Platform.Posix
, because there is PlatformName.Posix
)... for function pointers to dlopen
, dlclose
, dlerror
and the like...
So you basically need to implement, for example a PlatformName.Example
and a class Platform.Example
, looking like
public static partial class Platform {
public static class Example {
public const string LibraryFileExtension = ".so";
private const string KernelLib = "libdl";
public static UnmanagedLibrary LoadUnmanagedLibrary(string libraryName) // ...
public static SafeLibraryHandle OpenHandle(string filename) // ...
public static IntPtr LoadProcedure(SafeLibraryHandle handle, string functionName) // ...
public static bool ReleaseHandle(IntPtr handle) // ...
public static Exception GetLastLibraryError() // ...
Finally you need to add a detection in Platform
, to enable your PlatformName.Example
, class Platform.Example
:
static Platform() {
// ...
Version osVersion;
switch (Environment.OSVersion.Platform) {
case PlatformID.Win32Windows: // ...
Kind = PlatformKind.Win32;
Name = PlatformName.Windows;
break;
case PlatformID.Unix:
Kind = PlatformKind.Posix;
Name = PlatformName.Posix;
break;
default: // ...
}
// do some detection of your Platform and set the Name:
// Kind = PlatformKind.Posix;
// Name = PlatformName.Example;
// ...
SetupPlatformImplementation(typeof(Platform));
}
So you have a real Debian GNU/Linux... You need to look further :)
I had the same problem... I installed Linux Mint
instead of ubuntu
. Now looking for a libld.so
or libdl.so
doesn't work... because there is a /lib/x86_64-linux-gnu/libdl.so.2
or the like....
I was used to have a workaround, simply by hardlinking ln libdl.so libdl.so.2
.
Now I've made an update for the Platform
and Platform.Posix
class, to read the ld.so.conf
and to read include /etc/ld.so.conf.d/*.conf
. In Platform.Posix.EnumerateLibLdConf.
Please, do a git pull zeromq master
to try the changes.
I'm going to close the issue. Package is live on nuget.org.
When running this code in MonoDevelop (4.0.12), using Mono/.net 4.0 as target:
I get a segmentation fault at the ZContext.Create(): at <0xffffffff>
at (wrapper managed-to-native) ZeroMQ.lib.Platform/Posix.dlopen (intptr,int) IL 0x00036, 0xffffffff
at ZeroMQ.lib.Platform/Posix.OpenHandle (string) IL 0x0000d, 0x0004f
at ZeroMQ.lib.Platform/Posix.LoadUnmanagedLibrary (string) IL 0x00113, 0x0049b