discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Compile OpenSCAD on Windows?

S
Scalpel78
Sun, Dec 14, 2014 10:30 AM

I think it would be really valuable for the OpenSCAD project if we managed to
come up with a step-by-step guide on how to do development and testing on
Windows machines.

I'm sure there are very skilled programmers out there which would contribute
to the OpenSCAD source if it was easy to get started.

The Wiki could use a new and updated page on how to set up the development
environment in Windows. I don't think it really matters if it uses Qt
Creator or Visual Studio, as long as it it a working guide as to how to get
started.

I can start work on such a page, and can be a guinnea pig when it comes to
following the instructions, but when it comes to the nitty gritty details on
figuring out which parameters to use, which header files to copy where etc,
I'm not capable of figuring that out myself.

But if we can cooperate on what do download, which libraries are needed, how
to compile them and how to configure Qt Creator, then I'm in.

The goal for me would be to end up with a functional wiki-page, which then
can be used to attract new experienced developers on the Windows platform -
thus making my new favorite CAD software better :)

--
View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10527.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I think it would be really valuable for the OpenSCAD project if we managed to come up with a step-by-step guide on how to do development and testing on Windows machines. I'm sure there are very skilled programmers out there which would contribute to the OpenSCAD source if it was easy to get started. The Wiki could use a new and updated page on how to set up the development environment in Windows. I don't think it really matters if it uses Qt Creator or Visual Studio, as long as it it a working guide as to how to get started. I can start work on such a page, and can be a guinnea pig when it comes to following the instructions, but when it comes to the nitty gritty details on figuring out which parameters to use, which header files to copy where etc, I'm not capable of figuring that out myself. But if we can cooperate on what do download, which libraries are needed, how to compile them and how to configure Qt Creator, then I'm in. The goal for me would be to end up with a functional wiki-page, which then can be used to attract new experienced developers on the Windows platform - thus making my new favorite CAD software better :) -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10527.html Sent from the OpenSCAD mailing list archive at Nabble.com.
S
Scalpel78
Sun, Dec 14, 2014 11:45 AM

I've started on a new Wiki-page here:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Microsoft_Windows

Feel free to add information!

--
View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10528.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I've started on a new Wiki-page here: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Microsoft_Windows Feel free to add information! -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10528.html Sent from the OpenSCAD mailing list archive at Nabble.com.
T
tdeagan
Sun, Dec 14, 2014 5:18 PM

I've got a fresh Win8.1 machine that I'm setting up per the new model.

First issue that Ive noticed in installing Qt is that there are a LOT of
choices about what gets installed, both version and component.  I'm starting
with the most recent version of Qt, 5.4 and probably a big overkill on
additional components.  Download is taking 8+ hours.

We'll want to figure out what the minimal install is at some point, and I
have no doubt that either Qt or some number of its associated tools or
addons (e.g. MinGW) will have to be downgraded.

I'm keeping notes, hopefully the right ones!
--t

--
View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10529.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I've got a fresh Win8.1 machine that I'm setting up per the new model. First issue that Ive noticed in installing Qt is that there are a LOT of choices about what gets installed, both version and component. I'm starting with the most recent version of Qt, 5.4 and probably a big overkill on additional components. Download is taking 8+ hours. We'll want to figure out what the minimal install is at some point, and I have no doubt that either Qt or some number of its associated tools or addons (e.g. MinGW) will have to be downgraded. I'm keeping notes, hopefully the right ones! --t -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10529.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Sun, Dec 14, 2014 5:22 PM

On 12/14/2014 06:18 PM, tdeagan wrote:

We'll want to figure out what the minimal install is at some point, and I
have no doubt that either Qt or some number of its associated tools or
addons (e.g. MinGW) will have to be downgraded.

Maybe MSYS2 is the easiest way to get everything running. This includes
qtcreator and most of the libraries. Actually only OpenCSG and QScintilla
are missing.

=> https://msys2.github.io/

Using the MXE builds with the Qt download does not work as they seem to
use different configuration regarding C++ exceptions so the libraries built
with MXE are not compatible with the MinGW shipped with Qt Creator.

ciao,
Torsten.

On 12/14/2014 06:18 PM, tdeagan wrote: > We'll want to figure out what the minimal install is at some point, and I > have no doubt that either Qt or some number of its associated tools or > addons (e.g. MinGW) will have to be downgraded. > Maybe MSYS2 is the easiest way to get everything running. This includes qtcreator and most of the libraries. Actually only OpenCSG and QScintilla are missing. => https://msys2.github.io/ Using the MXE builds with the Qt download does not work as they seem to use different configuration regarding C++ exceptions so the libraries built with MXE are not compatible with the MinGW shipped with Qt Creator. ciao, Torsten.
M
mx
Sun, Dec 14, 2014 5:58 PM

Did you manage to load the .pro file with QtCreator on Windows?
When I tried this a while ago QtCreator couldn't load the file.

Also I feel like I must warn you. It will be a lot easier to setup a
secondary/virtual linux pc. Getting all these dependencies configured and
compiled on Windows... I tried but ... lost patience


lazy.scad - http://www.thingiverse.com/thing:512443

View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10531.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Did you manage to load the .pro file with QtCreator on Windows? When I tried this a while ago QtCreator couldn't load the file. Also I feel like I must warn you. It will be a lot easier to setup a secondary/virtual linux pc. Getting all these dependencies configured and compiled on Windows... I tried but ... lost patience ----- lazy.scad - http://www.thingiverse.com/thing:512443 -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10531.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Sun, Dec 14, 2014 6:05 PM

On 12/14/2014 06:58 PM, mx wrote:

Did you manage to load the .pro file with QtCreator on Windows?
When I tried this a while ago QtCreator couldn't load the file.

Yes, there's a small change needed in version.pri:

It jumps into the Unix branch and executes date with the Unix parameters
causing it to wait for user input.

Changing:
win32-msvc*:!mingw-cross-env

To:
win*:!mingw-cross-env {

prevents that.

Otherwise I've just hacked the include/lib path into openscad.pro to see
if it's compiling.
That works so far that the welcome screen comes up, but when trying to
open the main window it terminates with a Qt error:

QWidget: Must construct a QApplication before a QWidget

ciao,
Torsten.

On 12/14/2014 06:58 PM, mx wrote: > Did you manage to load the .pro file with QtCreator on Windows? > When I tried this a while ago QtCreator couldn't load the file. > Yes, there's a small change needed in version.pri: It jumps into the Unix branch and executes date with the Unix parameters causing it to wait for user input. Changing: win32-msvc*:!mingw-cross-env To: win*:!mingw-cross-env { prevents that. Otherwise I've just hacked the include/lib path into openscad.pro to see if it's compiling. That works so far that the welcome screen comes up, but when trying to open the main window it terminates with a Qt error: QWidget: Must construct a QApplication before a QWidget ciao, Torsten.
S
Scalpel78
Sun, Dec 14, 2014 7:19 PM

Torsten, I made that first change, and now it properly lists files in the Qt
Creator project tree. But what is that other change you refer to as "I've
just hacked the include/lib path into openscad.pro to see
if it's compiling." ?

--
View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10534.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Torsten, I made that first change, and now it properly lists files in the Qt Creator project tree. But what is that other change you refer to as "I've just hacked the include/lib path into openscad.pro to see if it's compiling." ? -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10534.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Sun, Dec 14, 2014 7:42 PM

On 12/14/2014 08:19 PM, Scalpel78 wrote:

Torsten, I made that first change, and now it properly lists files in the Qt
Creator project tree. But what is that other change you refer to as "I've
just hacked the include/lib path into openscad.pro to see
if it's compiling." ?

In Release mode it works now. I guess we do something wrong which does not
trigger the qFatal() on other platforms. So that's maybe a real issue and
not a problem with the native Windows build environment.

Install MSYS2 (I've used the 64 bit version)

  • libs

$ pacman -Sy
$ pacman -S mingw-w64-x86_64-qt-creator
$ pacman -S mingw-w64-x86_64-boost
$ pacman -S mingw-w64-x86_64-cgal
$ pacman -S mingw-w64-x86_64-éigen3
$ pacman -S mingw-w64-x86_64-glew

  • QScintilla

$ unzip QScintilla-gpl-2.8.4.zip
$ cd QScintilla-gpl-2.8.4/Qt4Qt5
$ /c/msys64/mingw64/bin/qmake.exe
$ export PATH="$PATH:/c/msys64/mingw64/bin"
$ mingw32-make.exe
$ mingw32-make.exe install

  • OpenCSG

$ tar xvf OpenCSG-1.4.0.tar.gz
$ cd OpenCSG-1.4.0/src
change LIBS in src.pro: LIBS += -lglew32
$ qmake
$ mingw32-make.exe
$ mingw32-make.exe install
^ This installs to /usr/local - I've copied the files to the normal
lib folder (C:\msys64\mingw64\lib)


All that needs to the respective qmake files... but here it is just hardcoded
in openscad.pro... nothing that should go into any documentation.

win* {
FLEXSOURCES = src/lexer.l

  • BISONSOURCES = src/parser.y
  • BISONSOURCES = src\parser.y
  • QMAKE_CXXFLAGS += -DNOGDI -DGLEW_STATIC -DOPENSCAD_QTGUI -Wa,--hash-size=2048 -O2
  • QMAKE_CXXFLAGS += -I/c/msys64/mingw64/include
  • QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/eigen3"
  • QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/freetype2"
  • QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/harfbuzz"
  • QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/glib-2.0"
  • QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/lib/glib-2.0/include"
  • QMAKE_LFLAGS += -I/mingw64/lib
  • LIBS += -lintl -lglib-2.0 -lCGAL -lglew32 -lfontconfig -lfreetype -lharfbuzz -lmpfr -lgmp
    } else {

Add boost libs

isEmpty(BOOST_LINK_FLAGS):win* {
  • BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1
    -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1 -llibboost_regex-vc90-mt-s-1_46_1
  • DEFINES += BOOST_STATIC
  • DEFINES += BOOST_THREAD_USE_LIB
  • DEFINES += Boost_USE_STATIC_LIBS
  • #BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1
    -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1 -llibboost_regex-vc90-mt-s-1_46_1
  • BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
    }

Comment out one line in glew.pri

win32:LIBS += -lglew32s

Comment out two lines in cgal.pri

win*: QMAKE_INCDIR += $$CGAL_DIR/auxiliary/gmp/include

LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc110-mt-gd

On 12/14/2014 08:19 PM, Scalpel78 wrote: > Torsten, I made that first change, and now it properly lists files in the Qt > Creator project tree. But what is that other change you refer to as "I've > just hacked the include/lib path into openscad.pro to see > if it's compiling." ? > In Release mode it works now. I guess we do something wrong which does not trigger the qFatal() on other platforms. So that's maybe a real issue and not a problem with the native Windows build environment. Install MSYS2 (I've used the 64 bit version) * libs $ pacman -Sy $ pacman -S mingw-w64-x86_64-qt-creator $ pacman -S mingw-w64-x86_64-boost $ pacman -S mingw-w64-x86_64-cgal $ pacman -S mingw-w64-x86_64-éigen3 $ pacman -S mingw-w64-x86_64-glew * QScintilla $ unzip QScintilla-gpl-2.8.4.zip $ cd QScintilla-gpl-2.8.4/Qt4Qt5 $ /c/msys64/mingw64/bin/qmake.exe $ export PATH="$PATH:/c/msys64/mingw64/bin" $ mingw32-make.exe $ mingw32-make.exe install * OpenCSG $ tar xvf OpenCSG-1.4.0.tar.gz $ cd OpenCSG-1.4.0/src change LIBS in src.pro: LIBS += -lglew32 $ qmake $ mingw32-make.exe $ mingw32-make.exe install ^ This installs to /usr/local - I've copied the files to the normal lib folder (C:\msys64\mingw64\lib) ------ All that needs to the respective qmake files... but here it is just hardcoded in openscad.pro... nothing that should go into any documentation. win* { FLEXSOURCES = src/lexer.l - BISONSOURCES = src/parser.y + BISONSOURCES = src\\parser.y + QMAKE_CXXFLAGS += -DNOGDI -DGLEW_STATIC -DOPENSCAD_QTGUI -Wa,--hash-size=2048 -O2 + QMAKE_CXXFLAGS += -I/c/msys64/mingw64/include + QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/eigen3" + QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/freetype2" + QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/harfbuzz" + QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/include/glib-2.0" + QMAKE_CXXFLAGS += -I"c:/msys64/mingw64/lib/glib-2.0/include" + QMAKE_LFLAGS += -I/mingw64/lib + LIBS += -lintl -lglib-2.0 -lCGAL -lglew32 -lfontconfig -lfreetype -lharfbuzz -lmpfr -lgmp } else { Add boost libs isEmpty(BOOST_LINK_FLAGS):win* { - BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1 -llibboost_regex-vc90-mt-s-1_46_1 + DEFINES += BOOST_STATIC + DEFINES += BOOST_THREAD_USE_LIB + DEFINES += Boost_USE_STATIC_LIBS + #BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1 -llibboost_regex-vc90-mt-s-1_46_1 + BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt } Comment out one line in glew.pri # win32:LIBS += -lglew32s Comment out two lines in cgal.pri # win*: QMAKE_INCDIR += $$CGAL_DIR/auxiliary/gmp/include # LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc110-mt-gd
RR
Robert Rapplea
Sun, Dec 14, 2014 8:01 PM

"I have no doubt that either Qt or some number of its associated tools or addons
(e.g. MinGW) will have to be downgraded. "

On this point, everything we include needs to be tagged with a version and/or
build number. The world of Java is really good about this with Maven and C# has
NuGet, but I don't know if there's an equivalent for C++.

On 12/14/2014 10:18 AM, tdeagan wrote:

I've got a fresh Win8.1 machine that I'm setting up per the new model.

First issue that Ive noticed in installing Qt is that there are a LOT of
choices about what gets installed, both version and component.  I'm starting
with the most recent version of Qt, 5.4 and probably a big overkill on
additional components.  Download is taking 8+ hours.

We'll want to figure out what the minimal install is at some point, and I
have no doubt that either Qt or some number of its associated tools or
addons (e.g. MinGW) will have to be downgraded.

I'm keeping notes, hopefully the right ones!
--t

"I have no doubt that either Qt or some number of its associated tools or addons (e.g. MinGW) will have to be downgraded. " On this point, everything we include needs to be tagged with a version and/or build number. The world of Java is really good about this with Maven and C# has NuGet, but I don't know if there's an equivalent for C++. On 12/14/2014 10:18 AM, tdeagan wrote: > I've got a fresh Win8.1 machine that I'm setting up per the new model. > > First issue that Ive noticed in installing Qt is that there are a LOT of > choices about what gets installed, both version and component. I'm starting > with the most recent version of Qt, 5.4 and probably a big overkill on > additional components. Download is taking 8+ hours. > > We'll want to figure out what the minimal install is at some point, and I > have no doubt that either Qt or some number of its associated tools or > addons (e.g. MinGW) will have to be downgraded. > > I'm keeping notes, hopefully the right ones! > --t > > > > >
T
tdeagan
Mon, Dec 15, 2014 5:16 AM

mx wrote

Also I feel like I must warn you. It will be a lot easier to setup a
secondary/virtual linux pc. Getting all these dependencies configured and
compiled on Windows... I tried but ... lost patience

Ha!  I didn't take your */warning /*near seriously enough!  There are
definitely ominous omens surrounding this effort.  While installing msys2 on
my 'fresh' laptop it seemed to oddly hang during the download.  Then,
moments later, while printing an ornament for my festivus pole, I managed to
knock a can of hairspray off the shelf crashing it into the keyboard of the
laptop.  A really good solid kinetic transfer of energy.

The laptop worked for a little while, it hung, it worked, it hung hard, it
crashed.  It boots to recovery mode, recovery mode crashes.  It reboots and
boot manager denies the existence of any bootable media.  (and joy of joys,
it's a UEFI box, so futzing with the boot is a real can of fun  ).

Oh well, I wanted an SSD for the box in any case and now I'll get an early
christmas present.  If I'd known that setting up the environment for
building OpenSCAD in Windows involved starting from a virgin hard drive on
up, I might have hesitated...

But the motto that's gotten me through 20 years of software & hardware
development has always been "How hard can it be?"  So on to another learning
experience!

Cheers,
--tim

--
View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10542.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

mx wrote > Also I feel like I must warn you. It will be a lot easier to setup a > secondary/virtual linux pc. Getting all these dependencies configured and > compiled on Windows... I tried but ... lost patience Ha! I didn't take your */warning /*near seriously enough! There are definitely ominous omens surrounding this effort. While installing msys2 on my 'fresh' laptop it seemed to oddly hang during the download. Then, moments later, while printing an ornament for my festivus pole, I managed to knock a can of hairspray off the shelf crashing it into the keyboard of the laptop. A really good solid kinetic transfer of energy. The laptop worked for a little while, it hung, it worked, it hung hard, it crashed. It boots to recovery mode, recovery mode crashes. It reboots and boot manager denies the existence of any bootable media. (and joy of joys, it's a UEFI box, so futzing with the boot is a real can of fun ). Oh well, I wanted an SSD for the box in any case and now I'll get an early christmas present. If I'd known that setting up the environment for building OpenSCAD in Windows involved starting from a virgin hard drive on up, I might have hesitated... But the motto that's gotten me through 20 years of software & hardware development has always been "How hard can it be?" So on to another learning experience! Cheers, --tim -- View this message in context: http://forum.openscad.org/Compile-OpenSCAD-on-Windows-tp10516p10542.html Sent from the OpenSCAD mailing list archive at Nabble.com.