-
Notifications
You must be signed in to change notification settings - Fork 85
Linux Build Instructions
The open source and NREL release-build platform is CentOS 7 and has been built on Ubuntu 16.04, Fedora 25 and Mint 18.2. The minimum gcc version supported is 4.8.5 and the minimum libc support is 2.17. The gcc and libc versions can be found by:
gcc --version
ldd --version
Before you begin, you will need to install git
and g++
if they are not already installed. For example:
sudo apt-get install git
sudo apt-get install g++
-
The source code for the LK, WEX, and SSC projects should go in a single parent directory. The
git clone
command automatically creates a directory for the repository, so you do not need to create a directory before you clone it. You may first need to install git withsudo apt install git
.cd sam_dev for repo in lk wex ssc ; do git clone https://github.com/nrel/$repo ; done
Note. You can also download the repositories from GitHub as
.zip
files instead of cloning them. If you do that, be sure to extract them into directories namedlk
,wex
, andssc
, so that the makefiles can find them. -
The following packages are required and can be downloaded from
apt-get
:build-essential
,libgtk2.0-dev
,libgl1-mesa-dev
,mesa-common-dev
,freeglut3-dev
, andlibcurl4-openssl-dev
.sudo apt-get install <PACKAGE NAME>
-
Download wxWidgets-3.1.0 (https://www.wxwidgets.org/downloads/) source code for Linux.
-
From a terminal, unzip the file to a permanent folder like
/home/<USERNAME>/wxWidgets-3.1.0
:bunzip2 -d wxWidgets-3.1.0.tar.bz2 tar xvf wxWidgets-3.1.0.tar
-
Create a new folder in the wxWidgets folder you created in Step 2 so that each build can be installed to a different folder (remember to change
/path/to
to the actual path):cd /path/to/wxWidgets-3.1.0 mkdir release-build cd release-build
-
Call
../configure
with options found in/sam_dev/sam/build_linux/wxconfigure_3.1.0.linux64
(again, remember to change/path/to
to the path to your wxWidgets-3.1.0 folder):#export CXXFLAGS=-std=c++11 $(CFLAGS) $(CXXFLAGS) #export OBJCXXFLAGS=-std=c++11 $(OBJCXXFLAGS) #export LDFLAGS=-std=c++11 $(LDFLAGS) ../configure --prefix=/path/to/wxWidgets-3.1.0/release-build --enable-shared=no --enable-stl=yes --enable-debug=no --with-gtk=2 --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --without-libjbig --without-liblzma --without-gtkprint --with-libnotify=no --with-libmspack=no --with-gnomevfs=no --with-opengl=yes --with-sdl=no --with-cxx=11
-
Once configure is done, call
make
. -
Look for
wx-config
in/path/to/wxWidgets-3.1.0/release-build/bin
and make a note of the complete path. -
Create a
wx-config-3
symbolic link pointing to the path you found in Step 6 so that the makefiles can find the correct wxWidgets version to run:sudo ln -s /path/to/wx-config /usr/bin/wx-config-3
-
Test the wxWidgets build:
wx-config-3 --cflags
If the build was successful, you should see:
-I/usr/<USERNAME>/wxWidgets-3.1.0/release-build/lib/wx/include/gtk2-unicode-static-3.1 -I/usr/<USERNAME>/wxWidgets-3.1.0/release-build/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -D__WXGTK__ -pthread
Environment variables store values for programs and processes on your computer. The SSC build script use three environment variables to determine where the files it needs are stored on your computer. Before building the projects, you should set the following environment variables to point to each of the project folders you created in Step 1.
Name | Value (Folder Path) |
---|---|
LKDIR | /path/to/lk/ |
WEXDIR | /path/to/wex |
SSCDIR | /path/to/ssc |
To conveniently set your environment variables to be set every time you open a terminal, set them in your user .bashrc file:
gedit $HOME/.bashrc
And then in the file:
export LKDIR=/path/to/lk
export WEXDIR=/path/to/wex
export SSCDIR=/path/to/ssc
Finally, save and close the file and:
source $HOME/.bashrc
- For LK, WEX and SSC, in that order, go to the
build_linux
folder and callmake
. A fatal error like "wx/string.h no such file or directory" might be caused by an incorrectwx-config-3
symbolic link or a problem with the wxWidgets build.