I just grabbed the Marching Cubes demo code from here:

http://paulbourke.net/geometry/polygonise/

More specifically, the "marchingsource.cpp" code. It is C++, but really plain C, using GLUT. That means a very simple program structure, and very portable indeed. I could easily make it run perfectly on my Mac. Then I decided to port it to FPC.



Source: http://www.ragnemalm.se/lightweight/marchingsource.pas

This is converted and tested under OSX, but the code should be easy to port anywhere.

Seriously, this is not the most modern code around. In particular, it uses OpenGL immediate mode, which should be replaced by arrays for better performance. To make it really good, computations should be performed on the GPU as far as possible.

This might have been ported before, but I couldn't find anything like that in the forum so maybe it can be of some interest, not least considering its potential usage for water simulations.