Rhino C++ SDK / OpenNurbs in Package Manager

I have a Cpp lib that some of my C# Grasshopper plugin used and shared.

Now I want to add support to macOS, and it seems I need to also compile it on macOS for macOS.

As a windows user, this also means getting a Mac machine and learn to use it (Xcode, installing SDK, etc.)

Is there any plan from the McNeel side to provide Rhino C++ SDK in any of the package manager? vcpkg, ninja etc, so that developers can automate the process through a scripted way of setting up an environment?

Since C++ SDK is not available for macOS, then OpenNurbs is the option to go?

It seems McNeel doesn’t want to make a port for vcpkg:

Is this still the case? If so, then the question is:

What is the correct way to compile a cpp lib for macOS?

Hi @xliotx,

Here is some information on wrapping C++ libraries.

There is no Rhino C++ SDK for macOS. Your C++ code will need to be Rhino-free.

– Dale

Rhino-free is fine, but can I use OpenNurbs?

I need to pass some mesh object back and forth.
Or passing by points/edges and reconstruction is the only way to go?

Yes, you can build openNURBS on macOS

– Dale

And this needs to be done manually?

Is there any plan to provide openNURBS on any of the package manager system, like vcpkg, ninja etc?

Also, official doc for openNURBS is for Windows platform:

Yes. But, the openNURBS distribution comes with a .xcodeproj. So building isn’t all that difficult.

We’ve had wishes for this. But for now, you’ll need to pull source and build yourself.

– Dale

May I ask what is blocking it?

One big issue is our use of zlib for compressing meshes, bitmaps, and embedded files. MS, for examples, wants us to the vcpkg version of zlib. But, we need tight control over the version, as there are millions of 3dm files in the field, and we don’t take updating this lightly. So this is a show stopper (there may be more).

Package managers are terrific for building complicated source source libraries with lots of dependencies. But openNURBS isn’t this - the repo has all you need and its very easy to build.

– Dale

2 Likes

True and very well said.

I guess I’m one of the few that is really digging the rabbit hole here – trying to support multiple-platform with unmanaged code, without a mac machine.

The current status of openNURBS makes developing cpp part for macOS really difficult without a real Mac machine.

If McNeel can provide a package-manager version, then compiling process can happen on GitHub Actions, so that the user can just develop everything on a Windows machine and support multi-platform.

I guess I’ll eventually implement an independent library to replace openNURBS, just to manage the I/O of discrete geometries (polylines, meshes, points, etc.) between C# and Cpp. This will allow me to automate everything through a “CMake + vcpkg” approach on multiple platform.

1 Like