-
Notifications
You must be signed in to change notification settings - Fork 222
Building Additional Language Bindings
Wiki ▸ Building Additional Language Bindings
Have a proper build environment set up for normal OpenStudio builds for the architecture and platform you are interested in.
Install the appropriate JDK (32bit / 64bit)
When configuring OpenStudio with CMake, be sure to choose the appropriate compiler "Visual Studio 12 2013 (Win64)" for 64bit, "Visual Studio 12 2013" for 32bit.
You may install both 32bit and 64bit JDKs, the build system will automatically find the appropriate one.
sudo apt-get install openjdk-7-jdk
Install the appropriate JDK
- Enable
BUILD_JAVA_BINDINGSin CMake - Enable
BUILD_SWIGto make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGEis enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGEto fully utilize the CPU (and use more memory).
Build as normal, the bindings will be in a Products/Java subfolder.
cd OSCore-prefix/src/OSCore-build
ctest -R Javahttps://github.com/NREL/OpenStudio/tree/develop/openstudiocore/java
Have a proper build environment set up for normal OpenStudio builds for the architecture and platform you are interested in.
Only windows is supported, the C++ half of the bindings will build on all platforms, but the C# half will only build on Windows right now
- Enable
BUILD_CSHARP_BINDINGSin CMake - Enable
BUILD_SWIGto make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGEis enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGEto fully utilize the CPU (and use more memory).
Build as normal, the bindings will be in a Products/CSharp subfolder.
https://github.com/NREL/OpenStudio/tree/develop/openstudiocore/csharp
JavaScript is supported via V8. You can choose to either build for V8 directly or as a Node.js module (probably the most likely option).
Have a proper build environment set up for normal OpenStudio builds for the architecture and platform you are interested in.
Only MacOS and Linux are supported.
- Enable
BUILD_V8_BINDINGSin CMake- This will automatically enable
BUILD_NODEandBUILD_NODE_MODULESwhich builds a local, appropriate, version of Node.js and modules which can run against it. - This is the only fully supported configuration
- This will automatically enable
- Enable
BUILD_SWIGto make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGEis enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGEto fully utilize the CPU (and use more memory).
Build as normal, the bindings will be in a Products/V8 subfolder.
cd OSCore-prefix/src/OSCore-build
ctest -R V8https://github.com/NREL/OpenStudio/tree/develop/openstudiocore/v8-node
Have a proper build environment set up for normal OpenStudio builds for the architecture and platform you are interested in.
Packaging is untested on all platforms
sudo apt-get install python2.7-devhttps://www.python.org/downloads/ Allow the installer to add python to the path. Only Python 2.7 is tested currently. Only 32bit is tested currently. Only Release is tested.
To use the Python bindings from your build directory (e.g. C:\openstudio-python\build) copy all the OpenStudio dlls (along with dependencies) to C:\openstudio-python\build\OSCore-prefix\src\OSCore-build\Products\python\Release then set the following environment variable:
set PYTHONPATH = C:\openstudio-python\build\OSCore-prefix\src\OSCore-build\Products\python;C:\openstudio-python\build\OSCore-prefix\src\OSCore-build\Products\python\Release;C:\openstudio-python\openstudiocore\python;Python should already be installed.
- Enable
BUILD_PYTHON_BINDINGSin CMake - Enable
BUILD_SWIGto make sure you get the most appropriate version of SWIG for the bindings you are building - Consider enabling
MAXIMIZE_CPU_USAGEto fully utilize the CPU (and use more memory).
Build as normal, the bindings will be in a Products/Python subfolder
cd OSCore-prefix/src/OSCore-build
ctest -R Pythonhttps://github.com/NREL/OpenStudio/tree/develop/openstudiocore/python