Author Topic: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?  (Read 6910 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6712
    • My Best Post
I am planning on Using C::B to compile KiCAD, which parts are OK to put on C::B's Wiki?

KiCAD is an Electronic Design Automation (EDA) Tool.
http://kicad.sourceforge.net/wiki/index.php/Main_Page

The build system is CMake.
The widget toolkit is wxWidgets.
The normal compiler is GCC with Boost C++ Libraries

The main sub-topics include
  • How to compile the release and debug builds of wxWidgets Library using Unicode/Monolithic/Shared with openGL.
  • How to compile the release and debug builds of wxWidgets Library using Unicode/MultiLib/Static with openGL.
  • How to add Boost C++ Libraries to MinGW GCC Installation
  • How to use CMake to create an Code::Blocks Makefile project

Which is OK to put on the Code::Blocks Wiki?

Tim S
« Last Edit: March 03, 2009, 11:08:50 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5202
It would be great if you would also provide a CodeBlocks (cbp) project file.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5248
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I think the development document is the best place to put this wiki page.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6712
    • My Best Post
Working on finding info on the right way to build Boost C++ for Windows;

Links I am collecting with info.

http://shoddykid.blogspot.com/2008/07/getting-started-with-boost.html#bboost

Looks like the right way requires ICU to already be built.
International Components for Unicode (ICU) http://site.icu-project.org.

Tim S
« Last Edit: March 04, 2009, 07:04:07 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5248
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Working on finding info on the right way to build Boost C++ for Windows;

Links I am collecting with info.

http://shoddykid.blogspot.com/2008/07/getting-started-with-boost.html#bboost


This page doesn't cover Mingw compiler under windows. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6712
    • My Best Post
This page doesn't cover Mingw compiler under windows. :(

No where,that I can find, for the last two version, is MinGW GCC covered using Boost C++.

Tim S
PS: I am looking at several weeks of work on this.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
No where,that I can find, for the last two version, is MinGW GCC covered using Boost C++.
I am using boost with MinGW just fine (if that is the question). Meaning: I am compiling boost using MinGW and using boost libs in projects based on MinGW.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline vri

  • Multiple posting newcomer
  • *
  • Posts: 18
I have no problem using boost on windows with mingw either. Just follow the Boost Getting Started on Windows
http://www.boost.org/doc/libs/1_38_0/more/getting_started/windows.html, section 5.2: Build from source.

It uses bjam to build, but this works out of the box, also for mingw

Cheers, Theo.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6712
    • My Best Post
I am using boost with MinGW just fine (if that is the question). Meaning: I am compiling boost using MinGW and using boost libs in projects based on MinGW.

Here's the basic bjam command, I am trying out.

Code: [Select]
bjam threading=multi variant=release link=shared toolset=gcc --prefix="C:\Apps\MinGW_Boost" -without-mpi  install

I am doing both "variant=release" and "variant=debug"; I am also trying several other -without-LIBNAME to see which Libs are required for KiCAD.

Morten, any suggestions of other options to try, or avoid, with bjam?

Tim S

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Code: [Select]
bjam threading=multi variant=release link=shared toolset=gcc --prefix="C:\Apps\MinGW_Boost" -without-mpi  install
Morten, any suggestions of other options to try, or avoid, with bjam?
Besides -without-mpi this is pretty much what I am using for the build, too (there was a "stage" keyword, too somehow but I don't recall if that was important). Hence I don't know what KiCAD requires (I don't even know what KiCAD is btw...)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6712
    • My Best Post
See http://wiki.codeblocks.org/index.php?title=KiCadBuildQuickRef
A work in progress

I am starting testing the best way to Build KiCAD using Code::Blocks.
My Directions will be based on these links
http://manveru.pl/node/3
http://kicad.svn.sourceforge.net/viewvc/kicad/trunk/kicad/COMPILING.txt?view=markup
http://shoddykid.blogspot.com/2008/07/getting-started-with-boost.html#bboost
http://wiki.codeblocks.org/index.php?title=Using_Boost
http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef

Code: [Select]
--== How to build kicad using CMAKE generated CB Makefiles ==--
First Written: 05-Mar-2009
Last Revised: 06-Mar-2009

Kicad needs wxWidgets, the multi platform G.U.I.

Perform these steps in sequence.

Windows ONLY Directions; will try to add Linux Version in future

A. MinGW GCC Compiler steps
A-1)  install "mingw".
A-2)  Install zlib.
A-3)  Install Boost C++ Template Libraries (*.hpp files)

B. wxWidgets Steps
B-1)  Install wxWidgets.
B-2)  Build wxWidgets.

C. kicad build using CMake and Code::Blocks Steps
C-1)  Install the kicad source tree.
C-2)  Install CMAKE
C-3)  Install "Code::Blocks"
C-4)  Use cmake to build the kicad makefiles.
C-5)  Use Code::Blocks to build kicad.
Tim S

Patch Needed to KiCad SVN Source for Monolithic Build to work; updated patch should not break MultiLib
Code: [Select]
Index: kicad/CMakeLists.txt
Index: kicad/CMakeLists.txt
===================================================================
--- kicad/CMakeLists.txt (revision 1641)
+++ kicad/CMakeLists.txt (working copy)
@@ -118,6 +118,11 @@
 # application. You can figure out what libraries you need here;
 # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
 find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
+IF(wxWidgets_FOUND)
+#
+ELSE(wxWidgets_FOUND)
+    find_package(wxWidgets COMPONENTS mono gl QUIET)
+ENDIF(wxWidgets_FOUND)
 check_find_package_result(wxWidgets_FOUND "wxWidgets")
 
 

C-4)  Use cmake to build the kicad makefiles. (My Paths Shown Below; will change in real directions)
Code: [Select]
    CD C:\SourceCode\Projects\EDA\KiCad\kicad-svn\kicad
    mkdir build
    mkdir build\release
    mkdir build\debug
   
    CD build\release
    cmake -G "CodeBlocks - MinGW Makefiles" -DZLIB_INCLUDE_DIR=C:/Apps/MinGW_Boost/include -DCMAKE_BUILD_TYPE=Release -DBoost_INCLUDE_DIR=C:/Apps/MinGW_Boost/include/boost-1_38 -DwxWidgets_ROOT_DIR=C:/SourceCode/Projects/wxWidgets/wxWidgets-2.8.x-MonoLib -DwxWidgets_LIB_DIR=C:/SourceCode/Projects/wxWidgets/wxWidgets-2.8.x-MonoLib/lib/gcc_dll -DwxWidgets_CONFIGURATION=mswu -DSubversion_SVN_EXECUTABLE="C:/Program Files (x86)/CollabNet Subversion/svn.exe" ../..

New Patch for KiCad; waiting on feedback from KiCAd Devs whether MonoLib or MultiLib is proper build type.

Code: [Select]
Index: kicad/CMakeLists.txt
===================================================================
--- kicad/CMakeLists.txt (revision 1641)
+++ kicad/CMakeLists.txt (working copy)
@@ -18,6 +18,7 @@
 option(KICAD_CYRILLIC "enable/disable building unicode (default OFF)")
 option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
 option(KICAD_GOST "enable/disable building unicode (default OFF)")
+option(wxWIDGETS_USE_MULTILIBS "enable/disable building Multiple Library wxWidgets (default ON)" ON)
 
 # Comment this out if you don't want to build with Python support.
 # OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
@@ -117,7 +118,11 @@
 # Here you can define what libraries of wxWidgets you need for your
 # application. You can figure out what libraries you need here;
 # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
-find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
+if(wxWIDGETS_USE_MULTILIBS)
+    find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
+else(wxWIDGETS_USE_MULTILIBS)
+    find_package(wxWidgets COMPONENTS mono gl QUIET)
+endif(wxWIDGETS_USE_MULTILIBS)
 check_find_package_result(wxWidgets_FOUND "wxWidgets")
 
 
« Last Edit: March 08, 2009, 04:15:50 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org