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
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).
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).
Hello!
I’d like to throw in my experience.
I’ve been trying to do exactly the same, namely to have a dotnet core linux project use rhino3dm … I had good experience with a dotnet core (even narrower, just dotnetstandard) project that worked both on linux and windows fine, without anything Rhino.
I then wanted to include rhinodm and got a windows dotnetstandard project to work that used rhino3dm. In order to make that work, I had to circumvent all nuget mechanisms and had to load the libraries “organically”. The result was good, a pure dotnetstandard project that uses rhino3dm!
Then, I tried to run that project on linux.
I finally figured out how to compile opennurbs by using clang and introducting quite few tweaks into the makefile.
Then, I tried to make a reasonable dotnet core project out of the .csproj files hidden within
and that’s where I’m stuck currently. But I already have the opennurbs shared object so that it feels as if I’m not too far anymore from the finish line.
Any help/remarks would be appreciated!
In the 6.15 code branch OpenNURBS already builds unmodified on Linux using Clang. Not sure what the timetable is to get that code into the public OpenNURBS repo, @will ?
It is very similar to the OpenNURBS branch used by the rhino3dm project. That OpenNURBS version works fine on Linux. I’ve used it already to create the import_3dm add-on for Blender to import 3dm files, works also on Linux.
Thank you for the answer.
I should have added that I had to use a Rhino 5 version of opennurbs because the remaining C++ files in the rhinocommon github repository linked above seem to be Rhino 5 only.
By the way, getting the old Rhino 5 version of opennurbs wasn’t easy, the McNeel download link redirects to Rhino 6, so I had to check out an old commit of louipc’s fork of opennurbs: https://github.com/louipc/opennurbs and only then could I compile at least the C++ source files of rhinocommon into the shared object.
So, I’m afraid the Rhino 6 version of opennurbs alone won’t be of much help because the remaining C++ files needed for the C# wrapper around opennurbs are unavailable for Rhino 6.
If I get it correctly, the new rhino3d github repo is Rhino 6 but it only targets javascript and python but does not provide the C# wrapper around opennurbs, as needed for a dotnet core project. So I’m reliant upon the old Rhinocommon github repo for the C# wrapper.
$ make -e CC="clang" CCC="clang++" LINKFLAGS="-luuid"
For Ubuntu 18.04 you can install build tools/dependencies using sudo apt install make clang uuid-dev. For Amazon Linux 2, sudo yum install make clang libuuid-devel.
One step closer to Rhino3dmIO running in .NET Core on Linux…