Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: stahta01 on March 03, 2009, 10:16:53 pm

Title: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: stahta01 on March 03, 2009, 10:16:53 pm
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

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

Tim S
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: killerbot on March 03, 2009, 10:38:37 pm
It would be great if you would also provide a CodeBlocks (cbp) project file.
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: ollydbg on March 04, 2009, 05:31:16 am
I think the development document is the best place to put this wiki page.
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: stahta01 on March 04, 2009, 06:17:22 am
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
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: ollydbg on March 04, 2009, 06:32:45 am
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. :(
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: stahta01 on March 04, 2009, 07:06:31 am
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.
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: MortenMacFly on March 04, 2009, 09:21:38 am
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.
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: vri on March 04, 2009, 09:34:13 am
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 (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.
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: stahta01 on March 05, 2009, 05:38:59 am
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
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

Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: MortenMacFly on March 05, 2009, 08:59:58 am
Code
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...)
Title: Re: I am planning on Using C::B to compile KiCAD, which parts are OK to put on Wiki?
Post by: stahta01 on March 06, 2009, 11:37:10 pm
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
--== 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
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
    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
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")