Dotnet core on linux


#1

I may be crazy, but I’m trying to get Rhino3DMIO to work under dotnet core on linux. It works on Windows, but it looks like it’s not finding the native dynamic library on linux. librhino3dmio_native.dylib is being copied into the bin directory when I build the project

Here is the error message I get when running some unit tests:

Failed
Error Message:
System.InvalidOperationException : Failed to read 3dm file /tmp/myfile.3dm.
Unable to load shared library ‘librhino3dmio_native’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibrhino3dmio_native: cannot open shared object file: No such file or directory
----> System.DllNotFoundException : Unable to load shared library ‘librhino3dmio_native’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibrhino3dmio_native: cannot open shared object file: No such file or directory
Stack Trace:

–DllNotFoundException
at UnsafeNativeMethods.StringHolder_New()
at Rhino.Runtime.InteropWrappers.StringHolder…ctor()
at Rhino.FileIO.File3dm.ReadWithLog(String path, String& errorLog)

System Details

I’m currently using dotnet 2.2 preview 3 tyring to work around some existing bugs in dotnet core 2.1.
I’m running RHEL 7.6


(Dale Fugier) #3

Hi @Brad_Campbell,

Doesn’t sound that crazy. :wink:

I’m asking around to see if anyone here has tried.

Just curious, why do you need Rhino3dmIo on Linux? What are you trying to do?

If I recall correctly, the Rhino3dmIO on GitHub requires openNURBS 5. Did you find this and build?

– Dale


(Steve Baer) #4

We only compile Rhino3dmIO for Windowss, Mac, iOS and Android. We probably need to create another compile for android


#5

I have an application that we were previously running on linux using mono. The application uses a Rhino file as part of its input. I’ve been porting it to dotnet core because I see a lot of benefit there (perfomance and maintainability). I’m using the nuget package for Rhino3mdIO.Desktop (this is probably important to mention here).


#6

So is the librhino3dmio_native.dylib that ends up on linux actually the android or Mac version?


#7

And, Steve, that would be great to get a linux build.


(Steve Baer) #8

If you are using the “desktop” version from nuget, then the Mac version is what the dylib is.

We do have a native python package that runs on Linux if that is any help.


#9

That doesn’t help with this particular problem, but that is very good to know! Is this what you are talking about: https://pypi.org/project/rhino3dm/#files (I don’t see a linux whl file there).


(Steve Baer) #10

Yes, linux builds itself from source since there are so many different distributions out there. pip install rhino3dm should work just fine on Linux


#12

Cool. Back to dotnet, are you able to add a linux build to the nuget package?


(Steve Baer) #13

We’ll take a look. We may have to just target a specific set of popular versions of Linux


#14

To decide which ones, I would suggest taking a look at this: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog . And +1 for RHEL 7. We also have some systems with Suse.