How do I get started with the OpenStudio 2.0 shared library?
In Openstudio 2.0 we have a shared library openstudio.SO. Could anybody point me to some documentation as to how to get started with the shared library in Ruby/Python and come up with our own RESTful API?
I tried to go through GitHub and SDK documentation but didn't find any reference that would help me get started with implementing the shared lib.
Karthick has an early build of OpenStudio 2.0 from me. The openstudio.so he is referring to here is the OpenStudio ruby bindings as they have always been, just packaged up in a single portable binary file called openstudio.so. In Ruby,
require 'openstudio'
works the same as it always has with this package, it is just much more compact with no more external dependencies.Knowing that openstudio.so is just the OpenStudio Ruby bindings of the future perhaps folks can chime in with any experiences building web application on the OpenStudio SDK.
Thanks Kyle. Correct me if I am wrong.. is openstudio.rb the source for openstudio.so... Am just asking.
That is not exactly correct. In the OpenStudio 1.x series, openstudio.rb is the entry point to load up the API. I say entry point because openstudio.rb does not contain hardly any of the actual API methods. Instead openstudio.rb just loads up a series of dlls and resource files that encapsulate the core C++ API and make it available in Ruby.
In other words the vast majority of the OpenStudio API is not implemented in ruby (.rb) files at all. OpenStudio Ruby API is a big "native" extension writing in C++ and exported to ruby.
In 2.0 we are focusing on making things more compact. To that end we are repacking the Ruby API into a single binary file called openstudio.so which has the all of those dlls and resource files that openstudio.rb depends on, statically linked. We create the .so in such a way that when you
require 'openstudio'
Ruby knows what to do. Loading a binary file like this is not unique to OpenStudio. This is commonly referred to as a Ruby native extension. Typically people create these types of extensions for performance reasons or to gain access to a large C/C++ API like OpenStudio.Thanks Kyle. That background is useful.