Compile on win 7

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Compile on win 7

Postby microelly2 » Sun Feb 09, 2014 9:52 am

I have compiled FreeCad on a very "fresh" win7 computer.
visual studio 9 2008
libpack FreeCADLibs_8.2_x86_VC9

There are some unexpected effects
OS: Windows 7
Platform: 32-bit
Version: 0.14.$WCREV$
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
Revisionnumber and Erscheinungsdatum is not correctly displayed.


After Compiling the start of FreeCAD.exe comes up with a lot of errors missing some dlls.
I copied all the requiered dll from libpack/bin into the built/bin
but then I got other errors.
My final workaround was a complete copy of all libpack/bin/* into built/bin

however: this is a little bit too much (838 MB)

I think, the instructions in the README.win32 are not enough and have to be extended (but I don't know what exactly):
After Compiling
---------------

To get FreeCAD up and running from the compiler environment you need to move a
few files from the LibPack to the "bin" folder where FreeCAD.exe is installed
after a successfull build:

* python.exe and python_d.exe from LIBPACK/bin
* python26.dll and python26_d.dll from LIBPACK/bin
* python26.zip from LIBPACK/bin
* make a copy of python26.zip and rename it to python26_d.zip
I also have modified the UseLibPack8x.cmake:
see discussion in viewtopic.php?f=10&t=5303&start=80#p43747

Code: Select all

#  SHIBOKEN_INCLUDE_DIR        - Directories to include to use SHIBOKEN
#  SHIBOKEN_LIBRARY            - Files to link against to use SHIBOKEN
#  SHIBOKEN_BINARY             - Executable name

SET(SHIBOKEN_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/shiboken)
SET(SHIBOKEN_LIBRARY     optimized ${FREECAD_LIBPACK_DIR}/lib/shiboken-python2.6.lib debug ${FREECAD_LIBPACK_DIR}/lib/shiboken-python2.6_d.lib)
set(SHIBOKEN_BINARY      ${FREECAD_LIBPACK_DIR}/bin/shiboken)

#  PYSIDE_INCLUDE_DIR   - Directories to include to use PySide
#  PYSIDE_LIBRARY       - Files to link against to use PySide
#  PYSIDE_PYTHONPATH    - Path to where the PySide Python module files could be found
#  PYSIDE_TYPESYSTEMS   - Type system files that should be used by other bindings extending PySide

SET(PYSIDE_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/PySide)
SET(PYSIDE_LIBRARY     optimized ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.6.lib debug ${FREECAD_LIBPACK_DIR}/lib/pyside-python2.7_d.lib)
SET(PYSIDE_PYTHONPATH  ${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages)
SET(PYSIDE_TYPESYSTEMS ${FREECAD_LIBPACK_DIR}/share/PySide/typesystems)
Because ther was no ${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages
I have copied this directory from liback V9 to libpack V8

Now Draft and Part/Part Design works.
wmayer
Site Admin
Posts: 15966
Joined: Thu Feb 19, 2009 10:32 am

Re: Compile on win 7

Postby wmayer » Sun Feb 09, 2014 11:22 am

There is no need to copy over any files. All what you have to do is extending the PATH environment variable so that it includes the bin directory of the LibPack and your git installation.
Revisionnumber and Erscheinungsdatum is not correctly displayed.
This happens because during the build we query git to return the hash values of all commits. Since it is not listed in your system path it cannot be started and thus leaves the revision and release date undefined.

To adjust the system path open the Control Panel > System > Advanced system settings > Environment variables and search for "Path" in the system variables list. Double-click on the item and add the bin paths of the LibPack and git. Use a semicolon as separator.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Compile on win 7

Postby microelly2 » Mon Feb 10, 2014 3:08 pm

I have set the PATH variable,
the dlls are all loaded now, but there still some pythonlibs are missed.

Start in bin (here are the cmake/mak-builted dlls and exe)

Ausgabefenster:
During initialization the error No module named sip occurred in E:\freecad\built_win4\Mod\Ship\InitGui.py
During initialization the error No module named _ctypes occurred in E:\freecad\built_win4\Mod\Plot\InitGui.py
Error: PySide not found, Draft workbench will be disabled.


>>> sys.path
['E:\\freecad\\built_win4\\Mod',
'E:\\freecad\\built_win4\\lib',
'E:\\freecad\\built_win4\\Mod\\Drawing', 'E:\\freecad\\built_win4\\Mod\\Inspection', 'E:\\freecad\\built_win4\\Mod\\Idf', 'E:\\freecad\\built_win4\\Mod\\Part', 'E:\\freecad\\built_win4\\Mod\\Robot', 'E:\\freecad\\built_win4\\Mod\\Arch', 'E:\\freecad\\built_win4\\Mod\\Mesh', 'E:\\freecad\\built_win4\\Mod\\Raytracing', 'E:\\freecad\\built_win4\\Mod\\Material', 'E:\\freecad\\built_win4\\Mod\\Web', 'E:\\freecad\\built_win4\\Mod\\Complete', 'E:\\freecad\\built_win4\\Mod\\Assembly', 'E:\\freecad\\built_win4\\Mod\\Import', 'E:\\freecad\\built_win4\\Mod\\Test', 'E:\\freecad\\built_win4\\Mod\\Draft', 'E:\\freecad\\built_win4\\Mod\\Points', 'E:\\freecad\\built_win4\\Mod\\Start', 'E:\\freecad\\built_win4\\Mod\\Spreadsheet', 'E:\\freecad\\built_win4\\Mod\\Fem', 'E:\\freecad\\built_win4\\Mod\\OpenSCAD', 'E:\\freecad\\built_win4\\Mod\\MeshPart', 'E:\\freecad\\built_win4\\Mod\\Plot', 'E:\\freecad\\built_win4\\Mod\\Ship', 'E:\\freecad\\built_win4\\Mod\\PartDesign', 'E:\\freecad\\built_win4\\Mod\\Image', 'E:\\freecad\\built_win4\\Mod\\ReverseEngineering',
'E:\\freecad\\built_win4\\Mod\\Sketcher',
'E:\\freecad\\built_win4\\bin',
'e:\\freecad\\free-cad-code\\freecadlibs\\bin\\python26.zip',
'E:\\freecad\\built_win4\\bin\\DLLs',
'E:\\freecad\\built_win4\\bin\\lib',
'E:\\freecad\\built_win4\\bin\\lib\\plat-win',
'E:\\freecad\\built_win4\\bin\\lib\\lib-tk',
'E:\\freecad\\built_win4\\bin',
'C:/Users/tog/AppData/Roaming/FreeCAD']

Start in bin_all (this is am emrge of bin and freeecadlibs) - here freecad is runnign without errors

>>> import sys
>>> sys.path
['E:\\freecad\\built_win4\\Mod',
'E:\\freecad\\built_win4\\lib',
'E:\\freecad\\built_win4\\Mod\\Drawing',
'E:\\freecad\\built_win4\\Mod\\Inspection', 'E:\\freecad\\built_win4\\Mod\\Idf', 'E:\\freecad\\built_win4\\Mod\\Part',
'E:\\freecad\\built_win4\\Mod\\Robot', 'E:\\freecad\\built_win4\\Mod\\Arch', 'E:\\freecad\\built_win4\\Mod\\Mesh',
'E:\\freecad\\built_win4\\Mod\\Raytracing', 'E:\\freecad\\built_win4\\Mod\\Material', 'E:\\freecad\\built_win4\\Mod\\Web',
'E:\\freecad\\built_win4\\Mod\\Complete', 'E:\\freecad\\built_win4\\Mod\\Assembly', 'E:\\freecad\\built_win4\\Mod\\Import',
'E:\\freecad\\built_win4\\Mod\\Test', 'E:\\freecad\\built_win4\\Mod\\Draft', 'E:\\freecad\\built_win4\\Mod\\Points', 'E:\\freecad\\built_win4\\Mod\\Start', 'E:\\freecad\\built_win4\\Mod\\Spreadsheet', 'E:\\freecad\\built_win4\\Mod\\Fem', 'E:\\freecad\\built_win4\\Mod\\OpenSCAD', 'E:\\freecad\\built_win4\\Mod\\MeshPart', 'E:\\freecad\\built_win4\\Mod\\Plot', 'E:\\freecad\\built_win4\\Mod\\Ship', 'E:\\freecad\\built_win4\\Mod\\PartDesign', 'E:\\freecad\\built_win4\\Mod\\Image', 'E:\\freecad\\built_win4\\Mod\\ReverseEngineering',
'E:\\freecad\\built_win4\\Mod\\Sketcher',

'E:\\freecad\\built_win4\\bin_all',
'E:\\freecad\\built_win4\\bin_all\\python26.zip',
'E:\\freecad\\built_win4\\bin_all\\DLLs',
'E:\\freecad\\built_win4\\bin_all\\lib',
'E:\\freecad\\built_win4\\bin_all\\lib\\plat-win',
'E:\\freecad\\built_win4\\bin_all\\lib\\lib-tk',
'E:\\freecad\\built_win4\\bin_all',
'C:/Users/tog/AppData/Roaming/FreeCAD']
>>>


The environment

OS=Windows_NT
Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
m Files (x86)\Windows Live\Shared;C:\Program Files (x86)\CMake 2.8\bin;e:\freeca
d\free-cad-code\freecadlibs\bin;e:\freecad\free-cad-code;e:\freecad\built_win4\b
in;e:\freecad\built_win4

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

PYTHONPATH=e:\freecad\free-cad-code\freecadlibs\bin;e:XXX


the freecad environment

downloaded git :
e:\freecad\free-cad-code

compiled and build:
e:\freecad\built_win4

libpack 8.x:
e:\freecad\free-cad-code\freecadlibs

what is wrong?
wmayer
Site Admin
Posts: 15966
Joined: Thu Feb 19, 2009 10:32 am

Re: Compile on win 7

Postby wmayer » Mon Feb 10, 2014 3:41 pm

During initialization the error No module named sip occurred in E:\freecad\built_win4\Mod\Ship\InitGui.py
During initialization the error No module named _ctypes occurred in E:\freecad\built_win4\Mod\Plot\InitGui.py
Error: PySide not found, Draft workbench will be disabled.
Ok, sip.pyd and _ctypes.pyd can be copied to the bin sub-directory of the build directory. For the PySide stuff you have to fetch the latest changes from git. Your LibPack should have a PySide directory which you then could copy to the bin directory, too.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Compile on win 7

Postby microelly2 » Mon Feb 10, 2014 4:48 pm

Thank you Werner, now it works as expected

the (last) question in this thread - to deliver the binaries:
what I can delete from my built/what must be delivered?

bin, data, mod, lib and the libpack/bin ?

is freecad now a portable app runnable on a stick? or what I have to do to make it running anywhere?
wmayer
Site Admin
Posts: 15966
Joined: Thu Feb 19, 2009 10:32 am

Re: Compile on win 7

Postby wmayer » Mon Feb 10, 2014 6:10 pm

A good way to sort out files you don't need is by *installing* the built files. Therefore open cmake and load the cache directory of the FreeCAD build. Now check the variable CMAKE_INSTALL_PREFIX and set it to a directory where you have write access. Regenerate the VS project files and build the INSTALL target of the VS Solution Explorer (Select INSTALL and on the context menu go to Project Only > Build only INSTALL). Make sure to have selected "Release" as build type!

From the LibPack you have to copy now the DLLs of a release build. This is a bit tedious but you can e.g. use the tool dependency walker to see which files you need. When you are done start FreeCAD and load all workbenches. If this works you can be pretty sure that you have all relevant files.
Erwin
Posts: 3
Joined: Mon Jan 13, 2014 12:01 pm

Re: Compile on win 7

Postby Erwin » Sat Feb 15, 2014 9:21 pm

It seems I ran into the same issues, I was able to compile everything but the instructions on what files to copy exactly were outdated (I copied every file from the Libpack mentioned at http://www.freecadweb.org/wiki/index.ph ... eOnWindows ). After running there were still errors about missing files and I kept copy every file to program complained not being able to find, until it completely loaded without errors and then the errors came without mention what file it was missing and I copied ALL files, resulting in a very large FreeCAD folder and still things didn't work very well. (now I read this is because some file in the new Libpack were missing?)

Would anybody be able to completely update Windows build instructions as I would like to make myself a new version as there seems to be a lot of fixes and additions in the current code in comparison with the build from december 2013 (0.14.2370_x86_RC)?
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Compile on win 7

Postby microelly2 » Mon Feb 17, 2014 8:49 pm

wmayer wrote:
Revisionnumber and Erscheinungsdatum is not correctly displayed.
This happens because during the build we query git to return the hash values of all commits. Since it is not listed in your system path it cannot be started and thus leaves the revision and release date undefined.

To adjust the system path open the Control Panel > System > Advanced system settings > Environment variables and search for "Path" in the system variables list. Double-click on the item and add the bin paths of the LibPack and git. Use a semicolon as separator.
hallo wernder,

sorry but
I have still the problem that the releasenumber and erscheinungsdatum ist not correctly displayed

what do you mean with
and add the bin paths of the LibPack and git.
the libpath works, but what is the way to the git? I have downloaded the tarball to e:\freecad\free-cad-code, in this directory are cMake, data, src-dirs. I have set the PATH to e:\freecad\free-cad-code bu there is no success. What is wrong - what do I not understand correctly?
can you give me an example?
wmayer
Site Admin
Posts: 15966
Joined: Thu Feb 19, 2009 10:32 am

Re: Compile on win 7

Postby wmayer » Tue Feb 18, 2014 11:09 am

the libpath works, but what is the way to the git?
Open a command line window via Start>All Programs>Accessories (on German systems Start > Programme > Zubehör) and enter "git". If an error message appears that this program cannot be found it clearly means it is not listed in the PATH variable.
e:\freecad\free-cad-code, in this directory are cMake, data, src-dirs
In an Explorer window navigate to the directory where you can see the "git.exe". If I got you right this will be something like "e:\freecad\free-cad-code\git\bin" in your case. Add this to the system path as described earlier.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Compile on win 7

Postby microelly2 » Sat Feb 22, 2014 1:21 pm

After buildung the package on win I have lost the Ikons for the snapTools in the Draftmodul
(http://freecadweb.org/wiki/index.php?title=Draft_Snap)
I have found them in src/Mod/Draft/Ressources/Icons but they seem not to be included into the built.

In which directory I have to copy them?

All other icons sketcher, part, ... are well presented.
thanks thomas.



OS: Windows 7
Platform: 32-bit
Version: 0.14.3191 (Git)
Branch: master
Hash: e8cb83a48b18769c086b80cd92a5b2b859337081
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1
Attachments
Unbenannt.png
Unbenannt.png (198.33 KiB) Viewed 2599 times