Development:Compiling: Difference between revisions

From Adonthell
Jump to navigation Jump to search
No edit summary
m Reverted edits by Asipicabad (talk) to last revision by Ksterker
Line 1: Line 1:
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://akekuqegify.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
----
=[http://akekuqegify.co.cc CLICK HERE]=
----
</div>
__NOTOC__
__NOTOC__


Line 19: Line 11:


==== google-glog ====
==== google-glog ====
# Get the source: &lt;pre>wget http://google-glog.googlecode.com/files/glog-0.3.0.tar.gz&lt;/pre>
# Get the source: <pre>wget http://google-glog.googlecode.com/files/glog-0.3.0.tar.gz</pre>
# Unpack the source: &lt;pre>tar xvzf glog-0.3.0.tar.gz&lt;/pre>
# Unpack the source: <pre>tar xvzf glog-0.3.0.tar.gz</pre>
# Build and install: &lt;pre>cd glog-0.3.0&amp;#13;./configure &amp;&amp; make &amp;&amp; sudo make install&lt;/pre>
# Build and install: <pre>cd glog-0.3.0&#13;./configure && make && sudo make install</pre>


==== googletest ====
==== googletest ====
# Get the source: &lt;pre>wget http://googletest.googlecode.com/files/gtest-1.4.0.tar.gz&lt;/pre>
# Get the source: <pre>wget http://googletest.googlecode.com/files/gtest-1.4.0.tar.gz</pre>
# Unpack the source: &lt;pre>tar xvzf gtest-1.4.0.tar.gz&lt;/pre>
# Unpack the source: <pre>tar xvzf gtest-1.4.0.tar.gz</pre>
# Get the patch: &lt;pre>wget http://www.jmglov.net/opensource/src/gtest-1.4.0_pkg-config.patch&lt;/pre>
# Get the patch: <pre>wget http://www.jmglov.net/opensource/src/gtest-1.4.0_pkg-config.patch</pre>
# Patch the source: &lt;pre>patch -p0 &lt;gtest-1.4.0_pkg-config.patch&lt;/pre>
# Patch the source: <pre>patch -p0 <gtest-1.4.0_pkg-config.patch</pre>
# Build and install: &lt;pre>cd gtest-0.4.0&amp;#13;./configure &amp;&amp; make &amp;&amp; sudo make install&lt;/pre>
# Build and install: <pre>cd gtest-0.4.0&#13;./configure && make && sudo make install</pre>


==== googlemock ====
==== googlemock ====
# Get the source: &lt;pre>wget http://googlemock.googlecode.com/files/gmock-1.4.0.tar.gz&lt;/pre>
# Get the source: <pre>wget http://googlemock.googlecode.com/files/gmock-1.4.0.tar.gz</pre>
# Unpack the source: &lt;pre>tar xvzf gmock-1.4.0.tar.gz&lt;/pre>
# Unpack the source: <pre>tar xvzf gmock-1.4.0.tar.gz</pre>
# Get the patch: &lt;pre>wget http://www.jmglov.net/opensource/src/gmock-1.4.0_pkg-config.patch&lt;/pre>
# Get the patch: <pre>wget http://www.jmglov.net/opensource/src/gmock-1.4.0_pkg-config.patch</pre>
# Patch the source: &lt;pre>patch -p0 &lt;gmock-1.4.0_pkg-config.patch&lt;/pre>
# Patch the source: <pre>patch -p0 <gmock-1.4.0_pkg-config.patch</pre>
# Build and install: &lt;pre>cd gmock-0.4.0&amp;#13;./configure &amp;&amp; make &amp;&amp; sudo make install&lt;/pre>
# Build and install: <pre>cd gmock-0.4.0&#13;./configure && make && sudo make install</pre>


=== CMake based build ===
=== CMake based build ===
Line 41: Line 33:
Inside the ''adonthell'' directory type:
Inside the ''adonthell'' directory type:


   mkdir ../adonthell-build &amp;&amp; cd ../adonthell-build
   mkdir ../adonthell-build && cd ../adonthell-build
   cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DDEVBUILD=1 ../adonthell
   cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DDEVBUILD=1 ../adonthell
   make
   make
Line 55: Line 47:


   ./autogen.sh
   ./autogen.sh
   mkdir ../adonthell-build &amp;&amp; cd ../adonthell-build
   mkdir ../adonthell-build && cd ../adonthell-build
   ../adonthell/configure --enable-dev-build --prefix=/usr/local
   ../adonthell/configure --enable-dev-build --prefix=/usr/local
   make
   make
Line 101: Line 93:
=== debug.py not found ===
=== debug.py not found ===


In case you get the error while &lt;tt>make install&lt;/tt>, that a &lt;tt>debug.py&lt;/tt> file cannot be found, simply
In case you get the error while <tt>make install</tt>, that a <tt>debug.py</tt> file cannot be found, simply
  echo crap > ../adonthell/src/py-wrappers/runtime/debug.py
  echo crap > ../adonthell/src/py-wrappers/runtime/debug.py


[[Category:Development]]
[[Category:Development]]

Revision as of 18:14, 27 November 2010


After having installed all of Adonthell's Dependencies and obtained the source code from Git you can finally compile it. Please follow the general instructions and see the hints specific to your OS if you get stuck. Refer to the instructions included with the source code for further details.

General Instructions

For all Systems, we assume a POSIX-like environment with GNU compiler and make and a shell. Where supported, you should use the CMake based build system, but we'll probably keep the GNU autotools around for some while too. In both cases, an out-of-source build is recommended.

Building dependencies

google-glog, googletest, and googlemock require special preparation, as only googletest seems to be currently packed for Ubuntu, and the packaged version is well out of date.

google-glog

  1. Get the source:
    wget http://google-glog.googlecode.com/files/glog-0.3.0.tar.gz
  2. Unpack the source:
    tar xvzf glog-0.3.0.tar.gz
  3. Build and install:
    cd glog-0.3.0&#13;./configure && make && sudo make install

googletest

  1. Get the source:
    wget http://googletest.googlecode.com/files/gtest-1.4.0.tar.gz
  2. Unpack the source:
    tar xvzf gtest-1.4.0.tar.gz
  3. Get the patch:
    wget http://www.jmglov.net/opensource/src/gtest-1.4.0_pkg-config.patch
  4. Patch the source:
    patch -p0 <gtest-1.4.0_pkg-config.patch
  5. Build and install:
    cd gtest-0.4.0&#13;./configure && make && sudo make install

googlemock

  1. Get the source:
    wget http://googlemock.googlecode.com/files/gmock-1.4.0.tar.gz
  2. Unpack the source:
    tar xvzf gmock-1.4.0.tar.gz
  3. Get the patch:
    wget http://www.jmglov.net/opensource/src/gmock-1.4.0_pkg-config.patch
  4. Patch the source:
    patch -p0 <gmock-1.4.0_pkg-config.patch
  5. Build and install:
    cd gmock-0.4.0&#13;./configure && make && sudo make install

CMake based build

Inside the adonthell directory type:

 mkdir ../adonthell-build && cd ../adonthell-build
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DDEVBUILD=1 ../adonthell
 make
 sudo make install

Beware: with cmake prior to version 2.6 you should remove old versions of the Adonthell 0.4 libraries before the build.

The -DDEVBUILD=1 enables a developer build, which gives you unit tests and debug symbols; if you are compiling Adonthell as an end user, you probably won't want to turn this on.

GNU Autotools based build

Inside the adonthell directory type:

 ./autogen.sh
 mkdir ../adonthell-build && cd ../adonthell-build
 ../adonthell/configure --enable-dev-build --prefix=/usr/local
 make
 sudo make install

The --enable-devbuild enables a developer build, which gives you unit tests and debug symbols; if you are compiling Adonthell as an end user, you probably won't want to turn this on.

Developing on GNU/Linux or *BSD

Most, if not all, dependencies should come with your distribution. Just make sure to install the corresponding development packages. In case that you require a newer version of a library or tool than comes with the distribution, you should be able to compile and install it yourself without much trouble.

In general, you should be able to use any IDE of your choice as long as it is not messing with the Makefiles. If you have a particular good setup, feel free to share the instructions.

Developing on MacOS X

Like on Linux, you can get most of the dependencies in the form of precompiled binaries, e.g. from the Fink Project. If you need an IDE, use XCode.

Most likely I will buy a new Mac once Leopard is released. Then I'll document all the required steps to get an Adonthell development environment going. (Kai)

Developing on Windows

Since Adonthell requires the GNU Compiler Collection (GCC), your best choices are either Cygwin or MinGW. In order to produce "true" Windows binaries that do not depend on the Cygwin POSIX layer (cygwin1.dll), setting up a development environment with MSYS/MinGW is recommended. A good IDE to use would be Eclipse, which is becoming supported directly by CMake.

Developing on other OS

Sorry, right now you are on your own. But if your system has a recent port of GCC and is supported by SDL, chances are pretty good that you will get Adonthell working. Please update this space if you did :-).

Fixing problems

ImportError: No module named adonthell.world

In case you have multiple versions of Python installed, CMake can get confused. If, during the initial run of cmake you get a mix of versions like seen below, Adonthell will not work correctly.

 Found PythonLibs: /usr/lib/python2.4/config/libpython2.4.so
 -- Python has been found:
 -- CFLAGS : /usr/include/python2.4
 -- LDFLAGS: /usr/lib/python2.4/config/libpython2.4.so
 -- Found PythonInterp: /usr/bin/python2.5
 -- VERSION: python2.5
 -- LDEXTRA: -lm;-lpthread -ldl  -lutil
 -- SITEPKG: /usr/lib/python2.5/site-packages

The only workaround for that is removing any superfluous Python installations, then running cmake again.

debug.py not found

In case you get the error while make install, that a debug.py file cannot be found, simply

echo crap > ../adonthell/src/py-wrappers/runtime/debug.py