111 lines
3.8 KiB
Plaintext
111 lines
3.8 KiB
Plaintext
|
|
How to build and run FreeCAD under Windows
|
|
==========================================
|
|
|
|
Prerequisites
|
|
-------------
|
|
|
|
On Windows we use the IDE MS VisualStudio 9 with the highest service pack.
|
|
In case you don't want to use MS products you can also use the MinGW compiler,
|
|
alternatively. In this case continue on reading the manual README.MinGW.
|
|
You need cMake 2.6 or higher to generate the project files for VisualStudio.
|
|
Also you need all the 3rd party libraries to succsefully compile FreeCAD.
|
|
|
|
Using LibPack
|
|
-------------
|
|
|
|
To make it easier to get FreeCAD compiled, we provide a collection of all
|
|
needed libraries. It's called the LibPack. You can find it on the download
|
|
page on sourceforge.
|
|
|
|
Python needed
|
|
-------------
|
|
|
|
During the compilation some Python scripts get executed. So the Python interpreter
|
|
has to function on the OS. Use a command box to check it. If the Python library is
|
|
not properly installed you will get an error message like Cannot find python.exe.
|
|
If you use the LibPack you can also use the python.exe in the bin directory.
|
|
|
|
Compile
|
|
-------
|
|
|
|
In order to build the FreeCAD sources start the GUI frontend of cmake. If
|
|
doesn't already find the header files and libraries of the LibPack you have to
|
|
define the path where you have unpacked it.
|
|
|
|
After you conform to all prerequisites the compilation is - hopefully - only
|
|
a mouse click in VC ;-)
|
|
|
|
After Compiling
|
|
---------------
|
|
|
|
To get FreeCAD up and running from the compiler environment you need to move a
|
|
few files from the LibPack to the "bin" folder where FreeCAD.exe is installed
|
|
after a successfull build:
|
|
|
|
* python.exe and python_d.exe from LIBPACK/bin
|
|
* python26.dll and python26_d.dll from LIBPACK/bin
|
|
* python26.zip from LIBPACK/bin
|
|
* make a copy of python26.zip and rename it to python26_d.zip
|
|
|
|
|
|
Additional stuff
|
|
----------------
|
|
|
|
If you want to build the source code documentation you need DoxyGen.
|
|
To create an intstaller package you need WIX.
|
|
|
|
|
|
Additional information on building special 3rd party libraries
|
|
--------------------------------------------------------------
|
|
|
|
* Mefisto2F
|
|
|
|
The Salome SMESH library needs the Mefisto2F library which contains some Fortran code.
|
|
The easiest way is to convert the Fortran code into C code and use the f2c library to
|
|
build a static library.
|
|
|
|
1. Get the f2c utility from http://netlib.sandia.gov/f2c/mswin/index.html
|
|
2. Get f2c.h from http://netlib.sandia.gov/f2c/f2c.h
|
|
3. Convert the Fortran file trte.f into a C file trte.c using the f2c utility
|
|
>>> f2c trte.f
|
|
4. Get the sources for the lib f2c from http://netlib.sandia.gov/f2c/libf2c.zip and
|
|
pack them. Before doing the build do these changes:
|
|
|
|
arithchk.c:
|
|
#include <stddef.h>
|
|
typedef int ssize_t;
|
|
|
|
>>> cl -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -Ot1 -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT arithchk.c
|
|
|
|
makefile.vc:
|
|
CFLAGS = -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -Ot1 -DNO_My_ctype -DNO_ISATTY -MD
|
|
|
|
w = \
|
|
+trte.obj \
|
|
-main.obj \
|
|
|
|
Adding "-MD" is needed to link against the shared C runtime, not the static one.
|
|
|
|
libf2c.lbc:
|
|
+trte.obj
|
|
-main.obj
|
|
|
|
open.c:
|
|
Replace "access" with "_access"
|
|
|
|
Run nmake -f makefile.vc
|
|
|
|
5. Remove the __WATCOM__ define from the list of the preprocessor macros of the MESFISTO2
|
|
project.
|
|
6. Build the file vcf2c.lib with "nmake -f makefile.vc" and add it to the MEFISTO2 project as
|
|
additional library. The linker errors should now go away.
|
|
|
|
Alternatively, you can use the Watcom Fortran compiler. The needed project file can be get from
|
|
here: http://sourceforge.net/p/salomesmesh/code/HEAD/tree/trunk/adm/win32-watcom/
|
|
However, this doesn't work for x64 targets at the moment.
|
|
|
|
* FreeType
|
|
|
|
http://stackoverflow.com/questions/6207176/compiling-freetype-to-dll-as-opposed-to-static-library
|