Changes

Compiling MegaHAL on OS X

693 bytes added, 15:58, 18 October 2012
no edit summary
[[Home | <<< back to Wiki Home]]
 
=Build on OS X=
 
Edited from these instructions - http://blog.marc-seeger.de/2008/03/04/compiling-megahal-on-osx/
*Download MegaHAL: http://sourceforge.net/project/showfiles.php?group_id=10585&release_id=15640
*Search-replace command that worked for me to fix malloc problem:
<code>perl -pi -w -e 's/\#include <malloc.h>/\#include <\/usr\/include\/malloc\/malloc.h>/g;' megahal-9.1.1/*.c</code>
*Force to compile 32 bit
<pre>sed -i .bak 's/CFLAGS=/CFLAGS=-m32 /g' megahal-9.1.1/Makefile </pre>
gugh =Install mh_python=*Download MegaHAL: http:<code>make pythonmodule</code> doesn't work<code>python setup.py build</sourceforgecode> <code>sudo python setup.netpy build install</project/showfiles.php?group_idcode> =10585&release_idUsing mh_python=15640*Search-replace command that worked <pre>Type "copyright", "credits" or "license()" for me:more information.>>> import mh_python as mh<pre>perl -pi -w -e 's/\#include <malloc>> mh.hinitbrain()>>>/\#include <\/usr\/include\/malloc\/mallocmh.hlearn("learn from this sentence")>>>/g;mh.doreply("hello what have you learned?")'Hello what' megahal-9>>> mh.learn("learn from this sentence as well.")>>> mh.1doreply("i am well.1/*")'Learn from this sentence as well.c'>>> </pre>