-
Notifications
You must be signed in to change notification settings - Fork 195
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_BINDINGS
in CMake - Enable
BUILD_SWIG
to make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGE
is enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGE
to 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 Java
https://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_BINDINGS
in CMake - Enable
BUILD_SWIG
to make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGE
is enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGE
to 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_BINDINGS
in CMake- This will automatically enable
BUILD_NODE
andBUILD_NODE_MODULES
which 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_SWIG
to make sure you get the most appropriate version of SWIG for the bindings you are building - Make sure
BUILD_PACKAGE
is enabled if you want an installer package to be produced. - Consider enabling
MAXIMIZE_CPU_USAGE
to 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 V8
https://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-dev
https://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_BINDINGS
in CMake - Enable
BUILD_SWIG
to make sure you get the most appropriate version of SWIG for the bindings you are building - Consider enabling
MAXIMIZE_CPU_USAGE
to 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 Python
https://github.com/NREL/OpenStudio/tree/develop/openstudiocore/python