Installing Eureqa

From SUMOwiki
Revision as of 17:19, 8 February 2012 by Mnguyen (talk | contribs)
Jump to navigationJump to search

This page details how to get Eureqa ([1]) working in SUMO. The Matlab interface is a modified version of code found here. The original code and license agreement can be found in the EureqaModel folder in the SUMO Toolbox.

Installation

  • Go to the Eureqa website and download the latest Eureqa standalone server for your operating system
  • Place the Eureqa server in the @EureqaFactory folder which is located in the src folder of the SUMO root.
  • Make sure you have a mex compilation of the eureqa_select_SUMO.cpp which is based on code from Johannes Jenkner which you can find here. There are two possibilities either the required mex file is already included with your SUMO installation in the contrib folder (a subfolder of the src folder) or you have to build it your self.

Building the mex files yourself

On linux

  • Install the Boost C++ libraries (Boost.org) following the instructions on the Boost website. Make sure you build the asio, system, thread, date_time and serialization libraries
  • Download the Eureqa API
  • Extract the eureqa_select.zip which you can find in the EureqaModel folder
  • Edit the Makefile to point to your Matlab install, the Boost include files, the Boost library files and the Eureqa API files. Note that you don't need the "<" and ">" brackets
  • Edit Makefile to change FILE = eureqa_select -> FILE = eureqa_select_SUMO
  • Type in make in a linux terminal and the building process should start
  • When the building process is done you will have eureqa_select.mexglx file or a eureqa_select.mexa64 depending on your system architecture to put in the contrib folder.


On Windows using Visual Studio 2010 and Matlab 2009b

Note that these installation instructions require a file (mexversion.rc) which is not available in later versions of Matlab. We have yet to find a solution :). These instructions are based on these instructions and came about with the help of Joeri Ruyssinck.

  • Install the Boost C++ libraries for Windows (Boost.org). The easiest way is by watching this youtube video. Note that if you are working on a 64-bit system you need to add this "address-model=64" option to bjam.
  • If the video is not available try this website.
  • Start Visual Studio
  • Create a new Win32 project -> click next and select empty project
  • Name the project eureqa_select
  • Add mexversion.rc (matlab root\extern\include) to your project (Project -> Add Existing Item).
  • Create a .def file with the following text

  LIBRARY "eureqa_select.mexw32"
  EXPORTS mexFunction 

 if you are using a 32-bit system. Otherwise change the extension to mexw64
  • Right click on "Resource Files" in the Project Explorer and select add Existing Item and browse to the eureqa_select_SUMO.cpp file.
  • Right click on eureqa_select in the Project Explorer and select Properties
    • In C/C++ General add to "Additional Include Directory" the Matlab include directory (MatlabRoot\extern\include), the Eureqa API (the folder that contains the folder eureqa, examples and the server folder) and the Boost include files
    • In C/C++ Preprocessor properties add MATLAB_MEX_FILE as preprocessor definition
    • Under Linker General properties add to "Additional Library Directories" the folder MatlabRoot\extern\lib\win32 or win64\microsoft and the Boost library folder (BoostRoot\stage\lib)