Hi all,
I have used Thierry Brault's excellent instructions to build Soya 0.14
on Windows myself.
I found a couple of amendments needed to be made to the process to get
it to work on my machine.
Below is my documentation. I have added plenty of comments of my own.
Notes for the uninitiated:
1. When making a .bat file, just do it with Notepad.
2. When extracting .tar.gz files or similar with 7-Zip, the files will
usually need extracting TWICE (once to get the .tar file, then to
extract the files themselves from the .tar). Extract the .tar into the
same folder as the .tar.gz, then extract the .tar into the folder
specified in the instructions.
Compiling Soya3d on win32 for python25 with gcc-4 and pyrex-9.7.2
Instructions by Thierry Brault
Amended by Anthony Smith
Folder structure will look like this:
C:\
aasoya\
download\
bin_dev\
binutils-2.19-mingw32-bin.tar.gz
gcc-4.3.0-20080502-mingw32-alpha-bin.tar.gz
mingwrt-3.15.1-mingw32-dev.tar.gz
w32api-3.13-mingw32-dev.tar.gz
freetype-2.3.5-1-bin.zip
zlib-1.2.3-bin.zip
exe\
cmake-2.6.2-win32-x86.exe
MSYS-1.0.10.exe
msysDTK-1.0.1.exe
src\
cal3d-0.11.0.tar.gz
glew-1.5.1-src.tgz
ode-0.10.1.tar.bz2
openal-soft-1.6.372.tar.bz2
Pyrex-0.9.7.2.tar.gz
SDL-1.2.13.tar.gz
SDL_mixer-1.2.8.zip
Soya-0.14.tar.bz2
SoyaTutorial-0.14.tar.bz2
gcc\
bin\
include\
lib\
mingw32\
... .
msys\
etc\
fstab
... .
work\
build\
cal3d-0.11.0\
cal3d_build\
freetype\
glew\
ode-0.10.1\
build\
build_ode.bat
openal_build\
openal-soft-1.6.372\
Pyrex-0.9.7.2\
dist\
Pyrex-0.9.7.2.win32.exe
SDL-1.2.13\
SDL_build\
SDL_mixer-1.2.8\
SDL_mixer_build\
zlib
msys.bat
... .
Soya-0.14\
dist\
Soya-0.14.win32-py2.5.exe
SoyaTutorial-0.14\
Python25\
... .
create:
c:\aasoya\
c:\aasoya\download\
c:\aasoya\download\bin_dev\
c:\aasoya\download\exe\
c:\aasoya\download\src\
c:\aasoya\gcc\
in:
http://sourceforge.net/project/showfiles.php?group_id=2435
GCC Version 4: gcc-4.3.0-20080502-mingw32-alpha-bin.tar.gz
download:
http://downloads.sourceforge.net/mingw/gcc-4.3.0-20080502-mingw32-alpha-bin.tar.gz?modtime=1209931332&big_mirror=1
in: c:\aasoya\download\bin_dev
extract: gcc-4.3.0-20080502-mingw32-alpha-bin
have in: bin, info lib, libexec, man, share
DONE
MinGW API for MS-Windows: w32api-3.13-mingw32-dev.tar.gz
download:
http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz?modtime=1228514514&big_mirror=1
in: c:\aasoya\download\bin_dev
extract: w32api-3.13-mingw32-dev
in: c:\aasoya\gcc
have in: include, lib
DONE
GNU Binutils: binutils-2.19-mingw32-bin.tar.gz
download:
http://downloads.sourceforge.net/mingw/binutils-2.19-mingw32-bin.tar.gz?modtime=1229077826&big_mirror=1
in: c:\aasoya\download\bin_dev
extract: binutils-2.19-mingw32-bin in: c:\aasoya\gcc
have in: bin, doc, include, info, lib, man, mingw32.
DONE
MinGW Runtime: mingwrt-3.15.1-mingw32-dev.tar.gz
download:
http://downloads.sourceforge.net/mingw/mingwrt-3.15.1-mingw32-dev.tar.gz?modtime=1223145564&big_mirror=1
in: c:\aasoya\download\bin_dev
extract: mingwrt-3.15.1-mingw32-dev
in: c:\aasoya\gcc
have in: doc, include, lib, man.
No need to add the path: c:\aasoya\gcc\bin to the Environment Variables.
However when Soya setup is launched (the last step) it's a good idea
to "hide" MinGW if it already exists ie renaming the directory C:\MinGW_old
DONE
INSTALL MSYS:
MSYS-1.0.10.exe:
at:
http://www.mingw.org/wiki/msys
download:
http://sourceforge.net/project/downloading.php?groupname=mingw&filename=MSYS-1.0.10.exe&use_mirror=garr
in: c:\aasoya\download\exe\
run: MSYS-1.0.10.exe
"Select Destination Directory"
choose path at: c:\aasoya\msys\
tick off: Don't create any icons
postinstall: answer = y, y, c:/aasoya/gcc (look at c:\aasoya\msys\etc\fstab)
DONE
to run MSYS clic-clic on c:\aasoya\msys\msys.bat
msysDTK-1.0.1.exe:
download:
http://sourceforge.net/project/downloading.php?groupname=mingw&filename=msysDTK-1.0.1.exe&use_mirror=puzzle
in: c:\aasoya\download\exe
run:
msysDTK-1.0.1.exe
"Select Destination Directory"
choose path at: c:\aasoya\msys\
with MSYS: (clic-clic on: c:\aasoya\msys\msys.bat)(don't copy $ :-) )
create:
c:\aasoya\msys\work\build
c:\aasoya\download\src
$ mkdir -p /work/build (-p = permission to build work)
DONE - not sure about "create" and following 2 lines - did nothing
there. The first was created with the $ command in MSYS; the second
exists already because I had already created it.
CAL3D:
in: http://download.gna.org/cal3d/sources/
download:
http://download.gna.org/cal3d/sources/cal3d-0.11.0.tar.gz
in: c:\aasoya\download\src
extract: cal3d-0.11.0 in: c:\msys\1.0\work\build
DONE
IGNORING THE FOLLOWING BLANK INCLUDE STATEMENTS...
in: \cal3d-0.11.0\src\
Add: #include <cstring>
to: cal3d-converter.cpp line 13
DONE
in: \cal3d-0.11.0\src\cal3d\
Add: #include <string.h>
to:
hardwaremodel.cpp line 14
DONE
platform.cpp line 18
DONE
renderer.cpp line 18
DONE
submesh.cpp line 18
DONE
Add: #include <memory>
to:
loader.cpp line 37
with: MSYS c:\aasoya\msys\msys.bat
$ cd /work/build
$ mkdir cal3d_build
$ cd cal3d_build
$ ../cal3d-0.11.0/configure --prefix=/mingw
DONE for the second time after applying the bug fix... no errors
DONE for the third time after applying second bug fix... no errors
DONE for the fourth time after removing blank include statements... no
errors
$ make
DONE first time - Several errors received though:
../../../cal3d-0.11.0/src/cal3d/hardwaremodel.cpp:754: error:
'memcpy' was not declared in this scope
../../../cal3d-0.11.0/src/cal3d/hardwaremodel.cpp:765: error:
'memset' was not declared in this scope
../../../cal3d-0.11.0/src/cal3d/hardwaremodel.cpp:776: error:
'memset' was not declared in this scope
../../../cal3d-0.11.0/src/cal3d/hardwaremodel.cpp:793: error:
'memset' was not declared in this scope
make[3]: *** [hardwaremodel.lo] Error 1
make[3]: Leaving directory `/work/build/cal3d_build/src/cal3d'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/work/build/cal3d_build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/work/build/cal3d_build'
make: *** [all] Error 2
DONE for the second time after applying a bug fix... same errors.
Applied additional patch.
DONE for the third time after applying second bug fix... errors:
../../../cal3d-0.11.0/src/cal3d/hardwaremodel.cpp:14:9: error:
#include expects "FILENAME" or <FILENAME>
make[3]: *** [hardwaremodel.lo] Error 1
make[3]: Leaving directory `/work/build/cal3d_build/src/cal3d'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/work/build/cal3d_build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/work/build/cal3d_build'
make: *** [all] Error 2
I think this is because of the blank include statements.
Backtracking to remove blank include statements...
DONE for the fourth time after removing blank include statements... NO
ERRORS!!!
Changed bad instructions above. All is well.
$ make install
DONE - same sort of errors this time.
DONE for the second time after messing about with the above... no errors!
$ make clean
--prefix=/mingw <=> --prefix=c:/aasoya/gcc
see: c:\aasoya\msys\etc\fstab
DONE - I have looked in this file and it contains one line:
c:/aasoya/gcc /mingw and one empty line. All seems well.
DONE for the second time - no errors!
ODE: ode-0.10.1.tar.bz2
in: http://opende.sourceforge.net/
download:
http://downloads.sourceforge.net/opende/ode-0.10.1.tar.bz2?modtime=1216899139&big_mirror=0
in: c:\aasoya\download\src
extract: ode-0.10.1 in: c:\aasoya\msys\work\build\.
DONE
create:
build_ode.bat (*.bat <=> DOS)
in:
c:\aasoya\msys\work\build\ode-0.10.1\build\
insert into build_ode.bat:
set PATH=c:\aasoya\msys\bin;c:\aasoya\gcc\bin
premake --with-demos --with-tests --target gnu
pause
cd gnu
pause
make
pause
DONE -- did this with Notepad.
clic-clic on: c:\aasoya\msys\work\build\ode-0.10.1\build\build_ode.bat
this create c:\aasoya\msys\work\build\ode-0.10.1\lib
in: c:\aasoya\msys\work\build\ode-0.10.1\lib\DebugSinglDLL\
copy and paste libode_singled.a, rename the copy libode.a
DONE
So:
Copy (libdrawstuffd.a), libode_singled.a, libode.a
paste in: c:\aasoya\gcc\lib\
DONE
copy (drawstuffd.dll), ode_singled.dll, (ode.dll)
DONE - There is no ode.dll! Only first two copied...
paste in: c:\aasoya\gcc\bin\
DONE
Copy: include\
from:
c:\aasoya\msys\work\build\ode-0.10.1\
to:
c:\aasoya\gcc\
DONE - clicked OK or Yes to All in the "folder with the same name
exists" dialogue box.
SDL: SDL-1.2.13.tar.gz
in:
http://www.libsdl.org/download-1.2.php
download:
http://www.libsdl.org/release/SDL-1.2.13.tar.gz
in: c:\aasoya\download\src\
extract SDL-1.2.13
in: c:\aasoya\msys\work\build.
DONE
With MSYS c:\aasoya\msys\msys.bat
$ cd /work/build
$ mkdir sdl_build
$ cd sdl_build
$ ../SDL-1.2.13/configure --prefix=/mingw
DONE - no errors
$ make
DONE
$ make install
DONE
$ make clean
DONE
to paste in MSYS use shift+clic
Now you tell me after all this time! ;)
DONE
SDL-MIXER: SDL_mixer-1.2.8.zip
in:
http://www.libsdl.org/projects/SDL_mixer/
download:
http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.8.zip
in: c:\aasoya\download\src\
extract SDL_mixer-1.2.8
in: c:aasoya\msys\work\build\
DONE
With MSYS: c:\aasoya\msys\msys.bat
$ cd /work/build
$ mkdir sdl_mixer_build
$ cd sdl_mixer_build
$ ../SDL_mixer-1.2.8/configure --prefix=/mingw
DONE no errors
$ make
DONE no errors
$ make install
DONE no errors
$ make clean
DONE no errors
to paste in MSYS use shift+clic
DONE
GLEW: glew-1.5.1-src.tgz
from:
http://glew.sourceforge.net/index.html
download:
http://downloads.sourceforge.net/glew/glew-1.5.1-src.tgz?modtime=1225675817&big_mirror=0
in: c:\aasoya\download\src\
extract: glew\
to: c:\aasoya\msys\work\build\
DONE
in: c:\aasoya\msys\work\build\\glew\Makefile line 43
GLEW_DEST ?= c:/aasoya/gcc
DONE
With MSYS: c:\aasoya\msys\msys.bat
$ cd /work/build/glew
$ make
DONE no errors
$ make install
DONE no errors
$ make clean
DONE no errors
to paste in MSYS use shift+clic
CMake: cmake-2.6.2-win32-x86.exe
from:
http://www.cmake.org/
download:
http://www.cmake.org/files/v2.6/cmake-2.6.2-win32-x86.exe
in: c:\aasoya\download\exe\
run: cmake-2.6.2-win32-x86.exe
DONE - did not change default install settings e.g. "do not add CMake to
the system PATH"
OPENAL: openal-soft-1.6.372.tar.bz2
in:
http://kcat.strangesoft.net/openal.html
download:
http://kcat.strangesoft.net/openal-releases/openal-soft-1.6.372.tar.bz2
in: c:\aasoya\download\src\
extract: openal-soft-1.6.372\
in: c:\aasoya\msys\work\build\
create: openal_build\
in: c:\aasoya\msys\work\build\
DONE
run: CMake
Where is the source code = c:\aasoya\msys\work\build\openal-soft-1.6.372
Where to build the binaries = c:/aasoya/msys/work/build/openal_build
clic: "Configure"
" Select Generator"
BuildFor: MSYS Makefiles
clic: "ok"
Wait for it to configure
In the red list:
CMAKE_INSTALL_PREFIX C:/aasoya/gcc
clic: "Configure"
clic: "ok"
DONE
with MSYS c:\aasoya\msys\msys.bat
$ cd /work/build/openal_build
$ make
DONE no errors
$ make install
DONE no errors
FREETYPE: freetype-2.3.5-1-bin.zip
in:
http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16352
download:
http://downloads.sourceforge.net/gnuwin32/freetype-2.3.5-1-bin.zip?modtime=1205530033&big_mirror=1
in: c:\aasoya\download\bin_dev\
create: freetype\
in: c:\aasoya\msys\work\build\
extract: freetype-2.3.5-1-bin
in: c:\aasoya\msys\work\build\freetype
DONE
from: freetype\bin\
copy: freetype6.dll to: c:\aasoya\gcc\bin
from: freetype\lib\
copy: libfreetype.dll.a to: c:\aasoya\gcc\lib
from: freetype\
copy: include\ to: c:\aasoya\gcc\
from: c:\aasoya\gcc\include\freetype2\freetype\
- This should be: from: c:\aasoya\gcc\include\freetype2\
copy: freetype\
paste in: c:\aasoya\gcc\include\
DONE
ZLIB: zlib-1.2.3-bin.zip
in:
http://gnuwin32.sourceforge.net/packages/zlib.htm
download:
http://sourceforge.net/project/downloading.php?groupname=gnuwin32&filename=zlib-1.2.3-bin.zip&use_mirror=garr
in: c:\aasoya\download\bin_dev\
create: c:\aasoya\msys\work\build\zlib\
DONE
extract: zlib-1.2.3-bin
in: c:\aasoya\msys\work\build\zlib\
copy: Zlib1.dll in: c:\aasoya\msys\work\build\zlib\bin\
to: c:\aasoya\gcc\bin\
DONE
PYREX: Pyrex-0.9.7.2.tar.gz
in:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/index.html
download:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/Pyrex-0.9.7.2.tar.gz
in: c:\aasoya\download\src\
extract in:
c:\aasoya\msys\work\build\
create: setup.bat
in: c:\aasoya\msys\work\build\Pyrex-0.9.7.2\
insert:
c:\Python25\python.exe C:\aasoya\msys\work\build\Pyrex-0.9.7.2\setup.py
bdist_wininst
pause
clic-clic on: setup.bat (create build\ and dist\)
DONE - I had not installed Python 2.5, so this did not work. I installed
Python 2.5 and then it worked. Obviously.
clic-clic on:
c:\aasoya\msys\work\build\Pyrex-0.9.7.2\dist\Pyrex-0.9.7.2.win32.exe
(install for Python 2.5)
DONE
SOYA: Soya-0.14.tar.bz2
in:
http://download.gna.org/soya/
download:
http://download.gna.org/soya/Soya-0.14.tar.bz2
in c:\aasoya\download\src\
extract: Soya-0.14
in: c:\aasoya\
DONE
In Soya-0.14\setup.py:
line 90: HAVE_PYREX = 1
so now we have:
# Only enable Pyrex compilation for SVN sources
if not os.path.exists(os.path.join(os.path.dirname(__file__), ".svn")):
HAVE_PYREX = 1 #0
line 112: add opengl32 and glu32:
if sys.platform[:3] == "win":
LIBS = ["m", "glew32", "SDL", "SDL_mixer", "freetype", "cal3d",
"stdc++", "ode", "opengl32","glu32"]
line 161: LIBS.append("openal32") - change "openal" to "openal32"
if USE_OPENAL:
#print "OpenAl exist :",framework_exist('OpenAL')
if "darwin" in sys.platform and framework_exist('OpenAL'):
print "using OpenAl.Framework"
FRAMEWORKS.append('OpenAL')
DEFINES.append(('SOYA_MACOSX',1))
else:
LIBS.append("openal32") #openal
DONE
in: Soya-0.14\init.pyx
https://gna.org/bugs/?12621
- The gist of this is:
Line 347 insert:
+ dInitODE2(dAllocateMaskAll)
so we have:
init_joysticks()
init_gl()
glewInit()
+ dInitODE2(dAllocateMaskAll)
Then at line 374 add:
+ dCloseODE()
so we have:
soya.inited = 0
base_quit()
quit_cal3d()
+ dCloseODE()
The bugfix details some stuff that needs to be done to ctype.pxd as
well, but it seems we'll be doing that next anyway...
in: Soya-0.14\definitions\ode\ctype.pxd
http://svn.gna.org/viewcvs/soya/trunk/soya/definitions/ode/ctype.pxd?rev=464&view=markup
DONE - Clicked DOwnload, then replaced the existing ctype.pxd with the
downloaded one
In Soya-0.14\ode\joints.pyx
http://svn.gna.org/viewcvs/soya/trunk/soya/ode/joints.pyx?rev=465&view=markup
DONE - Clicked Download, then replaced the existing joints.pyx with the
downloaded one
in: Soya-0.14\__init__.py
http://svn.gna.org/viewcvs/*checkout*/soya/trunk/soya/__init__.py?rev=474
This is pretty much a direct file URL. Replaced existing __init__.py
with downloaded one
in: Soya-0.14\
create: setup.bat
Insert:
set PATH=c:\aasoya\gcc\bin
c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py build --compiler=mingw32
::c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py install
::c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py bdist_wininst
pause
DONE
clic-clic on: C:\aasoya\Soya-0.14\setup.bat
DONE - errors:
c:/aasoya/gcc/bin/../lib/gcc/mingw32/4.3.0/../../../../mingw32/bin/ld.exe:
cannot find -lcal3d
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
DONE for the second time after applying bug fixes to Cal3D... no errors!
copy: data\
from: c:\aasoya\Soya-0.14\
to: c:\aasoya\Soya-0.14\build\lib.win32-2.5\soya\
DONE
Copy: freetype6.dll, glew32.dll, libcal3d-12.dll, ode_singled.dll,
SDL.dll, zlib1.dll
from c:\aasoya\gcc\bin
to: c:\aasoya\Soya-0.14\build\lib.win32-2.5\soya\
DONE
Create: setup_build_exe.bat
in: c:\aasoya\Soya-0.14\
Insert:
set PATH=c:\aasoya\gcc\bin
::c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py build
--compiler=mingw32
::c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py install
c:\Python25\python.exe c:\aasoya\Soya-0.14\setup.py bdist_wininst
pause
DONE
Added the following after experiencing errors with subsequent steps:
In C:\aasoya\Soya-0.14
in setup.cfg line 10:
Add lines:
[build]
compiler = mingw32
clic-clic on: C:\aasoya\Soya-0.14\setup_build_exe.bat
Here we go!!!
Error:
error: Python was built with Visual Studio version 7.1, and
extensions need to be built with the same version of the compiler, but
it isn't installed.
Damn. Added stuff to setup.cfg - see above.
Tried again. It worked!
clic-clic on: c:\aasoya\Soya-0.14\dist\Soya-0.14.win32-py2.5.exe
Deep breath. Here we go. It installed!
Now let's see if it WORKS.
It does work! Collisions currently do not work with terrain or other
objects- this could be due to code that needs changing on my part. This
is the error I get:
Exception exceptions.TypeError: "'_soya.Contact' object does not support
item assignment" in '_soya.collide_callback' ignored
Audio currently does not work:
Exception exceptions.RuntimeError: RuntimeError('Cannot create an OpenAL
device!',) in '_soya._init_sound' ignored
This is massive progress for me though - the new Soya looks great and as
soon as I can get collisions and audio going, it will actually BE great.
I think terrain scaling works with collisions in this new version of
Soya, and I'm looking forward to using that.
Thank you, Thierry, for these instructions.
Anthony Smith
Flyin' Irons
http://flyinirons.wordpress.com
_______________________________________________
Soya-user mailing list
[email protected]
https://mail.gna.org/listinfo/soya-user