| 1 | initial version |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
EnergyPlus 8.3.0 (have a guess)
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 2015 Win64 from the dropdown
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Hit Configure
Hit Configure again (not sure if this was needed but it gets rid of the red highlighting on the new entries)
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Add C:\OpenStudio\build\_CPack_Packages\win64\NSIS\OpenStudio-1.8.5.ffdfae3164-Win64\Python\openstudio to your environment
Test it out. Open up a Python shell and try import openstudioenergyplus
That's it. I get no error importing a module from the Python shell. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.
| 2 | No.2 Revision |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
EnergyPlus 8.3.0 (have a guess)
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 2015 Win64 from the dropdown
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Hit Configure
Hit Configure again (not sure if this was needed but it gets rid of the red highlighting on the new entries)
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Add C:\OpenStudio\build\_CPack_Packages\win64\NSIS\OpenStudio-1.8.5.ffdfae3164-Win64\Python\openstudio to your environment
Test it out. Open up a Python shell and try import openstudioenergyplus
That's it. I get no error importing a module from the Python shell. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.
| 3 | No.3 Revision |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 2015 Win64 from the dropdown
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Hit Configure
Hit Configure again (not sure if this was needed but it gets rid of the red highlighting on the new entries)
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Add C:\OpenStudio\build\_CPack_Packages\win64\NSIS\OpenStudio-1.8.5.ffdfae3164-Win64\Python\openstudio to your environmentenvironment (not sure if it will always be called this, but something similar at least)
Test it out. Open up a Python shell and try import openstudioenergyplus
That's it. I get no error importing a module from the Python shell. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.
| 4 | No.4 Revision |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 2015 Win64 from the dropdown
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Hit Keep hitting Configure
Hit Configure again (not sure if this was needed but it gets rid of until the red highlighting on the new entries)entries is all gone
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Add C:\OpenStudio\build\_CPack_Packages\win64\NSIS\OpenStudio-1.8.5.ffdfae3164-Win64\Python\openstudio to your environment (not sure if it will always be called this, but something similar at least)
Test it out. Open up a Python shell and try import openstudioenergyplus
That's it. I get no error importing a module from the Python shell. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.
| 5 | No.5 Revision |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 2015 Win64 from the dropdown
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Keep hitting Configure until the red highlighting on the new entries is all gone
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Run the installer from C:\OpenStudio\build\_CPack_Packages\win64\NSIS
__init__.py file to C:\Program Files\OpenStudio 1.8.5\Python\openstudio to make it into a Python packageAdd the following to the C:\OpenStudio\build\_CPack_Packages\win64\NSIS\OpenStudio-1.8.5.ffdfae3164-Win64\Python\openstudio to your environment (not sure if __init__.py file for all the imports. My one's here. I think it will always could be called this, but something similar at least)
better structured (@MarkAdams, any suggestions? I notice you do from openstudioutilitiescore import * here
import openstudioairflow as airflow import openstudioanalysis as analysis ...
Add C:\Program Files\OpenStudio 1.8.5\Python (or wherever you installed to) to you Python path
from openstudio importopenstudioenergyplusmodel print model.Model()
You should see:
OS:Version,
{2a919255-8208-412f-a328-62f40f74182c}, !- Handle
1.8.5; !- Version Identifier
That's it. I get no error importing a module from the Python shell. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.
| 6 | No.6 Revision |
So in answer to my own question, the issue was trying to build using Visual Studio 2015. After a few missteps I've managed to get a working build using Visual Studio 2013. Thanks definitely due to @MarkAdams!
There are five main steps to the process - setting up the tools required, cloning the source code, configuring and generating the solution file in CMake, building in Visual Studio 2013, and finally setting up your Python environment
Install the software listed:
Visual Studio 2013 with Update 5 (must be VisualStudio 2013 - trying to build with VisualStudio 2015 Community Edition failed)
msysGit for working with Git
NSIS (builds the installer that packages everything up including the Python library)
Add C:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin to the System Path
Launch Git Bash and run the following commands in the folder you want to build in. I ran directly in C: so my source folder will be C:\OpenStudio throughout this step-by-step.
git clone -b develop git@github.com:NREL/OpenStudio.git
cd OpenStudio
mkdir build
Launch CMake
Set the path to the source code: C:\OpenStudio and the build path: C:\OpenStudio\build
Hit Configure and selected Visual Studio 12 from the dropdown2015 2013 Win64
Leave the radio button on the default, Use default native compilers
CMake runs for a little while then will hit an error which prompts to set SWIG_EXECUTABLE
Set the full path to the swig.exe executable C:/swigwin-3.0.7/swig.exe
Tick BUILD_PACKAGE and BUILD_PYTHON_BINDINGS
Keep hitting Configure until the red highlighting on the new entries is all gone
Hit Generate
Open up Visual Studio 2013 and open the OpenStudio.sln file from the build directory
Build > Configuration Manager set the build configuration to Release. This is needed because we don't have python_d.lib on the system which is required for a Debug build
Set to build PACKAGE since that setting wasn't set and this answer suggested we need it
Run Build > Build solution which churns away for a few hours and eventually spits out the final product
Run the installer from C:\OpenStudio\build\_CPack_Packages\win64\NSIS
__init__.py file to C:\Program Files\OpenStudio 1.8.5\Python\openstudio to make it into a Python packageAdd the following to the __init__.py file for all the imports. My one's here. I think it could be better structured (@MarkAdams, any suggestions? I notice you do from openstudioutilitiescore import * here
import openstudioairflow as airflow import openstudioanalysis as analysis ...
Add C:\Program Files\OpenStudio 1.8.5\Python (or wherever you installed to) to you Python path
from openstudio import model print model.Model()
You should see:
OS:Version,
{2a919255-8208-412f-a328-62f40f74182c}, !- Handle
1.8.5; !- Version Identifier
That's it. That's really not as many steps as it felt like at the time! I hope this step-by-step helps someone out.