failed to compile FreeCAD with windows

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Mika38
Posts: 45
Joined: Fri Feb 10, 2017 10:29 pm
Location: Swindon, Uk - from France

failed to compile FreeCAD with windows

Post by Mika38 »

Dear All,

I'm completely failed to compile FreeCAD with windows. Below, I'm going to share my first impression while trying, during around 10h, to compile this program. My point is that the tutorial is very not clear at all. Can some one who know what is talking about update the tutorial?

If it is possible, with step by step at each part (I am lost each time there is a sentence where I should take an initiative). With the parts in the right order. Without the use of "may", like in "you may not need to do that". And also, each part with an introduction and a conclusion at each part to explain what and why we need to do that. finely, no choice. I mean by that, they should be one official recommended way to do it, and separated alternatives.

So excuse me to ask for help, but it is impossible for me to compile with those informations.

So here is my impression (if you are interested, ;) I exaggerate a little bit):

I would like to start contributing to this wonderful project, but it is really complicate to manage to do so. The information from this page :
http://www.freecadweb.org/wiki/CompileOnWindows are not enough. May be they are enough for you, who know the project, but a newbie like me is lost. Like really lost :? :? .
So that where I am:
- I needed to download the source code using Git by imported it from the github depot.
- For that I had to download GitCola or Tortoise Git, GitCola bugged not Tortoise, no problem with that. I have copied the code on my computer.
I even follow a small course about git, just to be sure I'm do it right.
- I also download and install Cmake and Python, because it was in the Prerequisites.
- for the compiler, I'm sorry I don't understand the paragraph. There is too much implicit informations:
On Windows, the default compiler is M$ Visual Studio, be it the Express or Full 2008, 2012, or 2013 versions. You will also need to install the Windows Platform SDK to get several required libraries (e.g. Windows.h), though they may not be required with M$ compilers (either full or express).

For those who want to avoid installing the huge Visual Studio for the mere purpose of having a compiler, see CompileOnWindows - Reducing Disk Footprint.
Note

Though it may be possible to use Cygwin or MinGW gcc it's not tested or ported so far.
So should I download Microsoft express ? Which version ? where ? is it free :roll: ? What is the "Windows Platform SDK" ? where can I download it ? "though they may not be required with M$ compilers" So I don't need SDK ? Or what ??? what is Cygwin :geek: ? and MinGW gcc :ugeek: ? I imagine it a other compiler :mrgreen: . Is it really necessary to mentions it if it is not working :D ?(rhetorical questions no need to answer just update the page)

I never used Microsoft express, can I have more details about how this software work. At least, a link to a tutorial which give enough information to start with. Should I be an expert in visual studio to be part of the project?

- Then, the Third Party Libraries
To be honest, I not sure what a library is and if I need to place it next to my source code. I imagine the compiler need to accessed it. But how? Also, we are in 2017 the "CompileOnWindows" page speak about VS12 2013. If I understood well the current release version is 16. Then, why there is a link to a github depot with last modified file 2015-04-05. And by doing some research I found this forum post viewtopic.php?f=4&t=16874 pointing to a new libpacks, also without explanations what should I do with it.

- for the System Path Configuration.
There is not enough informations for me to achieved what is expected from me. I need a detail step by step operation to achieve it. Furthermore, There is optional informations which seems important. And they refer to some stuff at the end of the page, which are also confusing.

- Configuration with CMake
Configuration with CMake
The switch to CMake
Warning

Since FreeCAD version 0.9 we have stopped providing .vcproj files.
Great! I don't know what is Cmake, but I already have a warning. What is a .vcproj files? What should I do with this information? I didn't even compile a first time the program, and I already have to switch to something else? Version 0.9?

I little bit after :
The first step to build FreeCAD with CMake is to configure the environment. There are two ways to do it:

Using the LibPack
Installing all the needed libraries and let CMake find them
So here is the first step, so what was before didn't count. And I have to make a choice. Really? I don't know any thing and I have two possiblity. We are not in an RPG adventure. I just want the simple and unique way which work with a helpful narrative which cheers me up during the way.

-Building FreeCAD
great we are on the right direction, I should have start here. And again an other choice: 4 way to do it! But which one is the best? No recommendation. The writer want probably for me to analyse the 4 different options then choose the greatest of them all.

-finely Building older versions
In this part there is a relatively clear explanation of the parameter I should put in visual basic. Should I use those information to configuration my libraries? After all, it seems to be a better explanation that every thing I read before.

In conclusion, I need help so I created this post. I was unhappy to read out of date information on the web site (exemple: Libpack). Also, the instruction seems in the wrong order (compiling). And globally, there is no information about of what and why I should do each action. So, now I going to way for your help in the mean time I will continue to learn how to use this awsome program which is FreeCAD.

Thank for reading, and thank in advance if you help me.
;) Le chemin est long, mais la voie est libre :D The journey is long but the way is free 8-)
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: failed to compile FreeCAD with windows

Post by Jee-Bee »

Mika38 wrote:I'm completely failed to compile FreeCAD with windows.
I'm not windows gui so i don't not all off you're questions. What i basically read is that you don't have any experience with compiling (yet).
When you download the source from github, i'm quite sure that you download master. for 0.16 you have to download the 0.16 branch.
However i think that it is for you far more easy to download the pre-compiled version
see https://github.com/FreeCAD/FreeCAD/releases scroll down to 0.16 and check you're windows version.
If you want compile 0.17 not reslease version you're self (that's master) i asume somebody here can show some links to other threats with some how to.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: failed to compile FreeCAD with windows

Post by ulrich1a »

Mika38 wrote:I would like to start contributing to this wonderful project,
This is great. There are many ways to contribute to FreeCAD. From what you wrote, it sounds you have never made a C++-program on Windows. This will make your learning very intense, before you can contribute with C++ code to FreeCAD. If you have experience with C++ at other operation systems like linux, it is easier to start there with compiling FreeCAD.

But there is also the python-language integrated into FreeCAD. You can start right away from an installed version of FreeCAD to make changes at python code without the need of compiling FreeCAD. This is much easier and you can script very useful things in python. See the examples here: https://www.freecadweb.org/wiki/Macros_recipes

Have a look here for an introduction to python: https://www.freecadweb.org/wiki/Introduction_to_Python
and here for generating scripted parts: https://www.freecadweb.org/wiki/Topolog ... _scripting

Ulrich
User avatar
Mika38
Posts: 45
Joined: Fri Feb 10, 2017 10:29 pm
Location: Swindon, Uk - from France

Re: failed to compile FreeCAD with windows

Post by Mika38 »

Thank you very much for your answers. I going to follow your advice and start with easier task. Thank you for your links I will try to write some python on the software. Also I switch to ubuntu this week-end. It is something I really wanted to do before. And Compiling from linux looked easier.

I'm still thinking the tutorial to compile is not good enough.

Do I need to something to close this post ?
;) Le chemin est long, mais la voie est libre :D The journey is long but the way is free 8-)
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: failed to compile FreeCAD with windows

Post by sgrogan »

Mika38 wrote:I'm still thinking the tutorial to compile is not good enough.

Do I need to something to close this post ?
Your correct that the instruction need some love. Maybe some could try this to see if I've missed anything? If it is clear it can be the basis of a wiki update.

Code: Select all

1) Download and install git. The latest version is available here: https://git-scm.com/download/win
Allow the installer to add git to your system PATH
2) Download and install Cmake. The latest version is available here: https://cmake.org/download/
Any version >3.4 should work except 3.5.0 which has a known bug.
3) Download and install VS2013 CE. The latest version is available here: https://www.visualstudio.com/en-us/news/releasenotes/vs2013-community-vs
Note: VS2013 is VC12
4) Download and install 7zip. The latest version is available here: http://www.7-zip.org/download.html
5) Clone the FreeCAD GitHub repository
“git clone https://github.com/FreeCAD/FreeCAD.git free-cad-code”
6) To compile FreeCAD master (i.e. trunk) the 11.5 series of the Libpack is required. Do to additional dependencies added in the 0.17 development cycle, this is a work in progress. A working copy is available here: https://github.com/sgrogan/FreeCAD/releases/tag/0.17-med-test
For 64 bit systems download “FreeCADLibs_11.5.2_x64_VC12.7z “ and extract it using 7zip.
7) Start the Cmake gui.
8) Enter the path to the source code in the “Where is the source code:” field
9) Enter the path to where you would like to build the binaries in the “Where to build the binaries:” field. Make sure to choose a location where you have write access (i.e. DoNot choose a location that requires Admin privileges) and that is not in the FreeCAD source tree.
10) Click “Configure” in CMake, CMake will ask to create the new build directory, accept this. Next Cmake will ask to specify the generator make sure to choose “Visual Studio 12 2013 Win64” CMake will fail.
11) Un-check “BUILD_FEM_NETGEN” in  Cmake.
Change the “FREECAD_LIBPACK_DIR” to the path where you extracted the libpack.  If you extracted it in your Downloads folder it will look like this: “C:\Users\USERNANE\Downloads\FreeCADLibs_11.5.2_x64_VC12”
12) Click “Configure” There will be some warning about Doxgen, but no errors.
13) Click “Generate” This should succeed. Close the Cmake gui.
14) Copy the bin subdirectory to the root of the build folder.
15) Navigate to the build directory and double click on FreeCAD_trunk.sln
The Visual Studio IDE should open and load the project. This may take some time based on your system.
16) There will be 2 drop downs in the VS toolbar menu. Change Debug to Release.
Click the dropdown for Win32 and “Configuration Manager...” From the “Active solution  platform” dropdown choose new, then from the “Type or select the new platform” dropdown select “x64” Close all sub-menus.
17) From the VS menu choose Build > Build Solution
Wait for FreeCAD to build. You should get 82 successful projects and 4 skipped. Close Visual Studio.
18) Navigate to the bin sub-directory of the build folder and start FreeCAD by double clicking on FreeCAD.exe.
Attachments
Build_FreeCAD_Release_x64.pdf
(29.61 KiB) Downloaded 284 times
"fight the good fight"
wdtj
Posts: 8
Joined: Fri Aug 05, 2016 12:57 am

Re: failed to compile FreeCAD with windows

Post by wdtj »

Much better. Thanks.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: failed to compile FreeCAD with windows

Post by easyw-fc »

sgrogan wrote: Mon Feb 13, 2017 5:36 pm Maybe some could try this to see if I've missed anything? If it is clear it can be the basis of a wiki update.
Hi @sgrogan
I can confirm that following these instruction I can build FC on win 10-64b
I have only an issue regarding FC Version
if I digit in Python console

Code: Select all

print FreeCAD.Version()
I get

Code: Select all

['0', '17', 'Unknown', 'Unknown', 'Unknown']
Is there a way to align the Version()[2] to Git Nbr?
I'm building my FC from a git branch and I know I can get the git count from

Code: Select all

git rev-list --count HEAD
but I don't know hot to apply the git count to FC src to have it in the building

Thx
Maurice
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: failed to compile FreeCAD with windows

Post by sgrogan »

easyw-fc wrote: Sun Jul 09, 2017 6:29 am but I don't know hot to apply the git count to FC src to have it in the building
You need to add git to the widows PATH, for me it's

Code: Select all

C:\Program Files (x86)\Git\bin
"fight the good fight"
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: failed to compile FreeCAD with windows

Post by easyw-fc »

sgrogan wrote: Sun Jul 09, 2017 6:17 pm You need to add git to the widows PATH, for me it's

Code: Select all

C:\Program Files (x86)\Git\bin
thanks, it works now! :D
It would be possible to add the instructions to build in windows to the wiki? (may be adding this gith path part also)
http://www.freecadweb.org/wiki/CompileOnWindows

PS I noticed that in the Libs
https://github.com/sgrogan/FreeCAD/rele ... 64_VC12.7z
there is the old numpy release instead of the '1.12.0'
and OCC is 7.0.0 instead of 7.1.0 as in the release builds

Thanks for your work in making the building for FC! I couldn't have even approached FC once I started to work with, without those builds!

Maurice
Last edited by easyw-fc on Tue Jul 11, 2017 3:27 pm, edited 1 time in total.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: failed to compile FreeCAD with windows

Post by easyw-fc »

sgrogan wrote: Sun Jul 09, 2017 6:17 pm You need to add git to the widows PATH, for me it's

Code: Select all

C:\Program Files (x86)\Git\bin
Hi Chris,
is there a way to package the building in a FC-build.7z as per the releases downloadable at github?
I tried to make a folder named FreeCAD and inside put:
- bin
- data
- Mod
- lib
as in the built folder.. but the file size is huge compare to the one of the FC distribution...
Then I deleted recursively all *.pdb files and the file size is much more reasonable, still almost the double of github releases ...

Thx as always
Maurice
Post Reply