Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "Building OLA for Windows"

From wiki.openlighting.org

Jump to: navigation, search
 
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This describes how to get OLA compiled for windows, it's a work in progress so it's unlikely to work as is.
+
This describes how to get OLA compiled for windows, it's a work in progress so it's unlikely to work as is. This tutorial uses gcc as the compiler, other compilers have not been tested.
 +
 
 +
During [[GSOC2014WindowsPort|Google Summer of Code 2014]], this port will be worked on as one of the selected projects.
  
 
== Install Mingw, msys & build tools ==
 
== Install Mingw, msys & build tools ==
  
The instructions at http://www.mingw.org/wiki/MSYS are very helpful. There are similar instructions at http://www.cccp-project.net/wiki/index.php?title=Installing_MSYS-MinGW
+
Together MinGW & msys provide a unix-style shell environment & compiler suite for windows. Read the instructions at the [http://www.mingw.org/ MinGW] site for more info. MinGW now provides an installer to get most of the system up and running quickly. [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/ Download] the installer and make sure you select "C++ Compiler". "MSYS Basic System" & "MinGW Developer Toolkit" when prompted.
 +
 
 +
Once the installer has completed, open the msys shell (under Programs > MinGW) and install some additional packages:
 +
 
 +
$ mingw-get.exe install msys-coreutils mingw32-base mingw32-pthreads-w32 msys-wget
 +
 
 +
Note that some of these might already have been installed.
 +
 
 +
== Install Git ==
 +
 
 +
Git is used to checkout (and commit) the ola sources.  See http://code.google.com/p/msysgit/, be sure to select "checkout as is, commit unix style" during the install otherwise you'll get autoconf errors.
  
* Install mingw and msys
+
Add the following line to your .bashrc file so that git can be used within msys:
  
* Download these packages
+
PATH="$PATH:/c/Program Files/Git/bin"
** autoconf [http://ftp.gnu.org/gnu/autoconf/]
+
alias git=git.exe
** automake [http://ftp.gnu.org/gnu/automake/]
 
** libtool [http://ftp.gnu.org/gnu/libtool/]
 
  
* Launch the msys shell
+
If you are on 64bit windows you may need to use:
  
* Unpack autoconf, automake and libtool to a directory of your choice.
+
PATH="$PATH:/c/Program Files (x86)/Git/bin"
 +
alias git=git.exe
  
* Install each of them with the following command:
+
== Install pkg-config ==
  
$ ./configure --prefix=/mingw && make && make install
+
Download pkg-config-lite from http://sourceforge.net/projects/pkgconfiglite/files/ (the latest binary should work) and extract it to your MinGW directory.
  
* Update PKG_CONFIG_PATH
+
You also need to add
  
As all the libraries will be installed in /mingw, PKG_CONFIG_PATH must be set.
+
  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 +
  CPPFLAGS="-I/usr/local/include"
 +
  LDFLAGS="-L/usr/local/lib"
  
Open the file /etc/profile (C:\msys\1.0\etc\profile) with your favorite editor (make sure it uses LF line endings) and add:
+
to your .bashrc file.
  
PKG_CONFIG_PATH="/mingw/lib/pkgconfig"
+
You might also want to edit your .profile file and add <pre>[ -f ~/.bashrc ] && . ~/.bashrc</pre>
  
You might also want to set CFLAGS. Safe options for MinGW are:
+
If you haven't configured your MSYS fstab yet, do that as well. See http://www.mingw.org/wiki/Getting_Started for instructions.
 +
  
CFLAGS="-pipe -O2 -mms-bitfields -march=i686"
+
== Install Dependencies ==
  
just before
+
=== pkg-config ===
 +
* Download pkg-config-lite from http://sourceforge.net/projects/pkgconfiglite/files/
 +
* Extract to MinGW directory
  
export HOME LOGNAME MSYSTEM HISTFILE
+
=== Python (optional) ===
 +
* Tested version: 2.7 series
 +
* Download and install Python for Windows from https://www.python.org/downloads/
  
and modify that line by adding the variables:
+
=== msys-git ===
 +
* Download msysgit from https://code.google.com/p/msysgit/downloads/list
 +
* Install and make sure to select "Check-out as is, commit UNIX-style"
  
export HOME LOGNAME MSYSTEM HISTFILE CFLAGS PKG_CONFIG_PATH
+
=== libuuid ===
 +
* Download and extract the latest libuuid tarball from https://code.google.com/p/gnome-build-stage-1/downloads/list
 +
* Configure, compile and install it using the MinGW MSYS shell
  
Now restart MSYS. You should now be able to use MSYS without problems.
+
=== protobuf ===
         
+
* Download and extract the latest protobuf tarball from https://code.google.com/p/protobuf/downloads/list
== Install Git ==
+
* Configure, compile and install it using the MinGW MSYS shell
 +
* if you want to use the OLA Python api, install the protobuf Python bindings from the 'python' subdirectory
  
See http://code.google.com/p/msysgit/, be sure to select "unix style carriage returns" otherwise you'll get autoconf errors.
+
=== cppunit ===
 +
* Download and extract the latest cppunit tarball from http://sourceforge.net/projects/cppunit/files/cppunit/
 +
* Configure, compile and install it using the MinGW MSYS shell
  
== Install Dependencies ==
+
=== libmicrohttpd ===
 +
* Download and extract the latest libmicrohttpd tarball from http://ftp.gnu.org/gnu/libmicrohttpd/
 +
* Configure, compile and install it using the MinGW MSYS shell
  
* http://code.google.com/p/protobuf/ . Note you need to install the .tar.gz as the zip just contains protoc (we need the libraries as well)
+
=== liblo (optional) ===
* http://www.ossp.org/pkg/lib/uuid/ , be sure to run configure with  ./configure --prefix=/mingw --includedir /mingw/include/ossp
+
* Download and extract the latest version of liblo from http://liblo.sourceforge.net/
* http://sourceforge.net/projects/cppunit/files/ , download version
+
* Configure, compile and install it using the MinGW MSYS shell
* http://code.google.com/p/google-ctemplate/
 
  
 
== Build OLA ==
 
== Build OLA ==
Line 57: Line 83:
 
* Do a git checkout of OLA
 
* Do a git checkout of OLA
  
* Run ./configure and disable runtime loadable plugins (not supported on windows)
+
  $ git.exe clone https://github.com/OpenLightingProject/ola.git
   $ ./configure --disable-ltdl
+
 
 +
* Prepare autotools files
 +
  $ autoreconf -i -f
 +
 
 +
* Run ./configure
 +
   $ ./configure --enable-python-libs --disable-e131 --disable-karate --disable-milinst --disable-renard --disable-spi --disable-stageprofi --disable-usbpro --disable-usbdmx --disable-uart
  
 
* Build
 
* Build
 
   $ make
 
   $ make
  
== Current TODO ==
+
* Optional: Run the tests
 +
  $ make check
 +
 
 +
* Install
 +
  $ make install
 +
 
 +
== Current State / TODO ==
 +
 
 +
See the [[GSOC2014WindowsPort|GSOC project page]].
  
* Fix the Socket & SelectServer classes
+
== Misc Notes ==
  
== Problems ==
+
You may run into issues with the latest mingw and protobufs. During runtime it can't find libstdc++-6.dll. Attempt to follow this and see if any of the solutions fixes your problem. We'd love to hear the outcome on irc or the forums.
 +
http://stackoverflow.com/questions/6404636/libstdc-6-dll-not-found
  
* The released version of ctemplate doesn't build, http://code.google.com/p/google-ctemplate/issues/detail?id=48 indicates head should work.
+
Sean Sill:
 +
I ended up removing libstdc++.dll.a from the C:/MinGW/libs folder.

Latest revision as of 14:26, 30 November 2014

This describes how to get OLA compiled for windows, it's a work in progress so it's unlikely to work as is. This tutorial uses gcc as the compiler, other compilers have not been tested.

During Google Summer of Code 2014, this port will be worked on as one of the selected projects.

Install Mingw, msys & build tools

Together MinGW & msys provide a unix-style shell environment & compiler suite for windows. Read the instructions at the MinGW site for more info. MinGW now provides an installer to get most of the system up and running quickly. Download the installer and make sure you select "C++ Compiler". "MSYS Basic System" & "MinGW Developer Toolkit" when prompted.

Once the installer has completed, open the msys shell (under Programs > MinGW) and install some additional packages:

$ mingw-get.exe install msys-coreutils mingw32-base mingw32-pthreads-w32 msys-wget

Note that some of these might already have been installed.

Install Git

Git is used to checkout (and commit) the ola sources. See http://code.google.com/p/msysgit/, be sure to select "checkout as is, commit unix style" during the install otherwise you'll get autoconf errors.

Add the following line to your .bashrc file so that git can be used within msys:

PATH="$PATH:/c/Program Files/Git/bin"
alias git=git.exe

If you are on 64bit windows you may need to use:

PATH="$PATH:/c/Program Files (x86)/Git/bin"
alias git=git.exe

Install pkg-config

Download pkg-config-lite from http://sourceforge.net/projects/pkgconfiglite/files/ (the latest binary should work) and extract it to your MinGW directory.

You also need to add

 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 CPPFLAGS="-I/usr/local/include"
 LDFLAGS="-L/usr/local/lib"

to your .bashrc file.

You might also want to edit your .profile file and add
[ -f ~/.bashrc ] && . ~/.bashrc

If you haven't configured your MSYS fstab yet, do that as well. See http://www.mingw.org/wiki/Getting_Started for instructions.


Install Dependencies

pkg-config

Python (optional)

msys-git

libuuid

protobuf

  • Download and extract the latest protobuf tarball from https://code.google.com/p/protobuf/downloads/list
  • Configure, compile and install it using the MinGW MSYS shell
  • if you want to use the OLA Python api, install the protobuf Python bindings from the 'python' subdirectory

cppunit

libmicrohttpd

liblo (optional)

  • Download and extract the latest version of liblo from http://liblo.sourceforge.net/
  • Configure, compile and install it using the MinGW MSYS shell

Build OLA

  • Do a git checkout of OLA
 $ git.exe clone https://github.com/OpenLightingProject/ola.git
  • Prepare autotools files
 $ autoreconf -i -f
  • Run ./configure
 $ ./configure --enable-python-libs --disable-e131 --disable-karate --disable-milinst --disable-renard --disable-spi --disable-stageprofi --disable-usbpro --disable-usbdmx --disable-uart
  • Build
 $ make
  • Optional: Run the tests
 $ make check
  • Install
 $ make install

Current State / TODO

See the GSOC project page.

Misc Notes

You may run into issues with the latest mingw and protobufs. During runtime it can't find libstdc++-6.dll. Attempt to follow this and see if any of the solutions fixes your problem. We'd love to hear the outcome on irc or the forums. http://stackoverflow.com/questions/6404636/libstdc-6-dll-not-found

Sean Sill: I ended up removing libstdc++.dll.a from the C:/MinGW/libs folder.