Compile on Win 7-30-19

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Compile on Win 7-30-19

Post by sgrogan »

Get the Libpack https://github.com/FreeCAD/FreeCAD/rele ... 64_VC15.7z
Extract with .7z where you want
Get CMake https://cmake.org/
Start the CMake-Gui, set the path to the source dir and build dir.
Run Configure, make sure you set the VS2015 generator and the bitness x64, it will fail.
Set the FREECAD_LIBPACK_DIR to where you placed the Libpack
You may need to set BUILD_QT5, if it's not set automatically, set it.
Run Configure, it should work, run Generate, close CMake-Gui
Double-click on FreeCAD.sln in the build folder.
This should open the VS2015 IDE, make sure Release and x64 are selected in the tabs at the top of the page.
Then Build > Build Solution
When this is finished, close the VS IDE, copy the contents of the Libpack/bin to build/bin
Start FreeCAD from the FreeCAD.exe in the build directory.
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Compile on Win 7-30-19

Post by uwestoehr »

sgrogan wrote: Tue Jul 30, 2019 11:16 pm Get the Libpack https://github.com/FreeCAD/FreeCAD/rele ... 64_VC15.7z
Extract with .7z where you want..
Thanks. I gave it a try and of course failed :cry: :

* I checked out Git master in this folder:
D:\FreeCADGit
* I created an empty folder
D:\FreeCAD-build
* In this folder I extracted the FreeCADLibs_12.1.3_x64_VC15.7z
* in CMake I set as source folder "D:/FreeCADGit" and as build folder "D:\FreeCAD-build"
* I set the x64 compiler option in the appearing dialog and chose VS2015

result:
I get an error:

Code: Select all

D:/FreeCAD-build/src/Base/QuantityPy.cpp
CMake Error at src/Base/CMakeLists.txt:184 (fc_wrap_cpp):
  Unknown CMake command "fc_wrap_cpp".
* I now I set the path to the LibPack in CMake and run Configure again.

result:

Code: Select all

 PyCXX found:
  Headers:  D:/FreeCADGit/src
  Sources:  D:/FreeCADGit/src/CXX
  Version:  6.2.8
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Boost (missing: filesystem program_options regex system
  thread) (found suitable version "1.67.0", minimum required is "1.48")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2142 (find_package_handle_standard_args)
  CMakeLists.txt:650 (find_package)
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Win 7-30-19

Post by sgrogan »

uwestoehr wrote: Sat Aug 03, 2019 4:46 pmresult:
Boost and CMake have not been playing nice recently. I'm using CMake 3.14.1, I had problems with 3.11.x with the 12.1.x Libpack.
I would check the advanced and grouped tabs in CMake, then configure. Then look at what is going on in the Boost group and/or Ungrouped Entries group.

EDIT: We are not alone https://www.sofa-framework.org/communit ... -in-cmake/
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Compile on Win 7-30-19

Post by uwestoehr »

sgrogan wrote: Tue Aug 06, 2019 9:32 pm Boost and CMake have not been playing nice recently. I'm using CMake 3.14.1
I downgraded to CMake 3.14.1 but get now this:

Code: Select all

cmake: 3.14.1
PyCXX found:
  Headers:  D:/FreeCADGit/src
  Sources:  D:/FreeCADGit/src/CXX
  Version:  6.2.8
CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2132 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.67.0
  Boost include path: D:/FreeCAD-build/FreeCADLibs_12.1.3_x64_VC15/include
  Could not find the following Boost libraries:

          boost_filesystem
          boost_program_options
          boost_regex
          boost_system
          boost_thread

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:650 (find_package)

CMake Error at CMakeLists.txt:666 (message):
  =============================================

  Required components:
   filesystem;program_options;regex;system;thread

  Not found, install the components:
   filesystem;program_options;regex;system;thread

  =============================================
I don't know how/where to set e.g. BOOST_ROOT .
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Win 7-30-19

Post by sgrogan »

uwestoehr wrote: Thu Aug 08, 2019 10:27 pm I don't know how/where to set e.g. BOOST_ROOT .
I don't have BOOST_ROOT either :|

I would try File > Delete Cache
You will need to then configure and set the libpack path.
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Compile on Win 7-30-19

Post by uwestoehr »

sgrogan wrote: Thu Aug 08, 2019 10:36 pm I would try File > Delete Cache
You will need to then configure and set the libpack path.
I already did this but I end up with the same error.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Compile on Win 7-30-19

Post by uwestoehr »

apeltauer wrote: Thu May 02, 2019 5:03 am
Can't anybody here help me? I mean it must be possible to compile FC using MSVC using the libpack.

I went now every singe CMake release down to CMake 3.13 but the problem is always the same:
Boost is not recognized by CMake but it is here:
D:\FreeCAD-build\FreeCADLibs_12.1.3_x64_VC15\include\boost

CMake however tells me this after running configure:
cmake-gui_lyl4xWT7Bk.png
cmake-gui_lyl4xWT7Bk.png (27.91 KiB) Viewed 2393 times
So even the include dir is wrong. It should be
D:\FreeCAD-build\FreeCADLibs_12.1.3_x64_VC15\include\boost
and not
D:\FreeCAD-build\FreeCADLibs_12.1.3_x64_VC15\include

But when I correct this in CMake, it changes it automatically back to
D:\FreeCAD-build\FreeCADLibs_12.1.3_x64_VC15\include
Last edited by uwestoehr on Tue Aug 13, 2019 11:36 am, edited 1 time in total.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Compile on Win 7-30-19

Post by apeltauer »

uwestoehr wrote: Mon Aug 12, 2019 11:20 pm But when I correct this in CMake, it changes it automatically back to
D:\FreeCAD-build\FreeCADLibs_12.1.3_x64_VC15\include\boost
I think

Code: Select all

FreeCADLibs_12.1.3_x64_VC15\include\boost
is the correct include dir for boost.
Can you post your whole cmake output?
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Compile on Win 7-30-19

Post by uwestoehr »

apeltauer wrote: Tue Aug 13, 2019 5:33 am I think

Code: Select all

FreeCADLibs_12.1.3_x64_VC15\include\boost
is the correct include dir for boost.
I think so too, but I always get

Code: Select all

FreeCADLibs_12.1.3_x64_VC15\include
I'll post the whole CMake output this evening.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Win 7-30-19

Post by sgrogan »

uwestoehr wrote: Tue Aug 13, 2019 11:38 am I think so too, but I always get
FreeCADLibs_12.1.3_x64_VC15\include works for me, I think for the headers CMake/FreeCAD looks for a pkgname directory in the include directory.
https://github.com/FreeCAD/FreeCAD/blam ... r.cmake#L4 is why it gets overwritten when you try to reset it. Don't know if this is a good idea?

My working CMake looks like this
Capture.PNG
Capture.PNG (81.96 KiB) Viewed 2339 times
Brute force setting all the lib paths would allow you to continue, but it would be good to know why others don't need to do this.

Probably here: https://github.com/FreeCAD/FreeCAD/blob ... s.txt#L421
"fight the good fight"
Post Reply