Skip to content

Commit d8e0ac3

Browse files
authored
LibPack instruction refinements
1 parent 4fea83c commit d8e0ac3

File tree

1 file changed

+51
-13
lines changed

1 file changed

+51
-13
lines changed

technical/libpack.md

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,29 @@ layout: default
55
# Maintaining the FreeCAD LibPack for Windows
66

77
To create a new LibPack for Windows, begin by creating an empty directory. The suggested naming scheme
8-
is to name it "LibPack-XX-YY-ARCH" where XX is the release of FreeCAD the pack is intented to work with,
8+
is to name it "LibPack-XX-YY-ARCH" where XX is the release of FreeCAD the pack is intended to work with,
99
YY is a version number of the LibPack itself, and ARCH is the architecture the LibPack was build for
1010
(e.g. x86_64 or arm64). The rest of this document will refer to that directory as *LIBPACK*.
1111

1212
Note that in several places below you are instructed to load a developer's power shell: you may use
1313
whichever shell you'd like, but ensure that you are loading the shell configured with the x64 native
1414
compilation tools if you are compiling on an Intel processor. ARM compilation is untested.
1515

16+
In most of the instructions below, code is cloned directly from a first-party git repository. In most
17+
cases it is perfectly feasible to directly download a source release package instead of cloning the
18+
entire git repository.
19+
1620
For the most part, the libraries below are self-compiled in order to reduce dependency on third-party
1721
packagers. In some cases it is feasible to download precompiled binaries of the individual items. Major
1822
exceptions here are that both Python and Qt are used in their precompiled forms since the packages are
19-
provided for Windows by the first parties in each case.
23+
provided for Windows by the first parties in each case. libclang is provided by the Qt project as part
24+
of the dependencies of PySide6, but can be self-compiled if desired.
2025

2126
WORK IN PROGRESS!!
2227

23-
Perform the following in this order (the order does not *always* matter, but sometimes does):
28+
Install the following packages into the subdirectory you created for this LibPack. In general the order below should work, with
29+
dependencies being installed before the software which requires them. Note that not all packages use the same installation
30+
structure, so the final LibPack contains several different types of installation tree.
2431
* **[Python](https://python.org)** -- Install in a newly-created *LIBPACK\bin* subdirectory using the basic Python installer. Only install
2532
Python itself: the Idle IDE, debug symbols, etc. are not included in the LibPack.
2633
* **[Qt](https://qt.io)** -- The Open Source installer is found at https://www.qt.io/download-open-source
@@ -50,7 +57,7 @@ Perform the following in this order (the order does not *always* matter, but som
5057
- In some cases even with Qt6_DIR specified, Quarter will fail to find all necessary Qt library cmake files. In
5158
those cases you will need to manually set the path to the cmake files as *LIBPACK/lib/cmake/Qt6XXX*.
5259
- Do not build the examples, tests, or documentation
53-
- At this time this guide was written, Quarter did not correctly support Qt 6.4: the file QuarterWidgetP.cpp had to
60+
- At this time this guide was written, Quarter did not correctly support Qt 6.5: the file QuarterWidgetP.cpp had to
5461
be modified to add `#include <QOpenGLContext>` in the Qt includes section at the top of the file.
5562
- Build the ALL_BUILD and INSTALL targets in Release mode
5663
* **[SWIG](https://www.swig.org)** -- obtained from https://www.swig.org, prebuilt binaries are available for Windows
@@ -72,33 +79,34 @@ Perform the following in this order (the order does not *always* matter, but som
7279
* **[Pyside](https://pypi.org/project/PySide6)** -- now part of the Qt project, installed as a Python package with pip
7380
- E.g. `LIBPACK/bin/python.exe -m pip install pyside6==6.5.2`
7481
- Note that this will also install Shiboken, in the same location
75-
* **[VTK](https://vtk.org)** -- installed with pip
76-
- E.g. `LIBPACK/bin/python.exe -m pip install vtk==9.2.4`
77-
* **[HarfBuzz](https://harfbuzz.github.io)** -- Required by FreeType (and thus by OCCT)
82+
* **[VTK](https://vtk.org)** -- Download or clone the source
83+
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
84+
- Build the ALL_BUILD and INSTALL targets in Release mode
85+
* **[HarfBuzz](https://harfbuzz.github.io)**
7886
- Clone https://github.com/harfbuzz/harfbuzz
7987
- Switch to the latest release branch
8088
- Set PYTHON_EXECUTABLE to *LIBPACK/bin/python.exe*
8189
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
8290
- Build the ALL_BUILD and INSTALL targets in Release mode
83-
* **[ZLIB](http://zlib.net)** -- Required by FreeType (and thus by OCCT)
91+
* **[ZLIB](http://zlib.net)**
8492
- Download and unpack the latest source code
8593
- Set CMAKE_INSTALL_PREFIX to *LIBPACK* (note: must be done prior to running Configure if using the GUI)
8694
- Build the ALL_BUILD and INSTALL targets in Release mode
87-
* **[libpng](http://www.libpng.org)** -- Required by FreeType (and thus by OCCT)
95+
* **[libpng](http://www.libpng.org)**
8896
- Download the zipfile of the source code and extract it
8997
- Set ZLIB_INCLUDE_DIR to *LIBPACK/include*
9098
- Set ZLIB_LIBRARY_RELEASE to *LIBPACK/lib/zlib.lib*
9199
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
92100
- Build the ALL_BUILD and INSTALL targets in Release mode
93-
* **[bzip2](https://sourceware.org.bzip2)** -- Required by FreeType (and this by OCCT)
101+
* **[bzip2](https://sourceware.org.bzip2)**
94102
- Download the source from https://sourceware.org/bzip2/downloads.html
95103
- Extract it to a directory with no spaces or non-ASCII characters in it
96104
- Open a Developer's PowerShell
97105
- `cd X:\path\to\extracted\files`
98106
- `nmake -f .\makefile.msc`
99107
- Copy libbz2.lib into *LIBPACK\lib*
100108
- Copy all header files into *LIBPACK\include*
101-
* **[FreeType](https://freetype.org)** -- Required by OCCT
109+
* **[FreeType](https://freetype.org)**
102110
- Download the latest version from https://sourceforge.net/projects/freetype/files/freetype2/ (a Windows .zip file is available)
103111
- Extract the files and run cMake
104112
- Set HarfBuzz_INCLUDE_DIR to *LIBPACK/include*
@@ -127,12 +135,42 @@ Perform the following in this order (the order does not *always* matter, but som
127135
- Set 3RDPARTY_XXX_DIR to *LIBPACK*
128136
- Set 3RDPARTY_XXX_DLL_DIR to *LIBPACK/bin/*
129137
- Set 3RDPARTY_XXX_LIBRARY_DIR to *LIBPACK/lib/*
138+
- Set 3RDPARTY_XXX_INCLUDE_DIR to *LIBPACK/include/* (VTK has an additional path component for the version)
130139
- Set 3RDPARTY_XXX_LIBRARY to *LIBPACK/lib/xxxYYY.lib* (the name of the library varies, use whatever is present)
131140
- Set INSTALL_DIR to *LIBPACK*
132141
- Configure, Generate, and open the project in Visual Studio
133-
- Switch to Release and build the ALL_BUILD target
142+
- Switch to Release and build the ALL_BUILD and INSTALL targets
134143
* **[Netgen](https://ngsolve.org)**
135144
- Clone https://github.com/NGSolve/netgen
136145
- Switch to the tag you wish to compile (e.g. `git checkout v6.2.2304`)
137146
- Run cMake
138-
* **[GMSH](https://gmsh.info)**
147+
- Turn off "Superbuild"
148+
- Turn off "USE_GUI"
149+
- Set paths for ZLIB, TCL, and TK
150+
- Set all Python paths in Advanced cMake options (netgen ignores Python_ROOT_DIR)
151+
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
152+
- Switch to Release and build the ALL_BUILD and INSTALL targets
153+
* **[HDF5](https://github.com/HDFGroup/hdf5)**
154+
- Clone the repository from https://github.com/HDFGroup/hdf5
155+
- Check out the release tag you want to build (e.g. `hdf5-1_14_1-2`)
156+
- Deactivate building tests and examples
157+
- Set ZLIB_INCLUDE_DIR and ZLIB_LIBRARY_RELEASE
158+
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
159+
- Configure and Generate, then open in Visual Studio, switch to Release, and build ALL_BUILD and INSTALL
160+
* **[GMSH](https://gmsh.info)**
161+
- Download the desired version of the Gmsh source code
162+
- Set the path to FreeType
163+
- Set HDF5_DIR to *LIBPACK/cmake*
164+
- Set HDF5_LIBRARY_RELEASE to *LIBPACK/lib/hdf5.lib*
165+
- Set HDF5_DIFF_EXECUTABLE to *LIBPACK/bin/hdf5diff.exe*
166+
- Add a new variable called CMAKE_LIBRARY_PATH and set it to *LIBPACK/win64/vc14/lib* (adapt to your system as needed)
167+
- Disable OpenMP (as of this writing the compilation fails if it is enabled)
168+
- Set CMAKE_INSTALL_PREFIX to *LIBPACK*
169+
- Configure and Generate, then open in Visual Studio, switch to Release, and build ALL_BUILD and INSTALL
170+
* **[PyCXX](https://cxx.sourceforge.net)**
171+
- Download the latest source from Sourceforge
172+
- Run `LIBPACK/bin/python.exe setup.py install` from within the extracted directory
173+
* **[ICU](https://icu.unicode.org)** -- Advanced Unicode handling for Xerces-C
174+
- Clone from https://github.com/unicode-org/icu
175+
- Switch to the tag you want to build, e.g. `release-73-2`
176+
* **[Xerces-C](https://xerces.apache.org/xerces-c/)**

0 commit comments

Comments
 (0)