| ← Older revision |
Revision as of 22:00, 31 December 2011 |
| (2 intermediate revisions by one user not shown) |
| Line 1: |
Line 1: |
| − |
I managed to compile OpenSCAD on 04.May.2011. I'll try to document the necessary steps. |
+ |
This is a set of instructions for building OpenSCAD with the Microsoft Visual C++ compilers. |
| − |
The build is as static as reasonable, with no external DLL dependencies that are not shipped with Windows |
|
| |
|
|
|
| − |
Update July 2011. I followed the steps, but had to alter some of them to get CGAL to link properly. I was on Windows XP SP 2. I used the same exact tools listed under 'downloads'. |
+ |
The build is as static as reasonable, with no external DLL dependencies that are not shipped with Windows |
| |
|
|
|
| |
==Downloads== |
|
==Downloads== |
| |
start by downloading: |
|
start by downloading: |
| |
|
|
|
| − |
*vcexpress http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso |
+ |
*Visual Studio Express http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso |
| |
*QT (for vs2008) http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.2-vs2008.exe |
|
*QT (for vs2008) http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.2-vs2008.exe |
| |
*git http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe |
|
*git http://msysgit.googlecode.com/files/Git-1.7.4-preview20110204.exe |
| Line 134: |
Line 134: |
| |
|
|
|
| |
===OpenSCAD=== |
|
===OpenSCAD=== |
| − |
In the openscad directory, edit the following files: |
|
| |
|
|
|
| − |
'''openscad.pro''' |
+ |
*Bison/Flex: Open the mingw shell and type <code>mingw-get install msys-bison</code>. Then do the same for flex: <code>mingw-get install msys-flex</code> |
| |
|
|
|
| − |
To prevent a VERSION error at buildtime on Windows XP, change |
+ |
*Open the QT Shell, and copy/paste the following commands |
| − |
isEmpty(VERSION) VERSION = $$system(date /t) |
|
| − |
to |
|
| − |
isEmpty(VERSION) VERSION = "2011.07.20" |
|
| − |
(or your preferred version number) |
|
| − |
|
|
| − |
'''bison.pri and flex.pri''' |
|
| − |
|
|
| − |
These files should work OK as-is, because Git adds <code>"C:Program FilesGitbin"</code> (which has bison and flex) to Windows' environment variable <code>PATH</code>. If it fails for some reason, then you have to edit bison.pri and flex.pri and tell qmake where bison and flex are: |
|
| − |
|
|
| − |
*In bison.pri, in the lines that say bison.commands and bison_header.commands, change "bison" to "C:MinGWmsys1.0binbison.exe" |
|
| − |
** Note: 06/20/2011 I couldn't find "bison.exe" anywhere inside MinGW and instead found it in "C:Program FilesGitbin". |
|
| − |
*** Note: 7/20/2011 To get with ming, open mingw shell and type <code>mingw-get install msys-bison</code> |
|
| − |
*In flex.pri, in the line that says flex.commands, change "flex" to "C:MinGWmsys1.0binflex.exe" |
|
| − |
** Note: 06/20/2011 I couldn't find "flex.exe" anywhere inside MinGW and instead found it in "C:Program FilesGitbin". |
|
| − |
*** Note: 7/20/2011 To get with ming, open mingw shell and type <code>mingw-get install msys-flex</code> |
|
| − |
|
|
| − |
'''Building''' |
|
| − |
|
|
| − |
Now, from within the QT Command Prompt, run the following commands: |
|
| |
|
|
|
| |
cd C:openscad |
|
cd C:openscad |
| Line 146: |
Line 145: |
| |
set LIB=%LIB%C:boost_1_46_1lib;C:glew-1.5.8lib;C:OpenCSG-1.3.2lib |
|
set LIB=%LIB%C:boost_1_46_1lib;C:glew-1.5.8lib;C:OpenCSG-1.3.2lib |
| |
qmake |
|
qmake |
| − |
|
|
| − |
Ignore the warnings. |
|
| − |
|
|
| − |
Now run |
|
| − |
|
|
| |
nmake -f Makefile.Release |
|
nmake -f Makefile.Release |
| |
|
|
|
| − |
Wait for the nmake to end. Ignore all warnings, both from the compiler and the linker. There will be an openscad.exe file in the release folder. Enjoy. |
+ |
Wait for the nmake to end. There are usually a lot of non-fatal warnings about the linker. On success, there will be an openscad.exe file in the release folder. Enjoy. |
| |
|
|
|
| |
==Building an installer== |
|
==Building an installer== |
| Line 165: |
Line 159: |
| |
*Right-click on the file and compile it with NSIS. It will spit out a nice, easy installer. Enjoy. |
|
*Right-click on the file and compile it with NSIS. It will spit out a nice, easy installer. Enjoy. |
| |
<!-- preview - tests are not into the official release yet |
|
<!-- preview - tests are not into the official release yet |
| |
+ |
|
| |
==Compiling the regression tests== |
|
==Compiling the regression tests== |
| |
|
|
|
| |
*Follow all the above steps, build openscad, run it, and test that it basically works. |
|
*Follow all the above steps, build openscad, run it, and test that it basically works. |
| |
+ |
*Install Python 2.x (not 3.x) from http://www.python.org |
| |
*read openscaddocstesting.txt |
|
*read openscaddocstesting.txt |
| |
*Go into your QT shell |
|
*Go into your QT shell |
| |
|
|
|
| |
+ |
set PATH=%PATH%;C:Python27 (or your version of python) |
| |
cd c:openscadtests |
|
cd c:openscadtests |
| − |
mkdir build |
+ |
cmake . -DCMAKE_BUILD_TYPE=Release |
| − |
cd build |
+ |
Edit the CMakeCache.txt file, |
| − |
cmake .. |
+ |
search/replace /MD to /MT |
| − |
|
+ |
cmake . |
| − |
*Edit the CMakeCache.txt file, |
|
| − |
**search/replace /MD to /MT |
|
| − |
**change BUILD_TYPE to Release not Debug |
|
| − |
*re-run cmake & do build |
|
| − |
|
|
| − |
cmake .. |
|
| |
nmake -f Makefile |
|
nmake -f Makefile |
| |
|
|
|
| |
If you have link problems, see Troubleshooting, below. |
|
If you have link problems, see Troubleshooting, below. |
| − |
|
|
| − |
You will need to install Python 2.x to run tests. You can get it from |
|
| − |
|
|
| − |
http://www.python.org |
|
| − |
|
|
| − |
Set your PATH (using your version of python) |
|
| − |
|
|
| − |
set PATH=%PATH%;C:Python27 |
|
| − |
|
|
| − |
Now run |
|
| − |
|
|
| − |
nmake -f Makefile test |
|
| − |
|
|
| − |
--> |
|
| |
|
|
|
| |
== Troubleshooting == |
|
== Troubleshooting == |