Fetch the repository succeeded.
How to build and run FreeCAD under MSYS/MinGW=============================================Prerequisites-------------Here comes a short introduction how to setup a MSYS/MinGW environmenton a Windows system, to build all needed libraries and finally to buildthe FreeCAD sources.o MSYS/MinGWIf not already installed get a MinGW installer from the Sourceforge page athttp://sourceforge.net/projects/mingw. When writing this tutorial the latestversion was mingw-get-inst-20100831.exe. Download and just double-click theexcutable. This installs the compiler and a minimal Windows developer environment.Make sure to also install the Fortran compiler because there is a single Fortranfile in the 3rd party folder of the FreeCAD sources.Then as second step MSYS needs to be installed to have an environment to run./configure scripts which we make heavy use of in order to build all neededlibraries. From the Soureforge page the file MSYS-1.0.11.exe was taken.A virginal MSYS/MinGW installation lacks of a few modules we later need.First, we need the utility pexport which can be found in the filepexports-0.44-1-mingw32-bin.tar.lzma. I don't know where to put this fileand how to make MSYS to install the stuff inside. But the file can be openedwith a ZIP program and the content can be copied to their destination manually.Here, the pexports utility can go to the bin directory of your MinGW installation.Then, we also need the development files for the pthreads module which is partof the file pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma. Just download and copythe files inside to your MinGW installation.o CMakeDownload the CMake utility from http://www.cmake.org/cmake/resources/software.html.Get the archive with the binaries for the Windows platform and unpack whereever youwant. There is nothing further to do for this.o SWIGDownload the SWIG utility from www.swig.org and extract it somewhere on your harddisk.Third party libraries---------------------Here is a description which libraries we need for FreeCAD and how to build them fromthe sources. In order not to pollute our MinGW installation with too many files fromthe 3rd party libraries we have to build you can e.g. create a sub-directory "local"in your MSYS installation. If you have installed MSYS under C:\MSYS then simply createthe directory C:\MSYS\1.0\local.o zlibFor zlib there is already a ready package for MinGW. So, therefore simply downloadthe file libz-1.2.3-1-mingw32-dev.tar.gz from the Sourceforge site and extract thetwo directories lib and include to C:\MSYS\1.0\local.o PythonIt seems to be nearly impossible to build the Python sources directly with the MinGWcompiler. This is because some Python modules require some features which are notimplemented on the MinGW platform. Fortunately, the Python sources are plain C codeand instead of trying to build it with MinGW you can get a ready binary package builtwith the MSVC compiler. You can install the Python stuff whereever you want. Afterwardscopy the include folder to C:\MSYS\1.0\local, the DLL can go to C:\MSYS\1.0\local\bin.Now we also need the so called import library. There we cannot use the .lib file whichcomes together with the installer. But it's easy to create one with the pexports/dlltoolutilities. Assuming the Python version is 2.6 do these two steps:pexports python26.dll > python26.defdlltool -D python26.dll -d python26.def -l libpython26.dll.aThe file libpython26.dll.a can now be moved to C:\MSYS\1.0\local\lib.o f2cFor this library we don't need any header files but only the import library to build theSalome SMESH sources. The easiest way to build this file is:pexports libgfortran-3.dll > f2c.defdlltool -D libgfortran-3.dll -d f2c.def -l libf2c.dll.aThe file libf2c.dll.a can now be moved to C:\MSYS\1.0\local\lib.o xerces-cDownload a source archive from http://xml.apache.org/dist/xerces-c/ and extract it.Open a MSYS command line window and change to the xerces-c sources. From there run./configure LDFLAGS=-no-undefinedOnce ./configure has finished it's best to move to the source directory because wedon't need to build the dozens of test applications and other stuff. So, do this:cd srcmakemake installThis takes a few minutes to be done.o boostFor boost there exists a testing package with cmake support. This, however, seems to bestable enough to build with the MinGW compiler. So, get the file boost-1.41.0.cmake0.zipfrom http://sodium.resophonic.com/boost-cmake/1.41.0.cmake0/ and unpack it.Now, start the cmake-gui.exe from within the MSYS command line. This is necessary for cmakein order to find the compiler and other stuff. Select the folder of the boost sources withthe CMakeLists.txt file, select a build directory and start Configure. You'll be asked forwhich system you want to generate the Makefiles. Select MSYS/Makefiles, not MinGW/Makefiles.When the configuration step has finished go to the options and search for WINMANGLE_LIBNAMES.Switch this off because otherwise the boost library names contain the compiler name. Thiscauses the boost cmake check to fail later when we try to build the FreeCAD sources. And forthe installtion folder choose the directory C:\MSYS\1.0\local.So, reconfigure boost and press on Generate once it has finished. Close the CMake GUI windowand entermakemake installinto the command line. This will take a couple of minutes.o eigen2Download eigen-2.0.15.tar.gz or any later version from http://eigen.tuxfamily.org/index.php?title=Main_Page.Unpack the files and start again cmake-gui. Set the installation directory to C:\MSYS\1.0\localand press on Configure and Generate. Close the window and start the installation withmakemake installo Qt4From the Qt website at ftp://ftp.trollech.com you can download already prebuilt packages for theMinGW platform. But depending on the version you have installed it can happen that they don't fittogether. In this case the source tarball must be downloaded. Use version 4.5.3 or higher. Unpackthe sources and start the configure.exe you'll find inside the sources../configureBy default the build the debug and release version. If you only want the release version use theoption "-release".Configure will ask you some questions under which license you want to use Qt. Choose LGPL here.Now run the build withmakeThis can take quite some time because Qt has become a really huge library over the years. Once thebuild has finished run amake installto copy the header files to their right place. All the binaries and header files are still insidethe source folder. If you like you can copy all the .dll, .a, and the direcories under "include" tothe subdirectories of C:\MSYS\1.0\local.o CoinGet a source archive from www.coin3d.org. Unpack the sources and run./confiuremakemake installIt may happen that a message dialog pops up due to a missing cygwin1.dll. You simply ignore this.o SoQtGet a source archive from www.coin3d.org. Unpack the sources and run./configure CXXFLAGS="-DCOIN_DLL" --with-qt=/usr/localmakemake installIn case your Qt development files are not under /usr/local choose the correct directory there.Again a message dialog may pop up due to the missing cygwin1.dll.o PyQt/sipWarning: the following is obsoleted from version 0.14, since FreeCAD is now usingpySide instead of PyQt. At the moment, PySide suport for MingW seems still not complete:https://bugreports.qt-project.org/browse/PYSIDE-113?page=com.atlassian.jira.plugin.system.issuetabpanels%3aall-tabpanelDownload the sources archives for sip and PyQt4 from www.riverbankcomputing.co.uk.In order to build sip extract the archive and open a MSYS command line. From withinits source archive callpython configure.py --platform win32-g++ --destdir=/usr/localmakeIt may happen that this step aborts because the Python include headers cannot be found.In this case edit the Makefile and add the include path for the ython headers and alsothe path and filename of the Python library.Unfortunately, the 'make install' command doesn't work because the Makefile was generatedto use Windows batch commands instead of bash commands. Thus, copy the following files toa path where Python can find it, e.g. /usr/local/bin.sipconfig.pysipdistutils.pysiputils.pysip.pydsip.exeIn order to build PyQt4 extract the source archive and open a MSYS command line. Go to thedirectory and startexport PATH=/usr/local/lib/:$PATHpython configure.py --destdir=/usr/local/lib/site-packagesmakeSince the Makefile doesn't find the Python header files copy them all and also the file sip.hto a directory where they can be found. A good place seems to be the directory of the Qt sources.There copy the files to $QTDIR/include. The Python library file python26.dll.a can go $QTDIR/lib.After the build has finished you have to copy all files that end with .pyd to their destination,e.g. /usr/local/lib/site-packages/PyQt4. Lateron when you have built the FreeCAD sources you haveto copy the PyQt4 directory and sip.pyd to the FreeCAD bin directory or set a symlink.o ODETODO: Still not clear if this will be used. (http://www.ode.org), >= 0.10.xo OpenCASCADEFor the build of the OpenCASCADE libraries get the sources from www.opencascade.org or alternativelyit is also possible to download a stripped source tarball from the Debian mirrors which don't includeany fonts and other resource files.Unpack the sources and download a CMake script from http://opencascade-cmake.googlecode.com/svn/trunk/and the file occ_config.h.cmake. Copy both files into the 'ros' directory, start cmake-gui fromwithin a MSYS command line and select MSYS Makefiles. In the options the following switches can bedisabled:OPENCASCADE_WRAPPERSOPENCASCADE_VISUALISATIONOPENCASCADE_OCAFOPENCASCADE_DRAWThen specify for OPENCASCADE_INSTALL_PREFIX C:/MSYS/1.0/local as destination directory-Now click the Configure button which takes a while and afterwards the Generate button.Note: The original sources don't completely compile with MinGW. Therefore you have to apply the patchOpenCASCADE6.3.0-MinGW.patch from http://code.google.com/p/opencascade-cmake/source/browse/trunkNote: The original sources includes also a configure script and the Makefile.am files.But it appeared to be very hard to build the libraries this way. Thus, it highlyrecommended to do it the CMake way.Note: For a couple of libraries the arguments passed to the linker exceeds the number ofallowed characters and thus the linker stops with an error: "Bad file number".To solve this issue you can open the file build.make of the according library andsplit the block (e.g. TKGeomAlgo_OBJECTS) into several smaller ones and modify thebuild rule this way that you create first a static library, add the other objectfiles to the group and then unpack the static archive into one directory. Thistrick solves the problem to reduce the whole number of characters.Afterwards the shared library can be built out of these object files.Example:If the build.make file has a line of the formg++ <options> -shared -o libTKGeomAlgo.dll $(TKGeomAlgo_OBJECTS) <libs>then change it intoar rcs win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS1)ar q win32/libTKGeomAlgo.a $(TKGeomAlgo_OBJECTS2)...ar x win32/libTKGeomAlgo.ag++ <options> -shared -o libTKGeomAlgo.dll *.obj <libs>rm -f *.objo NetgenModify the following files:* libsrc/meshing/improve2.hppAdd DLL_HEADER to class MeshOptimize2d* libsrc/meshing/meshclass.hppAdd DLL_HEADER to CalcSurfacesOfNode* libsrc/meshing/meshtype.hppAdd DLL_HEADER to classes SurfaceElementIndex, MeshPoint, Element2d (int anp),* libsrc/occ/occgeom.hppAdd DLL_HEADER to classes Line, OCCGeometry, OCCParameters, OCCGenerateMesh* libsrc/occ/occmeshsurf.hppAdd DLL_HEADER to classes OCCSurface, Meshing2OCCSurfaces, MeshOptimize2dOCCSurfaces, OCCRefinementSurfacesRun the configure script with these arguments./configure --prefix=/usr/local --enable-shared --enable-occ --with-occ=/usr/local --with-tcl=/usr/local/lib --enable-nglib CXXFLAGS="-DNGLIB_EXPORTS -DWNT"make && make installBuilding the FreeCAD sources----------------------------In order build the FreeCAD sources either get the developer sources from the SVN repositoryor get one of the .tar.gz tarballs and extract it.Now start cmake-gui.exe from within a MSYS command line window and browse to the FreeCADsources and also define the build directory. Now run Configure. It may happen that cmakecomplains about some not found libraries. In this case go through the listed libraries andchoose the include directory and/or the path to the library where needed. Once Confgiureaccepts all your input create the Makefiles by clicking on Generate. Now close the windowand entermakemake installThis will take a couple of minutes. From the command line window change to the FreeCAD binfolder and start the application with ./FreeCAD. In case it complains about some DLLs it cannotfind you have to extend your PATH environment variable withexport PATH=$PATH:/usr/local/bin:/usr/local/libIf no grave problems remains repeating ./FreeCAD should start the application now.Note: In order to let CMake detect the boost libraries you must make sure that theDLLs are in the system path because the check builds some test applicationsand tries to start them. If the DLLs are not in path CMake says that it cannotfind boost. In this case do a export PATH=/usr/local/lib:$PATHHave fun!