Skip to content

Instantly share code, notes, and snippets.

@yan12125
Last active May 13, 2018 14:21
Show Gist options
  • Save yan12125/d7a07f61a973f94b3111 to your computer and use it in GitHub Desktop.
Save yan12125/d7a07f61a973f94b3111 to your computer and use it in GitHub Desktop.
Build instruction and patch file for hornet-1.0
diff -ur hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp
--- hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp 2011-06-01 21:51:37.000000000 +0800
+++ hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp 2014-05-04 02:58:12.144146742 +0800
@@ -7,7 +7,7 @@
#ifndef BOOST_TASKS_DETAIL_BIND_PROCESSOR_H
#define BOOST_TASKS_DETAIL_BIND_PROCESSOR_H
-#include <boost/task/detail/config.hpp>
+//#include <boost/task/detail/config.hpp>
# if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define BOOST_HAS_PROCESSOR_BINDINGS 1
diff -ur hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor_linux.hpp hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor_linux.hpp
--- hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor_linux.hpp 2011-06-01 21:51:37.000000000 +0800
+++ hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor_linux.hpp 2014-05-04 02:57:55.310812847 +0800
@@ -38,7 +38,7 @@
throw boost::system::system_error(
boost::system::error_code(
errno_,
- boost::system::system_category) );
+ boost::system::system_category()) );
}
inline
@@ -56,7 +56,7 @@
throw boost::system::system_error(
boost::system::error_code(
errno_,
- boost::system::system_category) );
+ boost::system::system_category()) );
}
}}
diff -ur hornet-1.0/src/cpu/instr2code hornet-1.0-mod2/src/cpu/instr2code
--- hornet-1.0/src/cpu/instr2code 2011-06-01 21:51:37.000000000 +0800
+++ hornet-1.0-mod2/src/cpu/instr2code 2014-05-04 02:58:20.320813684 +0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
from __future__ import with_statement
diff -ur hornet-1.0/src/tools/darimg hornet-1.0-mod2/src/tools/darimg
--- hornet-1.0/src/tools/darimg 2011-06-01 21:51:37.000000000 +0800
+++ hornet-1.0-mod2/src/tools/darimg 2014-05-04 02:58:26.930813903 +0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# -*- mode:python; indent-tabs-mode:nil; -*-
# vim:set expandtab shiftwidth=4 filetype=python:
0. Download and extract
(1) 下載http://csg.csail.mit.edu/hornet/downloads/hornet-1.0.tbz
(2) tar jxvf hornet-1.0.tbz
(3) cd hotnet-1.0.tbz
1. Install nesessary packages
sudo apt-get install g++
sudo apt-get install patch
sudo apt-get install libboost-all-dev
sudo apt-get install qmtest
1.5 Install the MIPS compiler
(1) 下載https://sourcery.mentor.com/GNUToolchain/package12215/public/mips-linux-gnu/mips-2013.11-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
(2) tar jxvf mips-2013.11-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
(3) sudo mv mips-2013.11 /opt/
(4) sudo vim /etc/profile.d/mips-gcc.sh,內容打
export PATH=$PATH:/opt/mips-2013.11/bin/
(5) 關掉terminal再開一遍
2. modify some files
(1) 下載hornet-1.0.patch
(2) cd hornet-1.0/
(3) patch -p1 -i ../hornet-1.0.patch
3. Compile
./configure --enable-mips-rts --with-mips-ld=mips-linux-gnu-ld --with-mips-as=mips-linux-gnu-as --with-mips-cc=mips-linux-gnu-gcc --with-mips-ar=mips-linux-gnu-ar --with-mips-ranlib=mips-linux-gnu-ranlib
make AM_CXXFLAGS=-Wall LDFLAGS=-pthread
sudo env PATH=$PATH make install
4. Run hello
cd examples/hello/
make
darsim hello.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment