Skip to content

Configuring OpenStudio Build Environments

axelstudios edited this page Sep 19, 2014 · 85 revisions

WikiConfiguring OpenStudio Build Environments

Contents

Recommended: Using the Superbuild

Advanced: Manual Build Instructions

Using the Superbuild

This is the fastest, most reliable method of getting a working OpenStudio build. These instructions assume that you have successfully cloned the OpenStudio repository already.

Windows

Install Visual Studio 2013, Visual Studio 2013 Update 3, CMake, Qt, msysGit, and EnergyPlus 8.1.

Add C:\Qt\Qt5.3.1\5.3\msvc2013_opengl\bin to the System Path variable.

Clone the repository, create a build directory, and launch CMake:

Linux

Install the command line tools and EnergyPlus 8.1.

sudo apt-get install dpkg-dev git cmake-curses-gui libqt4-dev libboost-all-dev libxt-dev

Clone the repository, create a build directory, and launch CMake:

Mac

Install Xcode, CMake, and EnergyPlus 8.1.

Clone the repository, create a build directory, and launch CMake:


Manual Build Instructions

Windows Configuration

Prerequisites

Install msysGit

Install CMake

Latest v3.0.1 tested and working

Install EnergyPlus 8.1

For Building Documentation

Install Doxygen

Latest v1.8.7 tested and working

Install Graphviz

Latest v2.38 tested and working

For Using Radiance

Install Radiance using the installer

Latest v4.2a tested and working

For Building Installer Packages

Install NSIS

v2.46 tested and working

Windows 7/8.1, Visual Studio 2013

Install Visual Studio 2013, as well as Visual Studio 2013 Update 3

32-bit

Install Boost, or use the CMake option BUILD_BOOST

Latest v1.55.0 build2 tested and working

Install Qt

Append C:\Qt\Qt5.3.1\5.3\msvc2013_opengl\bin; to the System Path variable

Latest v5.3.1 VS2013 OpenGL tested and working

Extract SWIG to C:\swig

Append C:\swig\swigwin-3.0.2; to the System Path variable

Latest v3.0.2 tested and working

64-bit

Install Boost

v1.55.0 build2 x64 tested and working

Install Qt Append C:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl\bin; to the System Path variable

v5.3.1 VS2013 x64 OpenGL tested and working

The BUILD_SWIG CMake option is required for 64-bit builds, so it should be enabled.

Within CMake, choose Visual Studio 12 2013 Win64 as the generator for the project.

Express

Install Visual Studio Express 2013 (all of the optional installs are unnecessary and may be unchecked), as well as Visual Studio 2013 Update 3

The MSVC_IS_EXPRESS CMake option is required and should be enabled.

Linux Configuration

Ubuntu 14.04 (x64)

Build Dependencies:

sudo apt-get install dpkg-dev git cmake-curses-gui qt5-default libqt5webkit5-dev libboost1.55-all-dev swig libssl-dev libxt-dev doxygen graphviz

wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz
tar -xzf ruby-2.0.0-p451.tar.gz
rm ruby-2.0.0-p451.tar.gz
cd ruby-2.0.0-p451
./configure --enable-shared --prefix=/usr/local
make -j2
sudo make install
cd ..
rm -rf ruby-2.0.0-p451

sudo ln -fs /usr/local/bin/ruby /usr/bin/ruby

For much faster builds, compile with Clang:

sudo su
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|apt-key add -
apt-add-repository 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main'
exit
echo 'export CC=/usr/bin/clang-3.5' >> ~/.bashrc
echo 'export CXX=/usr/bin/clang++-3.5' >> ~/.bashrc

EnergyPlus 8.1

sudo su
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|apt-key add -
apt-add-repository 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main'
exit
echo 'export CC=/usr/bin/clang-3.5' >> ~/.bashrc
echo 'export CXX=/usr/bin/clang++-3.5' >> ~/.bashrc

Mac Configuration

Prerequisites

Install EnergyPlus 8.1

Install CMake with the option of creating symbolic links in /usr/bin

Install Xcode from the App Store

Install SWIG

curl -LO ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
tar -xzf pcre-8.35.tar.gz
rm pcre-8.35.tar.gz
cd pcre-8.35
./configure
make
sudo make install
cd ..
rm -rf pcre-8.35
curl -LO http://developer.nrel.gov/downloads/buildings/openstudio/src/swig-3.0.2.tar.gz
tar -xzf swig-3.0.2.tar.gz
rm swig-3.0.2.tar.gz
cd swig-3.0.2
patch -p1 < ~/openstudio/dependencies/swig_ruby_patch.patch
./configure
make
sudo make install
cd ..
rm -rf swig-3.0.2

Modify ~/.bash_profile to help give CMake defaults for the build options

export CMAKE_OSX_ARCHITECTURES='i386;x86_64'
export MACOSX_DEPLOYMENT_TARGET=10.9

For Building Installer Packages

Download the Auxiliary Tools for Xcode - Late July 2012 from https://developer.apple.com/downloads/ then drag PackageMaker.app to /Applications/

For Building Documentation

Download Doxygen and drag it to Applications

Install Graphviz

OS X 10.9

Install Boost

curl -LO http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
tar -xzf boost_1_55_0.tar.gz
rm boost_1_55_0.tar.gz
cd boost_1_55_0
patch -p1 < ~/openstudio/dependencies/Boost/xcode_51.patch
sh ./bootstrap.sh
sudo ./b2 toolset=clang cxxflags="-arch i386 -arch x86_64 -std=c11 -std=c++11 -stdlib=libc++" linkflags="-arch i386 -arch x86_64 -std=c11 -std=c++11 -stdlib=libc++" variant=debug,release define=BOOST_CHRONO_HEADER_ONLY --layout=tagged --with-filesystem --with-regex --with-program_options --with-system --with-thread --with-date_time --with-log install --prefix=/usr/local -j2
cd ..
rm -rf boost_1_55_0

Install Qt

curl -LO http://qt.mirror.constant.com/archive/qt/5.3/5.3.1/single/qt-everywhere-opensource-src-5.3.1.tar.gz
tar -xzf qt-everywhere-opensource-src-5.3.1.tar.gz
rm qt-everywhere-opensource-src-5.3.1.tar.gz
cd qt-everywhere-opensource-src-5.3.1
cp -r ~/openstudio/dependencies/qt/macx-clang-32-64 qtbase/mkspecs/
./configure -v -sdk macosx10.9 -platform macx-clang-32-64 -release -opensource -openssl -no-pch -no-ssse3 -qt-sql-sqlite -plugin-sql-sqlite -skip enginio -no-compile-examples -nomake examples -nomake tests -nomake tools -skip qtmultimedia -confirm-license
make -j2
sudo make install
cd ..
rm -rf qt-everywhere-opensource-src-5.3.1
echo 'export PATH=$PATH:/usr/local/Qt-5.3.1/bin' >> ~/.bash_profile