New compilation instructions for Windows available

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

New compilation instructions for Windows available

Post by uwestoehr »

The description how to compile FreeCAD on Windows was completely outdated. Therefore I updated it and rewrote it in a way that also interested users who never compiled a program before should be able to compile:

CompileOnWindows

All comments are welcome.
(The only thing to do is to update the section about Qt creator.)

Here is the command line build script I refer to in the Wiki page:
compile-FC.txt
rename it to compile-FC.bat
(1.04 KiB) Downloaded 726 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: New compilation instructions for Windows available

Post by sgrogan »

uwestoehr wrote: Thu Sep 19, 2019 11:19 pm I don't understand. FreeCAD compiles AND you can run it. I describe this in the section https://www.freecadweb.org/wiki/Compile ... ng_FreeCAD
Even if you have the Libpack in your PATH some additional stuff still needs to be copied from the plugins directory of the Libpack to the bin directory of the build directory.
i.e in addition to the style sub dir platforms, iconengines, imageformats sub dirs are required.
Maybe you checked the CMake option to copy these automatically?
EDIT: I see this is there now. One point is that admin privileges are necessary to install into the the default CMAKE_INSTALL_PREFIX
EDIT2: I will work on a pull request to solve the styles issue. https://github.com/FreeCAD/FreeCAD/blob ... .txt#L1467
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: New compilation instructions for Windows available

Post by uwestoehr »

sgrogan wrote: Fri Sep 20, 2019 8:47 pm Even if you have the Libpack in your PATH some additional stuff still needs to be copied from the plugins directory of the Libpack to the bin directory of the build directory.
You don't need to have the LibPack in your PATH. I don't have it and everything works fine.
Also, as I write in the Wiki page, you don't need to copy anything manually, just set the 2 *_COPY_* CMake flags.
sgrogan wrote: Fri Sep 20, 2019 8:47 pm One point is that admin privileges are necessary to install into the the default CMAKE_INSTALL_PREFIX
That is just the default directory. You can change it to another folder and I described this. I don't know hat other default directory would be more suitable.
sgrogan wrote: Fri Sep 20, 2019 8:47 pm I will work on a pull request to solve the styles issue.
Many thanks. While you are at it, could you please enable the flag BUILD_QT5 by default?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: New compilation instructions for Windows available

Post by sgrogan »

uwestoehr wrote: Sat Sep 21, 2019 7:00 pm Many thanks. While you are at it, could you please enable the flag BUILD_QT5 by default?
I am looking at this. It looks like it is checked to see if QT5 is available and the flag is set, and then somewhere else unset ;)
Work is here:https://github.com/FreeCAD/FreeCAD/pull/2544
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: New compilation instructions for Windows available

Post by uwestoehr »

sgrogan wrote: Sat Sep 21, 2019 7:06 pm I am looking at this. It looks like it is checked to see if QT5 is available and the flag is set, and then somewhere else unset ;)
Work is here:https://github.com/FreeCAD/FreeCAD/pull/2544
Many thanks. Just for information: Why do we need to copy the
QtWebEngineProcess.exe and the qt.conf ?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: New compilation instructions for Windows available

Post by vocx »

I'm not saying that you have to make the instructions identical, but take a look at CompileOnUnix. I recently edited this page as well because it also had a lot of old information.

Maybe by reading that page you get some inspiration or pick some information on how things work. And you can also propose something to add that is mentioned in the Windows page, but missing in the Linux page.

Having updated information in Linux and Windows is nice. Hopefully people with MacOS systems also keep their information up to date.

By the way, there are still some compilation instructions for Cygwin (CompileOnCygwin) and MinGW (CompileOnMinGW), also on Windows. I believe those instructions are very outdated, but if it makes any sense they should probably be updated also.
Last edited by vocx on Mon Sep 23, 2019 5:44 pm, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: New compilation instructions for Windows available

Post by uwestoehr »

vocx wrote: Mon Sep 23, 2019 1:09 am I'm not saying that you have to make the instructions identical, but take a look at CompileOnUnix.... And you can also propose something to add that is mentioned in the Windows page, but missing in the Linux page.
Many thanks for having a look.

When I started to work on the Wiki page , I was upset that it was so incredibly outdated that I could not use it to get FC compiled. Therefore I almost rewrote it completely. While doing this, I had a look at CompileOnUnix.
I think the 2 main differences are:
* On Windows people don't use consoles. (personally, I also don't like them because I cannot remember commands and I make a lot of typos when executing them). Nevertheless I wrote a batch script that can executed from the command line to compile FC: https://www.freecadweb.org/wiki/Compile ... line_build
* There is the nice dependencies package called LibPack. This eases the process a lot and therefore I described the build process using LibPack.

I see now that my description misses the section on how to update the source code. I will add this according tot he Linux page as soon as possible.

vocx wrote: Mon Sep 23, 2019 1:09 am By the way, there are still some compilation instructions for Cygwin (CompileOnCygwin) and MinGW (CompileOnMinGW), also on Windows. I believe those instructions are very outdated, but if it makes any sense they should probably be also updated.
They are. But since I never worked with Cygwin nor MinGW, I cannot help. Moreover, I even think that at least Cygwin is simply not necessary since all dependencies used to compile FC are available as native Windows builds. So therefore I vote to add on top of CompileOnCygwin a label that the page is completely outdated, that Cygwin is not necessary and that it is recommended to use compile on Windows using the native dependencies as described in CompileOnWindows. What do you think?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: New compilation instructions for Windows available

Post by wmayer »

QtWebEngineProcess.exe and the qt.conf ?
This is required by the StartPage and if it cannot find them in the expected location the application crashes.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: New compilation instructions for Windows available

Post by uwestoehr »

wmayer wrote: Mon Sep 23, 2019 1:21 pm
QtWebEngineProcess.exe and the qt.conf ?
This is required by the StartPage and if it cannot find them in the expected location the application crashes.
Thanks.
However, then I don't understand the PR from sgrogan, because both files are already copied to the \bin folder when I use the 2 "*_COPY_*" CMake flags.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: New compilation instructions for Windows available

Post by vocx »

uwestoehr wrote: Mon Sep 23, 2019 10:28 am They are. But since I never worked with Cygwin nor MinGW, I cannot help. Moreover, I even think that at least Cygwin is simply not necessary since all dependencies used to compile FC are available as native Windows builds. So therefore I vote to add on top of CompileOnCygwin a label that the page is completely outdated, that Cygwin is not necessary and that it is recommended to use compile on Windows using the native dependencies as described in CompileOnWindows. What do you think?
Sounds fine by me.

And about using native compilation on Windows (LibPack) versus using Cygwin, I think the distinction is a bit ideological.

Cygwin uses the same Linux sources, but links against the Cygwin.dll library in order to provide that Unix compatibility layer that Linux programs expect. They also link against Cygwin's (GNU's) standard C libraries, instead of Microsoft's ones.

So, people who compile on Cygwin are using purely free software, while those that compile natively with the LibPack introduce the Windows non-free libraries. At least that's how I understand it.

Of course, many users don't care about this distinction, they just want the program to work.

So, I still think it has merit to update the Cygwin page, but as long as no one really tries to make FreeCAD work that way, and there are alternatives, then I guess we can't be bothered.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply