I am running Mathematica on a Windows 10 machine and I would like to develop a package for public distribution. Most of the package will be Mathematica code, but some timing-critical parts should be in a more low-level compiled language. C is well-suited and I have some decent command of it.
The fastest and most straightforward way to include C code in Mathematica is to load library functions via LibraryLink. However, creating a library for LibraryLink requires a slightly-finicky process of calling CreateLibrary from within Mathematica. So my problem is this:
I have a Windows 10 machine. I want to create libraries that work on Linux and Mac OS X machines. If I were just compiling C code outside of Mathematica, I could do it in a Linux virtual machine. But I do not own a Mac and I'm not sure whether running Mac OS X in a virtual machine in order to compile a library is feasible.
But the problem is compounded by Mathematica: Since the library creation (CreateLibrary) happens from within Mathematica, I appear to be stuck. It is not enough just to run another OS in a virtual machine in order to compile to that target; now it appears that I must also have 3 separate Mathematica licenses!
I have scoured the documentation and the internet and have found no solution, nor even acknowledgement, of this problem. Is there something I am missing? How is one supposed to develop Mathematica packages that use LibraryLink code, while keeping them portable?