[SOLVED] Trouble compiling KiCAD (v2014) on Mageia 3

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Trouble compiling KiCAD (v2014) on Mageia 3

Postby tleedavidson » Aug 3rd, '14, 19:03

The version of KiCAD (v2012) in the Mageia repository has at least one significant bug, and so I am trying to compile the latest version (v2014) using the Linux script linked to at: http://www.kicad-pcb.org/display/KICAD/Download

Based on the dependencies listed in that script for Debian/Ubunto and Fedora, I have guessed at the dependencies for Mageia and ensured installation of:
task-c++-devel
bzr
bzrtools
libbzip2_1
libbzip2-devel
cmake
cmake-qtgui
doxygen
libcairo-devel
libglew-devel
grep
libopenssl-devel
wxPython
libwxgtku2.8-devel

The compile/build process fails with:
Code: Select all
Linking CXX executable pcbnew
/usr/bin/ld: ../../boost_root/lib/libboost_thread.a(thread.o): undefined reference to symbol 'pthread_getspecific@@GLIBC_2.0'
/usr/bin/ld: note: 'pthread_getspecific@@GLIBC_2.0' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [pcbnew/pcbnew] Error 1
make[1]: *** [pcbnew/CMakeFiles/pcbnew.dir/all] Error 2
make: *** [all] Error 2

My systems glibc package is glibc-2.17-7.2.mga3.
/lib/libpthread.so.0 is a symbolic link to libpthread-2.17.so

Have I missed a dependency? Or do I perhaps need some updates? Or an OS upgrade?

Thank you for any guidance.

T. Lee
Last edited by tleedavidson on Aug 8th, '14, 05:03, edited 1 time in total.
Lee
tleedavidson
 
Posts: 54
Joined: Feb 14th, '12, 04:36

Re: Trouble compiling KiCAD (v2014) on Mageia 3

Postby doktor5000 » Aug 3rd, '14, 20:05

tleedavidson wrote:The compile/build process fails with:
Code: Select all
Linking CXX executable pcbnew
/usr/bin/ld: ../../boost_root/lib/libboost_thread.a(thread.o): undefined reference to symbol 'pthread_getspecific@@GLIBC_2.0'
/usr/bin/ld: note: 'pthread_getspecific@@GLIBC_2.0' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [pcbnew/pcbnew] Error 1
make[1]: *** [pcbnew/CMakeFiles/pcbnew.dir/all] Error 2
make: *** [all] Error 2


Have I missed a dependency? Or do I perhaps need some updates? Or an OS upgrade?


Nope, you haven't missed a dependency, it's only about the correct compiler/linker flags. As Mageia follows Fedora, Suse et al,
the default compiler/linker flags are pretty strict. Here the problem is probably in the Makefile of kicad.

In our SPEC for kicad (bzr version 4024 from May 2014) there's a workaround to fix the build. You need to run that after cmake:

Code: Select all
   #ugly workaround to fix build
   #dunno what causes the extra ; in CXX_FLAGS which causes the failure
   find . -name flags.make -exec sed -i -e 's,-pthread;-fpermissive,-pthread -fpermissive,g' {} \;
   find . -name link.txt -exec sed -i -e 's,-pthread;-fpermissive,-pthread -fpermissive,g' {} \;

You can see how kicad is built at line 395-408 in http://svnweb.mageia.org/packages/cauld ... iew=markup
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Trouble compiling KiCAD (v2014) on Mageia 3

Postby doktor5000 » Aug 3rd, '14, 20:11

Your best bet is probably to take the newest src.rpm from Cauldron, and rebuild it on your Mageia 3 box.
Latest src.rpm: ftp://ftp.nluug.nl/pub/os/Linux/distr/m ... a5.src.rpm
Guide how to rebuild it (basically three easy commands) -> viewtopic.php?f=4&t=5530
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Trouble compiling KiCAD (v2014) on Mageia 3

Postby tleedavidson » Aug 7th, '14, 14:34

You were right, doktor5000, my best bet was indeed to take the newest src.rpm from Cauldron, and rebuild it on my Mageia 3 box.

I had been informed that the particular bug I experienced didn't disappear until the 2014 version, so I tried "fixing" the install script I linked to by inserting the fix you posted in between `cmake` and `make`. But that didn't cure the linking issue.

I am surprised, and very pleased, at how easy it was to rebuild the Cauldron source RPM on my box following those three easy steps (actually only two, because I already had 'rpm-build' installed). And that bug does not exist in the Cauldron (2013) version. Yay :D

Thank you!


I wasn't able to compile the 2014 version, but I was able to compile a 'working' version. Would this topic be considered 'solved'? How should I mark it?

Many thanks,
T. Lee

P.S. Off-topic: I am impressed at how you seem to know just where to look for things. I was trying to see if I could do it too on svnweb.mageia.org for future use, and noticed three different directories in the "packages/cauldron/kicad" directory: "current", "pristine", and "releases". What is the difference between those? Why wouldn't I have looked in "releases" for the relevant SPEC?
Lee
tleedavidson
 
Posts: 54
Joined: Feb 14th, '12, 04:36

Re: Trouble compiling KiCAD (v2014) on Mageia 3

Postby doktor5000 » Aug 7th, '14, 20:41

tleedavidson wrote:P.S. Off-topic: I am impressed at how you seem to know just where to look for things. I was trying to see if I could do it too on svnweb.mageia.org for future use, and noticed three different directories in the "packages/cauldron/kicad" directory: "current", "pristine", and "releases". What is the difference between those? Why wouldn't I have looked in "releases" for the relevant SPEC?


Well I'm a packager for Mageia, so I should know where to look for things ...

current is the latest working copy. releases contains copies of all built versions, for each new package build that is submitted to the buildsystem, a new copy is created in there. pristine is a bit more difficult, you may want to look at http://svn.apache.org/repos/asf/subvers ... tine-store


Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Compiled KiCAD (v2014) on Mageia 4

Postby hankivy » Jun 24th, '15, 07:05

For reasons beyond the scope of this post, I decided to compile the latest STABLE version of kicad on my Mageia 4 system.
The Mageia 5 version of kicad is 2013-07-25, July 25, 2013. It is the bazaar version 4024 in the kicad master source base.
The latest STABLE version of kicad is 2014-08-05, August 8, 2014. It is the bazaar version 5054 in the kicad master source base.

I carefully considered the previous posts in this topic, and the instructions in http://www.kicad-pcb.org/display/DEV/Building+KiCad+on+Linux

My build had to be stopped after the cmake step, a few files needed to be tweaked, and the build continued with the make step.
This is similar to the fix used for the previous Mageia kicad build referenced earlier in this topic. But the files, and the tweaking I did were different.

The files I changed were:
Code: Select all
kicad_sources/kicad.bzr/build/cvpcb/CMakeFiles/cvpcb_kiface.dir/link.txt
kicad_sources/kicad.bzr/build/pcbnew/CMakeFiles/pcbnew_kiface.dir/link.txt

Both files only contain one line, a very long line. I just added
Code: Select all
 -lpthread
to the end of the line in each of the files. There is a space in front of the "-l".
hankivy
 
Posts: 128
Joined: May 19th, '14, 20:36

Re: [SOLVED] Trouble compiling KiCAD (v2014) on Mageia 3

Postby doktor5000 » Jun 24th, '15, 21:30

Thanks for sharing :)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Trouble compiling KiCAD (v2014) on Mageia 3

Postby DiBosco » Jun 25th, '15, 18:12

FWIW, you can simply download the misleadingly named Ubuntu versions from the kicad website. The .tar.gz file contains executables that are not actually specific to Ubuntu.

It works fine on Mageia. I used this a while back when Mageia was way behind the latest version. IIRC this also has all the components in it which is very useful. At the time I seem to remember the Mageia version didn't include the libraries. Since then I've always used the old version. I should probably try the latest one.
DiBosco
 
Posts: 331
Joined: Aug 31st, '11, 10:22

Compiled KiCAD (v2014) on Mageia 4

Postby hankivy » Jun 26th, '15, 00:29

It looks like I have the kicad application, the libraries, and the documentation.

There is a shell script, called the "easy way", in the instructions that I previously referenced.
hankivy wrote:and the instructions in http://www.kicad-pcb.org/display/DEV/Bu ... d+on+Linux
This script called version 5054, a STABLE version. The script downloads the source code for a build, the libraries, and the documentation. Ultimately, after using the script to download the source code, I pasted commands from the script to my command line to do it all.
hankivy
 
Posts: 128
Joined: May 19th, '14, 20:36


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest