[Avida-cvs] [avida-svn] r443 - in branches/developers/avida-edward: CMakeModules documentation/xdocs/admin source/python source/python/scripts source/python/scripts/win32

gerrishj@myxo.css.msu.edu gerrishj at myxo.css.msu.edu
Fri Jan 20 13:35:49 PST 2006


Author: gerrishj
Date: 2006-01-20 16:35:49 -0500 (Fri, 20 Jan 2006)
New Revision: 443

Added:
   branches/developers/avida-edward/source/python/scripts/
   branches/developers/avida-edward/source/python/scripts/win32/
   branches/developers/avida-edward/source/python/scripts/win32/README
   branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-paths.sh
   branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-vtable-import.sh
   branches/developers/avida-edward/source/python/scripts/win32/mingw-setupshell.sh
Modified:
   branches/developers/avida-edward/CMakeModules/AddPysteModule.cmake
   branches/developers/avida-edward/documentation/xdocs/admin/third-party-win32.xml
   branches/developers/avida-edward/source/python/CMakeLists.txt
Log:
Updated instructions for building under Windows.
Added some scripts that fix CMake path issues and a vtable import issue.
Updated AddPysteModule.cmake to build with cvs version of CMake.


Modified: branches/developers/avida-edward/CMakeModules/AddPysteModule.cmake
===================================================================
--- branches/developers/avida-edward/CMakeModules/AddPysteModule.cmake	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/CMakeModules/AddPysteModule.cmake	2006-01-20 21:35:49 UTC (rev 443)
@@ -6,9 +6,14 @@
 IF(APPLE)
   SET(BOOST_PYTHON_COMPILE_FLAGS "-no-cpp-precomp -ftemplate-depth-120 -fno-inline -fPIC -Wno-long-double -Wno-long-long -DBOOST_PYTHON_DYNAMIC_LIB")
 ELSE(APPLE)
-  SET(BOOST_PYTHON_COMPILE_FLAGS "-Wall -ftemplate-depth-100  -DBOOST_PYTHON_DYNAMIC_LIB  -fno-inline -fPIC")
+  IF(WIN32)
+    SET(BOOST_PYTHON_COMPILE_FLAGS "-Wall -ftemplate-depth-100 -DBOOST_PYTHON_STATIC_LIB  -fno-inline")
+  ELSE(WIN32)
+    SET(BOOST_PYTHON_COMPILE_FLAGS "-Wall -ftemplate-depth-100  -DBOOST_PYTHON_DYNAMIC_LIB  -fno-inline -fPIC")
+  ENDIF(WIN32)
 ENDIF(APPLE)
 
+
 SET(AvidaPysteScript "${PROJECT_SOURCE_DIR}/source/bindings/Boost.Python/AvidaPyste.py")
 
 
@@ -223,7 +228,7 @@
     ADD_LIBRARY(${ModuleName}/${PysteBase} MODULE ${CMAKE_CURRENT_BINARY_DIR}/${PysteBase}.cpp)
     SET_TARGET_PROPERTIES(${ModuleName}/${PysteBase} PROPERTIES PREFIX "")
     TARGET_LINK_LIBRARIES(${ModuleName}/${PysteBase} ${${LinkLibraries}})
-    INSTALL_TARGETS(${PackageLocation}/${ModuleName} $${ModuleName}/${PysteBase})
+    INSTALL_TARGETS(${PackageLocation}/${ModuleName} ${ModuleName}/${PysteBase})
     FILE(APPEND ${LIBRARY_OUTPUT_PATH}/${ModuleName}/__init__.py "from ${PysteBase} import *\n")
   ENDFOREACH(Entry ${${PysteBases}})
 ENDMACRO(ADD_PYSTE_PACKAGE)

Modified: branches/developers/avida-edward/documentation/xdocs/admin/third-party-win32.xml
===================================================================
--- branches/developers/avida-edward/documentation/xdocs/admin/third-party-win32.xml	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/documentation/xdocs/admin/third-party-win32.xml	2006-01-20 21:35:49 UTC (rev 443)
@@ -36,12 +36,12 @@
 	sure you install the following tools:
       </p>
       <ul>
-	<li>subversion</li>
-	<li>openssh</li>
-	<li>wget</li>
-	<li>make</li>
-	<li>automake</li>
-	<li>autoconf</li>
+	<li>subversion (under Devel)</li>
+	<li>openssh (under Net)</li>
+	<li>wget (under Web)</li>
+	<li>make (under Devel)</li>
+	<li>automake (under Devel)</li>
+	<li>autoconf (under Devel)</li>
       </ul>
       <p>
 	Don't install any of the other stuff, including the Qt
@@ -86,6 +86,21 @@
 	  latest w32-api, automake, and autoconf tarballs in the MinGW
 	  directory.
 	</p>
+	<p>
+	  The monolithic installer is no longer available on the MinGW
+	  page, you will need to download each component seperately,
+	  or use the following link:<br/>
+	  <a
+	      href="http://prdownloads.sourceforge.net/mingw/MinGW-5.0.0.exe">MinGW-5.0.0.exe</a>
+	  <br/>
+	  I haven't tested this release yet.
+	</p>
+	<ul>
+	  <li>http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download</li>
+	  <li>http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download</li>
+	  <li>http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download</li>
+	  <li>http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz?download</li>
+	</ul>
       </section>
 
       <section id="win32_cmake">
@@ -100,6 +115,26 @@
           </a>
         </p>
 	<p>
+	  The latest version of CMake in CVS includes MinGW and MSYS
+	  targets.  You will need a version of CVS already installed
+	  in order to build the CVS version.  Instructions for
+	  downloading the cvs version are available here: <a
+	  href="http://www.cmake.org/HTML/Download.html#cvs">CMake CVS
+	  Instructions</a>
+	</p>
+	<p>
+	  To build it, run the following:
+	</p>
+	<p>
+	  <code>cmake</code>
+	</p>
+	<p>
+	  <code>make</code>
+	</p>
+	<p>
+	  <code>make install</code>
+	</p>
+	<p>
 	  Basic instructions for use with Avida can be found in the
 	  file "<code>README</code>" in the top-level Avida source
 	  code directory. Read more detailed instructions at <a
@@ -148,7 +183,15 @@
 	<p>
 	  <code>
 	    pexports.exe /c/WINDOWS/system32/python24.dll > python24.def
+	  </code>
+	</p>
+	<p>
+	  <code>
 	    dlltool --dllname python24.dll --def python24.def --output-lib libpython24.a
+	  </code>
+	</p>
+	<p>
+	  <code>
 	    cp libpython24.a c:\python24\libs
 	  </code>
 	</p>
@@ -343,8 +386,8 @@
         </p>
         <p>
           Download and unpack the PyQt source archive
-          <a href="http://www.river-bank.demon.co.uk/download/PyQt/PyQt-mac-gpl-3.13.tar.gz">
-            http://www.river-bank.demon.co.uk/download/PyQt/PyQt-mac-gpl-3.13.tar.gz
+          <a href="http://www.river-bank.demon.co.uk/download/PyQt/PyQt-x11-gpl-3.15.1.tar.gz">
+	    http://www.river-bank.demon.co.uk/download/PyQt/PyQt-x11-gpl-3.15.1.tar.gz
           </a>
           into the directory of your choice using Terminal.app; for example:
         </p>
@@ -593,7 +636,7 @@
           <br/>
           <code>$ cd tools\build\jam_src</code>
           <br/>
-          <code>$ build.bat gcc-nocygwin</code>
+          <code>$ build.bat mingw</code>
         </p>
         <p>
 	  Switch back over to MSYS.  copy bin.ntx86/* to
@@ -615,7 +658,7 @@
 	  <br/>
 	  <code>export PYTHON_VERSION=2.4</code>
 	  <br/>
-          <code>$ bjam -sTOOLS=gcc-nocygwin \</code>
+          <code>$ bjam -sTOOLS=mingw \</code>
           <br/>
           <code>
 	    -sBUILD=release \
@@ -647,7 +690,7 @@
           "<code>install</code>"):
         </p>
         <p>
-          <code>$ bjam -sTOOLS=gcc-nocygwin \</code>
+          <code>$ bjam -sTOOLS=mingw \</code>
           <br/>
           <code>
             "-sBUILD=release"
@@ -775,7 +818,23 @@
 	</p>
       </section>
 
-    </section>      
+      <section id="issues">
+	<title>Build issues</title>
+	<p>
+	  There are some problems with the makefiles that CMake generates.
+	</p>
+	<p>
+	  Included in the source/python/scripts/win32 directory are
+	  some scripts that will fix these issues.
+	</p>
+	<p>
+	  There are also some import errors related to vtable
+	  imports.  The mingw-fix-vtable-import.sh script will define
+	  the -enable-runtime-pseudo-reloc switch which eliminates
+	  these errors.
+	</p>
+      </section>
+    </section>
 
   </body>
 </document>

Modified: branches/developers/avida-edward/source/python/CMakeLists.txt
===================================================================
--- branches/developers/avida-edward/source/python/CMakeLists.txt	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/source/python/CMakeLists.txt	2006-01-20 21:35:49 UTC (rev 443)
@@ -4,6 +4,9 @@
   FOREACH(PYUI_FILE ${PYUI_FILES})
     GET_FILENAME_COMPONENT(PYUI_PATH ${PYUI_FILE} PATH)
     GET_FILENAME_COMPONENT(PYUI_MODULE ${PYUI_FILE} NAME_WE)
+    IF(MINGW)
+      STRING(REGEX REPLACE "c:/" "/c/" PYUI_PATH ${PYUI_PATH})
+    ENDIF(MINGW)
     SET(ABS_PYUI_MODULE ${PYUI_PATH}/${PYUI_MODULE})
     ADD_CUSTOM_TARGET(
       ${ABS_PYUI_MODULE}.py

Added: branches/developers/avida-edward/source/python/scripts/win32/README
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/README	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/source/python/scripts/win32/README	2006-01-20 21:35:49 UTC (rev 443)
@@ -0,0 +1,5 @@
+Included in this directory are support scripts to assist in building under
+Windows.
+
+The two fix- scripts should be run in:
+build/source/bindings/Boost.Python/CMakeFiles/AvidaCore

Added: branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-paths.sh
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-paths.sh	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-paths.sh	2006-01-20 21:35:49 UTC (rev 443)
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Run in build/source/bindings/Boost.Python/CMakeFiles/AvidaCore
+
+# Fix linking errors with libboost_python-mgw.lib
+perl -i -pe 's/-llibboost_python-mgw.lib/-llibboost_python-mgw/g' */build.make
+
+# Fix linking errors with python24.lib
+perl -i -pe 's/-lpython24.lib/-lpython24/g' */build.make
+
+# Fix path issues in makefiles
+# Fixes "No rule to make target `/cygwin/..."
+perl -i -pe 's/ \/cygwin/ c:\/cygwin/g' */build.make

Added: branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-vtable-import.sh
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-vtable-import.sh	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-vtable-import.sh	2006-01-20 21:35:49 UTC (rev 443)
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Fixes errors with vtable imports when linking bindings
+
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' config.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' fitness_matrix.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' genebank.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' genotype.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' genotype_control.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' inject_genebank.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' inject_genotype.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' inject_genotype_control.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' lineage.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' lineage_control.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' mx_code_array.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' my_code_array_less_than.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' phenotype.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' py_avida_driver.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' py_hardware_tracer.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' species_control.dir/build.make
+perl -i -pe 's/ -shared/-enable-runtime-pseudo-reloc -shared/g' stats.dir/build.make


Property changes on: branches/developers/avida-edward/source/python/scripts/win32/mingw-fix-vtable-import.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/developers/avida-edward/source/python/scripts/win32/mingw-setupshell.sh
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/mingw-setupshell.sh	2006-01-20 13:46:47 UTC (rev 442)
+++ branches/developers/avida-edward/source/python/scripts/win32/mingw-setupshell.sh	2006-01-20 21:35:49 UTC (rev 443)
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Sets up environment to build Avida using MSYS, the MinGW shell
+
+# Set BUILD_ROOT to the directory you build the win32 libraries in
+# These will probably need to be tweaked for your environment
+export BUILD_ROOT=/c/cygwin/home/josh
+export QTDIR=$BUILD_ROOT/src/qt-3
+export LOCAL=/c/msys/1.0
+export PATH=$PATH:$QTDIR/bin:$QTDIR/lib:$BUILD_ROOT/src/gccxml/build/bin:/c/Python24:$LOCAL/lib:$LOCAL/lib/AvidaCore
+
+export PYTHONPATH="$LOCAL/lib;$LOCAL/lib/AvidaCore"
+
+export GCCXML_FLAGS="-D__DBL_MIN_EXP__='(-1021)' -D__FLT_MIN__='1.17549435e-3
+8F' -D__CHAR_BIT__='8' -D__WCHAR_MAX__='65535U' -D__DBL_DENORM_MIN__='4.9406564
+584124654e-324' -D__FLT_EVAL_METHOD__='2' -D__DBL_MIN_10_EXP__='(-307)' -D__FIN
+ITE_MATH_ONLY__='0' -D__GNUC_PATCHLEVEL__='2' -D_stdcall='__attribute__((__stdc
+all__))' -D__SHRT_MAX__='32767' -D__LDBL_MAX__='1.18973149535723176502e+4932L' 
+-D__LDBL_MAX_EXP__='16384' -D__SCHAR_MAX__='127' -D__USER_LABEL_PREFIX__='_' -D
+__STDC_HOSTED__='1' -D__WIN32='1' -D__LDBL_HAS_INFINITY__='1' -D__DBL_DIG__='15
+' -D__FLT_EPSILON__='1.19209290e-7F' -D__GXX_WEAK__='1' -D__tune_i686__='1' -Df
+__LDBL_MIN__='3.36210314311209350626e-4932L' -D__DECIMAL_DIG__='21' -D__LDBL_HA
+S_QUIET_NAN__='1' -D__GNUC__='3' -D_cdecl='__attribute__((__cdecl__))' -D__DBL_
+MAX__='1.7976931348623157e+308' -D__WINNT='1' -D__DBL_HAS_INFINITY__='1' -D__WI
+NNT__='1' -D_fastcall='__attribute__((__fastcall__))' -D__cplusplus='1' -D__USI
+NG_SJLJ_EXCEPTIONS__='1' -D__DEPRECATED='1' -D__DBL_MAX_EXP__='1024' -D__WIN32_
+_='1' -D__GNUG__='3' -D__LONG_LONG_MAX__='9223372036854775807LL' -D__GXX_ABI_VE
+RSION='1002' -D__FLT_MIN_EXP__='(-125)' -D__DBL_MIN__='2.2250738585072014e-308'
+ -D__FLT_MIN_10_EXP__='(-37)' -D__DBL_HAS_QUIET_NAN__='1' -D__REGISTER_PREFIX__
+='' -D__cdecl='__attribute__((__cdecl__))' -D__NO_INLINE__='1' -D__i386='1' -D_
+_FLT_MANT_DIG__='24' -D__VERSION__='3.4.2 (mingw-special)' -D_WIN32='1' -D_X86_
+='1' -Di386='1' -D__i386__='1' -D__SIZE_TYPE__='unsigned int' -D__FLT_RADIX__='
+2' -D__LDBL_EPSILON__='1.08420217248550443401e-19L' -D__MSVCRT__='1' -D__FLT_HA
+S_QUIET_NAN__='1' -D__FLT_MAX_10_EXP__='38' -D__LONG_MAX__='2147483647L' -D__FL
+T_HAS_INFINITY__='1' -D__stdcall='__attribute__((__stdcall__))' -D__EXCEPTIONS=
+'1' -D__LDBL_MANT_DIG__='64' -D__WCHAR_TYPE__='short unsigned int' -D__FLT_DIG_
+_='6' -D__INT_MAX__='2147483647' -DWIN32='1' -D__MINGW32__='1' -D__FLT_MAX_EXP_
+_='128' -D__DBL_MANT_DIG__='53' -D__WINT_TYPE__='short unsigned int' -D__LDBL_M
+IN_EXP__='(-16381)' -D__WCHAR_UNSIGNED__='1' -D__LDBL_MAX_10_EXP__='4932' -D__D
+BL_EPSILON__='2.2204460492503131e-16' -D__tune_pentiumpro__='1' -D__fastcall='_
+_attribute__((__fastcall__))' -DWINNT='1' -D__FLT_DENORM_MIN__='1.40129846e-45F
+' -D__FLT_MAX__='3.40282347e+38F' -D__GNUC_MINOR__='4' -D__DBL_MAX_10_EXP__='30
+8' -D__LDBL_DENORM_MIN__='3.64519953188247460253e-4951L' -D__PTRDIFF_TYPE__='in
+t' -D__LDBL_MIN_10_EXP__='(-4931)' -D__LDBL_DIG__='18' -D__declspec(x)='__attri
+bute__((x))' -iwrapper c:/cygwin/home/josh/src/gccxml/GCC_XML/Support/GCC/3.4 -
+I/mingw/lib/gcc/mingw32/3.4.2/../../../../include/c++ -I/mingw/include -I/mingw
+/include/c++/3.4.2 -I/mingw/include/c++/3.4.2/mingw32 -I/mingw/lib/gcc/mingw32/
+3.4.2/include -include c:/cygwin/home/josh/src/gccxml/GCC_XML/Support/GCC/3.4/g
+ccxml_builtins.h"




More information about the Avida-cvs mailing list