You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

631 lines
28 KiB

10 years ago
10 years ago
  1. # Building KiCad from Source #
  2. If you are a user and not a developer, please consider using one of the prebuilt packages
  3. of KiCad which can be found at the [download][] page on the [KiCad website][]. Building KiCad
  4. from source is not for the faint of heart and is not recommended unless you have reasonable
  5. software development experience. This document contains the instructions on how to build KiCad
  6. from source on the supported platforms. It is not intended as a guide for installing or building
  7. [library dependencies](#library_dependencies). Please consult your platforms documentation for
  8. installing packages or the source code when building the library dependencies. Currently the
  9. supported platforms are Windows Versions 7-10, just about any version of Linux, and macOS
  10. 10.9-10.13. You may be able to build KiCad on other platforms but it is not supported. On
  11. Windows and Linux the [GNU GCC][] is the only supported compiler and on macOS [Clang][] is the
  12. only supported compiler.
  13. [TOC]
  14. # Development Tools # {#development_tools}
  15. Before you begin building KiCad, there are a few tools required in addition to your compiler.
  16. Some of these tools are required to build from source and some are optional.
  17. ## CMake Build Configuration Tool ## {#cmake}
  18. [CMake][] is the build configuration and makefile generation tool used by KiCad. It is required.
  19. ## Git Version Control System ## {#git}
  20. The official source code repository is hosted on [GitLab][] and requires [git][] to get
  21. the latest source. If you prefer to use [GitHub][] there is a read only mirror of the official
  22. KiCad repository. The previous official hosting location at [Launchpad][] is still active as
  23. a mirror. Changes should be submitted as [merge requests][] via GitLab. The development team
  24. will not review changes submitted on GitHub or Launchpad as those platforms are mirrors only.
  25. ## Doxygen Code Documentation Generator ## {#doxygen_section}
  26. The KiCad source code is documented using [Doxygen][] which parses the KiCad source code files
  27. and builds a dependency tree along with the source documentation into HTML. Doxygen is only
  28. required if you are going to build the KiCad documentation.
  29. ## SWIG Simplified Wrapper and Interface Generator ## {#swig}
  30. [SWIG][] is used to generate the Python scripting language extensions for KiCad. SWIG is not
  31. required if you are not going to build the KiCad scripting extension.
  32. # Library Dependencies # {#library_dependencies}
  33. This section includes a list of library dependencies required to build KiCad. It does not
  34. include any dependencies of the libraries. Please consult the library's documentation for any
  35. additional dependencies. Some of these libraries are optional depending on you build
  36. configuration. This is not a guide on how to install the library dependencies using you systems
  37. package management tools or how to build the library from source. Consult the appropriate
  38. documentation to perform these tasks.
  39. ## wxWidgets Cross Platform GUI Library## {#wxwidgets}
  40. [wxWidgets][] is the graphical user interface (GUI) library used by KiCad. The current minimum
  41. version is 3.0.0. However, 3.0.2 should be used whenever possible as there are some known bugs
  42. in prior versions that can cause problems on some platforms. Please note that there are also
  43. some platform specific patches that must be applied before building wxWidgets from source. These
  44. patches can be found in the [patches folder][] in the KiCad source. These patches are named by
  45. the wxWidgets version and platform name they should be applied against. wxWidgets must be built
  46. with the --with-opengl option. If you installed the packaged version of wxWidgets on your system,
  47. verify that it was built with this option.
  48. ## Boost C++ Libraries ## {#boost}
  49. The [Boost][] C++ library is required only if you intend to build KiCad with the system installed
  50. version of Boost instead of the default internally built version. If you use the system installed
  51. version of Boost, version 1.56 or greater is required. Please note there are some platform
  52. specific patches required to build a working Boost library. These patches can be found in the
  53. [patches folder][] in the KiCad source. These patches are named by the platform name they should
  54. be applied against.
  55. ## GLEW OpenGL Extension Wrangler Library ## {#glew}
  56. The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the KiCad graphics
  57. abstraction library [GAL] and is always required to build KiCad.
  58. ## ZLib Library ## {#zlib}
  59. The [ZLib][] development library is used by KiCad to handle compressed 3d models (.stpz and .wrz files)
  60. and is always required to build KiCad.
  61. ## GLM OpenGL Mathematics Library ## {#glm}
  62. The [OpenGL Mathematics Library][GLM] is an OpenGL helper library used by the KiCad graphics
  63. abstraction library [GAL] and is always required to build KiCad.
  64. ## GLUT OpenGL Utility Toolkit Library ## {#glut}
  65. The [OpenGL Utility Toolkit][GLUT] is an OpenGL helper library used by the KiCad graphics
  66. abstraction library [GAL] and is always required to build KiCad.
  67. ## Cairo 2D Graphics Library ## {#cairo}
  68. The [Cairo][] 2D graphics library is used as a fallback rendering canvas when OpenGL is not
  69. available and is always required to build KiCad.
  70. ## Python Programming Language ## {#python}
  71. The [Python][] programming language is used to provide scripting support to KiCad. It needs
  72. to be installed unless the [KiCad scripting](#kicad_scripting) build configuration option is
  73. disabled.
  74. ## wxPython Library ## {#wxpython}
  75. The [wxPython][] library is used to provide a scripting console for Pcbnew. It needs to be
  76. installed unless the [wxPython scripting](#wxpython_scripting) build configuration option is
  77. disabled. When building KiCad with wxPython support, make sure the version of the wxWidgets
  78. library and the version of wxPython installed on your system are the same. Mismatched versions
  79. have been known to cause runtime issues.
  80. ## Curl Multi-Protocol File Transfer Library ## {#curl}
  81. The [Curl Multi-Protocol File Transfer Library][libcurl] is used to provide secure internet
  82. file transfer access for the [GitHub][] plug in. This library needs to be installed unless
  83. the GitHub plug build option is disabled.
  84. ## OpenCascade Library ## {#oce}
  85. The [OpenCascade Community Edition (OCE)][liboce] is used to provide support for loading and saving
  86. 3D model file formats such as STEP. This library needs to be installed unless the OCE build
  87. option is disabled.
  88. [Open CASCSADE Technology (OCC)][libocc] should also work as an alternative to OCE. Selection of
  89. library Cascade library can be specified at build time. See the [STEP/IGES support](#oce_opt)
  90. section.
  91. ## Ngspice Library ## {#ngspice}
  92. The [Ngspice Library][libngspice] is used to provide Spice simulation support in the schematic
  93. editor. Make sure the the version of ngspice library used was built with the--with-ngshared
  94. option. This library needs to be installed unless the Spice build option is disabled.
  95. # KiCad Build Configuration Options # {#build_opts}
  96. KiCad has many build options that can be configured to build different options depending on
  97. the availability of support for each option on a given platform. This section documents
  98. these options and their default values.
  99. ## Scripting Support ## {#scripting_opt}
  100. The KICAD_SCRIPTING option is used to enable building the Python scripting support into Pcbnew.
  101. This options is enabled by default, and will disable all other KICAD_SCRIPTING_* options when
  102. it is disabled.
  103. ## Python 3 Scripting Support ## {#python3}
  104. The KICAD_SCRIPTING_PYTHON3 option is used to enable using Python 3 for the scripting support
  105. instead of Python 2. This option is disabled by default and only is relevant if
  106. [KICAD_SCRIPTING](#scripting_opt) is enabled.
  107. ## Scripting Module Support ## {#scripting_mod_opt}
  108. The KICAD_SCRIPTING_MODULES option is used to enable building and installing the Python modules
  109. supplied by KiCad. This option is enabled by default, but will be disabled if
  110. [KICAD_SCRIPTING](#scripting_opt) is disabled.
  111. ## wxPython Scripting Support ## {#wxpython_opt}
  112. The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
  113. Pcbnew including the wxPython console. This option is enabled by default, but will be disabled if
  114. [KICAD_SCRIPTING](#scripting_opt) is disabled.
  115. ## wxPython Phoenix Scripting Support ## {#wxpython_phoenix}
  116. The KICAD_SCRIPTING_WXPYTHON_PHOENIX option is used to enable building the wxPython interface with
  117. the new Phoenix binding instead of the legacy one. This option is disabled by default, and
  118. enabling it requires [KICAD_SCRIPTING](#scripting_opt) to be enabled.
  119. ## Python Scripting Action Menu Support ## {#python_action_menu_opt}
  120. The KICAD_SCRIPTING_ACTION_MENU option allows Python scripts to be added directly to the Pcbnew
  121. menu. This option is enabled by default, but will be disabled if
  122. [KICAD_SCRIPTING](#scripting_opt) is disabled. Please note that this option is highly
  123. experimental and can cause Pcbnew to crash if Python scripts create an invalid object state
  124. within Pcbnew.
  125. ## GitHub Plugin ## {#github_opt}
  126. The BUILD_GITHUB_PLUGIN option is used to control if the GitHub plug in is built. This option is
  127. enabled by default.
  128. ## Integrated Spice simulator ## {#spice_opt}
  129. The KICAD_SPICE option is used to control if the Spice simulator interface for Eeschema is
  130. built. When this option is enabled, it requires [ngspice][] to be available as a shared
  131. library. This option is enabled by default.
  132. ## STEP/IGES support for the 3D viewer ## {#oce_opt}
  133. The KICAD_USE_OCE is used for the 3D viewer plugin to support STEP and IGES 3D models. Build tools
  134. and plugins related to OpenCascade Community Edition (OCE) are enabled with this option. When
  135. enabled it requires [liboce][] to be available, and the location of the installed OCE library to be
  136. passed via the OCE_DIR flag. This option is enabled by default.
  137. Alternatively KICAD_USE_OCC can be used instead of OCE. Both options are not supposed to be enabled
  138. at the same time.
  139. ## Development Analysis Tools ## {#dev_tools}
  140. KiCad can be compiled with support for several features to aid in the catching and debugging of
  141. runtime memory issues
  142. ### Valgrind support
  143. The KICAD_USE_VALGRIND option is used to enable Valgrind's stack annotation feature in the tool framework.
  144. This provides the ability for Valgrind to trace memory allocations and accesses in the tool framework
  145. and reduce the number of false positives reported. This option is disabled by default.
  146. ### C++ standard library debugging
  147. KiCad provides two options to enable debugging assertions contained in the GCC C++ standard library:
  148. KICAD_STDLIB_DEBUG and KICAD_STDLIB_LIGHT_DEBUG. Both these options are disabled by default, and only
  149. one should be turned on at a time with KICAD_STDLIB_DEBUG taking precedence.
  150. The KICAD_STDLIB_LIGHT_DEBUG option enables the light-weight standard library assertions by passing
  151. `_GLIBCXX_ASSERTIONS ` into CXXFLAGS. This enables things such as bounds checking on strings, arrays
  152. and vectors, as well as null pointer checks for smart pointers.
  153. The KICAD_STDLIB_DEBUG option enables the full set of standard library assertions by passing
  154. `_GLIBCXX_DEBUG` into CXXFLAGS. This enables full debugging support for the standard library.
  155. ### Address Sanitizer support
  156. The KICAD_SANITIZE option enables Address Sanitizer support to trace memory allocations and
  157. accesses to identify problems. This option is disabled by default. The Address Sanitizer
  158. contains several runtime options to tailor its behavior that are described in more detail in its
  159. [documentation](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags).
  160. This option is not supported on all build systems, and is known to have problems when using
  161. mingw.
  162. ## Demos and Examples ## {#demo_install_opt}
  163. The KiCad source code includes some demos and examples to showcase the program. You can choose
  164. whether install them or not with the KICAD_INSTALL_DEMOS option. You can also select where to
  165. install them with the KICAD_DEMOS variable. On Linux the demos are installed in
  166. $PREFIX/share/kicad/demos by default.
  167. ## Quality assurance (QA) unit tests ## {#quality_assurance_tests_opt}
  168. The KICAD_BUILD_QA_TESTS option allows building unit tests binaries for quality assurance as part
  169. of the default build. This option is enabled by default.
  170. If this option is disabled, the QA binaries can still be built by manually specifying the target.
  171. For example, with `make`:
  172. * Build all QA binaries: `make qa_all`
  173. * Build a specific test: `make qa_pcbnew`
  174. * Build all unit tests: `make qa_all_tests`
  175. * Build all test tool binaries: `make qa_all_tools`
  176. For more information about testing KiCad, see [this page](testing.md).
  177. ## KiCad Build Version ## {#build_version_opt}
  178. The KiCad version string is defined by the output of `git describe --dirty` when git is available
  179. or the version string defined in CMakeModules/KiCadVersion.cmake with the value of
  180. KICAD_VERSION_EXTRA appended to the former. If the KICAD_VERSION_EXTRA variable is not defined,
  181. it is not appended to the version string. If the KICAD_VERSION_EXTRA variable is defined it
  182. is appended along with a leading '-' to the full version string as follows:
  183. (KICAD_VERSION[-KICAD_VERSION_EXTRA])
  184. The build script automatically creates the version string information from the [git][] repository
  185. information as follows:
  186. (5.0.0-rc2-dev-100-g5a33f0960)
  187. |
  188. output of `git describe --dirty` if git is available.
  189. ## KiCad Config Directory ## {#config_dir_opt}
  190. The default KiCad configuration directory is `kicad`. On Linux this is located at
  191. `~/.config/kicad`, on MSW, this is `C:\Documents and Settings\username\Application Data\kicad` and
  192. on MacOS, this is `~/Library/Preferences/kicad`. If the installation package would like to, it may
  193. specify an alternate configuration name instead of `kicad`. This may be useful for versioning
  194. the configuration parameters and allowing the use of, e.g. `kicad5` and `kicad6` concurrently without
  195. losing configuration data.
  196. This is set by specifying the KICAD_CONFIG_DIR string at compile time.
  197. # Getting the KiCad Source Code ## {#getting_src}
  198. There are several ways to get the KiCad source. If you want to build the stable version you
  199. can down load the source archive from the [GitLab][] repository. Use tar or some
  200. other archive program to extract the source on your system. If you are using tar, use the
  201. following command:
  202. tar -xaf kicad_src_archive.tar.xz
  203. If you are contributing directly to the KiCad project on GitLab, you can create a local
  204. copy on your machine by using the following command:
  205. git clone https://gitlab.com/kicad/code/kicad.git
  206. Here is a list of source links:
  207. Stable release archives: https://kicad-pcb.org/download/source/
  208. Development branch: https://gitlab.com/kicad/code/kicad/tree/master
  209. GitHub mirror: https://github.com/KiCad/kicad-source-mirror
  210. # Building KiCad on Linux # {#build_linux}
  211. To perform a full build on Linux, run the following commands:
  212. cd <your kicad source mirror>
  213. mkdir -p build/release
  214. mkdir build/debug # Optional for debug build.
  215. cd build/release
  216. cmake -DCMAKE_BUILD_TYPE=Release \
  217. ../../
  218. make
  219. sudo make install
  220. If the CMake configuration fails, determine the missing dependencies and install them on your
  221. system. By default, CMake sets the install path on Linux to /usr/local. Use the
  222. CMAKE_INSTALL_PREFIX option to specify a different install path.
  223. # Building KiCad on Windows # {#build_windows}
  224. The preferred Windows build environment is currently [MSYS2][].
  225. [Visual Studio][] with [vcpkg][] is also a supported build environment
  226. but does not yet fully support all KiCad features.
  227. ## Building using MSYS2 ## {#msys2_build}
  228. ### Setup
  229. The [MSYS2][] project
  230. provides packages for all of the require dependencies to build KiCad. To setup the [MSYS2][]
  231. build environment, depending on your system download and run either the [MSYS2 32-bit Installer][]
  232. or the [MSYS2 64-bit Installer][]. After the installer is finished, update to the latest
  233. package versions by running the `msys2_shell.cmd` file located in the MSYS2 install path and
  234. running the command `pacman -Syu`. If the msys2-runtime package is updated, close the shell
  235. and run `msys2_shell.cmd`.
  236. ### Building
  237. The following commands assume you are building for 64-bit Windows, and that you already have
  238. the KiCad source code in a folder called `kicad-source` in your home directory. See below
  239. for changes if you need to build for 32-bit instead. Run `mingw64.exe` from the MSYS2
  240. install path. At the command prompt run the the following commands:
  241. pacman -S base-devel \
  242. git \
  243. mingw-w64-x86_64-cmake \
  244. mingw-w64-x86_64-doxygen \
  245. mingw-w64-x86_64-gcc \
  246. mingw-w64-x86_64-python2 \
  247. mingw-w64-x86_64-pkg-config \
  248. mingw-w64-x86_64-swig \
  249. mingw-w64-x86_64-boost \
  250. mingw-w64-x86_64-cairo \
  251. mingw-w64-x86_64-glew \
  252. mingw-w64-x86_64-curl \
  253. mingw-w64-x86_64-wxPython \
  254. mingw-w64-x86_64-wxWidgets \
  255. mingw-w64-x86_64-toolchain \
  256. mingw-w64-x86_64-glm \
  257. mingw-w64-x86_64-oce \
  258. mingw-w64-x86_64-ngspice \
  259. mingw-w64-x86_64-zlib
  260. cd kicad-source
  261. mkdir -p build/release
  262. mkdir build/debug # Optional for debug build.
  263. cd build/release
  264. cmake -DCMAKE_BUILD_TYPE=Release \
  265. -G "MSYS Makefiles" \
  266. -DCMAKE_PREFIX_PATH=/mingw64 \
  267. -DCMAKE_INSTALL_PREFIX=/mingw64 \
  268. -DDEFAULT_INSTALL_PATH=/mingw64 \
  269. ../../
  270. make -j N install # Where N is the number of concurrent threads that your system can handle
  271. For 32-bit builds, run `mingw32.exe` and change `x86_64` to `i686` in the package names and
  272. change the paths in the cmake configuration from `/mingw64` to `/mingw32`.
  273. For debug builds, run the cmake command with `-DCMAKE_BUILD_TYPE=Debug` from the `build/debug` folder.
  274. ### Known MSYS2 Build Issues ## {#known_issues_msys2}
  275. There are some known issues that are specific to MSYS2. This section provides a list of the
  276. currently known issues when building KiCad using MSYS2.
  277. #### 64-bit Package of Boost 1.59 ### {#ki_msys2_64bit_boost}
  278. The context library of the x86_64 package of Boost version 1.59 is broken and will cause KiCad
  279. to crash. You must downgrade to version 1.57 by running the command:
  280. pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-boost-1.57.0-4-any.pkg.tar.xz
  281. If the file mingw-w64-x86_64-boost-1.57.0-4-any.pkg.tar.xz is no longer in your pacman cache,
  282. you will have to download it from the [MSYS2 64-bit SourceForge repo][]. You should also
  283. configure pacman to prevent upgrading the 64-bit Boost package by adding:
  284. IgnorePkg = mingw-w64-x86_64-boost
  285. to your /etc/pacman.conf file.
  286. #### Building with Boost 1.70 ### {#ki_msys2_boost_1_70}
  287. There is an issue building KiCad with Boost version 1.70 due to CMake not defining the proper
  288. link libraries during configuration. Boost 1.70 can be used but `-DBoost_NO_BOOST_CMAKE=ON`
  289. needs to be added during CMake configuration to insure the link libraries are properly generated.
  290. #### Building OCE from source
  291. KiCad requires OCE by default, and the version installed by `pacman` can cause build errors in
  292. x86_64 systems as of March 2018. In order to work around this, you can build OCE from source on
  293. these systems. Building OCE on Windows requires that you place the source code in a very short
  294. directory path, otherwise you will run into errors caused by the maximum path length on Windows.
  295. In the example below, the `MINGW-packages` repository is cloned to `/c/mwp`, which is equivalent to
  296. `C:\mwp` in Windows path terminology. You may wish to change the destination of the `git clone`
  297. command if you do not want to place it on the root of your C drive, but if you run in to strange
  298. compilation errors about missing files, it is probably because your path is too long.
  299. git clone https://github.com/Alexpux/MINGW-packages /c/mwp
  300. cd /c/mwp/mingw-w64-oce
  301. makepkg-mingw -is
  302. ## Building using Visual Studio (2019) ## {#vs_build}
  303. ### Environment Setup ## {#env_setup_vs}
  304. #### Visual Studio
  305. You must first install [Visual Studio][] with the **Desktop development with C++** feature set installed.
  306. #### vcpkg
  307. **If you are new to vcpkg** you must, pick a spot on your system to put it.
  308. Then run these three commands
  309. ```
  310. git clone https://github.com/microsoft/vcpkg
  311. .\vcpkg\bootstrap-vcpkg.bat
  312. .\vcpkg\vcpkg integrate install
  313. ```
  314. which will give you a vcpkg install ready to use with the next steps
  315. ### KiCad Specific Setup ## {#vs_setup_steps}
  316. vcpkg defaults to x86-windows even on 64-bit machines,
  317. it is advised for ease of use you set a **USER** or **SYSTEM** environment variable
  318. with the name **VCPKG_DEFAULT_TRIPLET** and value **x64-windows**
  319. KiCad still supports 32-bit builds for now but may not in the future, thus 64-bit is preferred.
  320. #### 1. Install vcpkg packages
  321. The following packages are required for vcpkg
  322. ```
  323. .\vcpkg install boost
  324. .\vcpkg install cairo
  325. .\vcpkg install curl
  326. .\vcpkg install glew
  327. .\vcpkg install gettext
  328. .\vcpkg install glm
  329. .\vcpkg install icu
  330. .\vcpkg install ngspice
  331. .\vcpkg install opencascade
  332. .\vcpkg install opengl
  333. .\vcpkg install openssl
  334. .\vcpkg install python3
  335. .\vcpkg install wxwidgets
  336. .\vcpkg install zlib
  337. ```
  338. If you did not set the **VCPKG_DEFAULT_TRIPLET** environment variable, you will have to append
  339. :x64-windows to end of each packages name, `boost:x64-windows` for example.
  340. #### 2. CMakeSettings.json
  341. Contained in the build root is a `CMakeSettings.json.sample`, copy and rename this file to `CMakeSettings.json`
  342. Edit `CMakeSettings.json` update the VcPkgDir environment variable up top to match the location of your vcpkg clone.
  343. ```
  344. { "VcPkgDir": "D:/vcpkg/" },
  345. ```
  346. #### 3. "Open Folder" in Visual Studio
  347. Launch Visual Studio (only after completing the above steps).
  348. When the initial wizard launches, select to **Open a local folder**
  349. This is the correct way to make Visual Studio directly handle *CMake* projects.
  350. # Building KiCad on macOS # {#build_osx}
  351. As of V5, building and packaging for macOS can be done using [kicad-mac-builder][],
  352. which downloads, patches, builds, and packages for macOS. It is used to create the official
  353. releases and nightlies, and it reduces the complexity of setting up a build environment to a command
  354. or two. Usage of kicad-mac-builder is detailed at on its website.
  355. If you wish to build without kicad-mac-builder, please use the following and its source code
  356. as reference. Building on macOS requires building dependency libraries that require patching
  357. in order to work correctly.
  358. In the following set of commands, replace the macOS version number (i.e. 10.11) with the desired
  359. minimum version. It may be easiest to build for the same version you are running.
  360. KiCad currently won't work with a stock version of wxWidgets that can be downloaded or
  361. installed by package managers like MacPorts or Homebrew. To avoid having to deal with
  362. patches a [KiCad fork of wxWidgets][] is being maintained on GitHub. All the needed patches
  363. and some other fixes/improvements are contained in the `kicad/macos-wx-3.0` branch.
  364. To perform a wxWidgets build, execute the following commands:
  365. cd <your wxWidgets build folder>
  366. git clone -b kicad/macos-wx-3.0 https://gitlab.com/kicad/code/wxWidgets.git
  367. mkdir wx-build
  368. cd wx-build
  369. ../wxWidgets/configure \
  370. --prefix=`pwd`/../wx-bin \
  371. --with-opengl \
  372. --enable-aui \
  373. --enable-html \
  374. --enable-stl \
  375. --enable-richtext \
  376. --with-libjpeg=builtin \
  377. --with-libpng=builtin \
  378. --with-regex=builtin \
  379. --with-libtiff=builtin \
  380. --with-zlib=builtin \
  381. --with-expat=builtin \
  382. --without-liblzma \
  383. --with-macosx-version-min=10.11 \
  384. --enable-universal-binary=i386,x86_64 \
  385. CC=clang \
  386. CXX=clang++
  387. make
  388. make install
  389. If everything works you will find the wxWidgets binaries in `<your wxWidgets build folder>/wx-bin`.
  390. Now, build a basic KiCad without Python scripting using the following commands:
  391. cd <your kicad source mirror>
  392. mkdir -p build/release
  393. mkdir build/debug # Optional for debug build.
  394. cd build/release
  395. cmake -DCMAKE_C_COMPILER=clang \
  396. -DCMAKE_CXX_COMPILER=clang++ \
  397. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
  398. -DwxWidgets_CONFIG_EXECUTABLE=<your wxWidgets build folder>/wx-bin/bin/wx-config \
  399. -DKICAD_SCRIPTING=OFF \
  400. -DKICAD_SCRIPTING_MODULES=OFF \
  401. -DKICAD_SCRIPTING_WXPYTHON=OFF \
  402. -DCMAKE_INSTALL_PREFIX=../bin \
  403. -DCMAKE_BUILD_TYPE=Release \
  404. ../../
  405. make
  406. make install
  407. If the CMake configuration fails, determine the missing dependencies and install them on your
  408. system or disable the corresponding KiCad feature. If everything works you will get self-contained
  409. application bundles in the `build/bin` folder.
  410. Building KiCad with Python scripting is more complex and won't be covered in detail here.
  411. You will have to build wxPython against the wxWidgets source of the KiCad fork - a stock wxWidgets
  412. that might be bundled with the wxPython package won't work. Please see wxPython documentation
  413. or [macOS bundle build scripts][] (`compile_wx.sh`) on how to do this. Then, use a CMake
  414. configuration as follows to point it to your own wxWidgets/wxPython:
  415. cmake -DCMAKE_C_COMPILER=clang \
  416. -DCMAKE_CXX_COMPILER=clang++ \
  417. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
  418. -DwxWidgets_CONFIG_EXECUTABLE=<your wxWidgets build folder>/wx-bin/bin/wx-config \
  419. -DPYTHON_EXECUTABLE=<path-to-python-exe>/python \
  420. -DPYTHON_SITE_PACKAGE_PATH=<your wxWidgets build folder>/wx-bin/lib/python2.7/site-packages \
  421. -DCMAKE_INSTALL_PREFIX=../bin \
  422. -DCMAKE_BUILD_TYPE=Release \
  423. ../../
  424. # Known Issues # {#known_issues}
  425. There are some known issues that effect all platforms. This section provides a list of the
  426. currently known issues when building KiCad on any platform.
  427. ## Boost C++ Library Issues ## {#boost_issue}
  428. As of version 5 of [GNU GCC][], using the default configuration of downloading, patching, and
  429. building of Boost 1.54 will cause the KiCad build to fail. Therefore a newer version of Boost
  430. must be used to build KiCad. If your system has Boost 1.56 or greater installed, you job is
  431. straight forward. If your system does not have Boost 1.56 or greater installed, you will have
  432. to download and [build Boost][] from source. If you are building Boost on windows using [MinGW][]
  433. you will have to apply the Boost patches in the KiCad source [patches folder][].
  434. [download]: http://kicad-pcb.org/download/
  435. [KiCad website]: http://kicad-pcb.org/
  436. [GNU GCC]: https://gcc.gnu.org/
  437. [Clang]: http://clang.llvm.org/
  438. [CMake]: https://cmake.org/
  439. [Launchpad]: https://code.launchpad.net/kicad/
  440. [GIT]: https://git-scm.com/
  441. [GitHub]: https://github.com/KiCad/kicad-source-mirror
  442. [GitLab]: https://gitlab.com/kicad/code/kicad
  443. [ngspice]: http://ngspice.sourceforge.net/
  444. [Doxygen]: http://www.doxygen.nl
  445. [mailing list]: https://launchpad.net/~kicad-developers
  446. [SWIG]: http://www.swig.org/
  447. [wxWidgets]: http://wxwidgets.org/
  448. [patches folder]: http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
  449. [Boost]: http://www.boost.org/
  450. [GLEW]: http://glew.sourceforge.net/
  451. [GLUT]: https://www.opengl.org/resources/libraries/glut/
  452. [Cairo]: http://cairographics.org/
  453. [Python]: https://www.python.org/
  454. [wxPython]: http://wxpython.org/
  455. [merge requests]: https://gitlab.com/kicad/code/kicad/merge_requests
  456. [MSYS2]: http://www.msys2.org/
  457. [MSYS2 32-bit Installer]: http://repo.msys2.org/distrib/i686/msys2-i686-20161025.exe
  458. [MSYS2 64-bit Installer]: http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe
  459. [PKGBUILD]: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-kicad-git/PKGBUILD
  460. [kicad-mac-builder]:https://github.com/KiCad/kicad-mac-builder
  461. [KiCad fork of wxWidgets]:https://github.com/KiCad/wxWidgets
  462. [MinGW]: http://mingw.org/
  463. [build Boost]: http://www.boost.org/doc/libs/1_59_0/more/getting_started/index.html
  464. [MSYS2 64-bit SourceForge repo]: http://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/
  465. [libcurl]: http://curl.haxx.se/libcurl/
  466. [GLM]: http://glm.g-truc.net/
  467. [git]: https://git-scm.com/
  468. [liboce]: https://github.com/tpaviot/oce
  469. [libocc]: https://www.opencascade.com/content/overview
  470. [libngspice]: https://sourceforge.net/projects/ngspice/
  471. [ZLib]: http://www.zlib.net/
  472. [vcpkg]: https://github.com/microsoft/vcpkg
  473. [Visual Studio]: https://visualstudio.microsoft.com/vs/