The general idea with GNU Build system is to 

  • ./configure
  • make 
  • make install

However if there are problems it is not quite so simple.   The following notes are how I resolved the issues that arose. 

 

My QUCS Build Notes

These notes assume you already have the QUCS source code sitting in a folder somewhere.  This instructions are for Ubuntu / Debian Linux which I use for my investigations.

Tools required by QUCS build:  Much of this available as GNU Build Essentials – Using Synaptic – much easier!  I installed these components:

  • Autoconf version 2.57 (at least) – Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages.   
  • GNU automake 1.7.0 (at least) – Automake is a tool for automatically generating `Makefile.in' files compliant with the GNU Coding Standards. Automake requires the use of Autoconf.  sudo apt-get install build-essential
  • flex 2.5.31 (but at least 2.5.9) – (The Fast Lexical Analyzer) – fast lexical analyser generator. It is a tool for generating programs that perform pattern-matching on text. Flex is a free (but non-GNU) implementation of the original Unix lex program. To download the software, get the documentation, and more, please see the Flex home page – sudo apt-get install flex
  • GNU Bison 1.875d  – this is a parser generator – sudo apt-get install bison
  • Qt installation >= version 3.1 (by Trolltech)
  • GNU M4 (any version) – I think was installed with build-essentials or gcc
  • GNU gperf 3.0.1  – sudo apt-get install gperf
  • adms 2.2.4 (at least) – Verilog-AMS (Analog and Mixed Signals) is a language designed to describe and simulate analog and mixed signal designs using both the top-level design methodology as well as the more traditional bottom up approach. SourceForge Download

Step: Add to .profile file to get Qt3 to build

    In .profile (if your shell is bash, ksh, zsh or sh), add the following lines:  

QTDIR=/usr/local/qt PATH=QTDIR/bin:PATH MANPATH=QTDIR/doc/man:MANPATH LD_LIBRARY_PATH=QTDIR/lib:LD_LIBRARY_PATH export QTDIR PATH MANPATH LD_LIBRARY_PATH

 

Problem:  Dependency being left out of header file 

There was a bug in the Qt 3.3.8 code.  qvaluelist.h:91:13: error: ‘ptrdiff_t’ does not name a type

Fix is below:

qt-x11-free-3.3.8b make fails with ".obj/release-shared/qapplication_x11.o
Error 1 {...} ptrdiff_t does not name a type"

The fix is at qt-x11-free-3.3.8/include/qvaluelist.h

#ifndef QT_NO_STL
#include <iterator>
#include <list>
#endif

becomes

#ifndef QT_NO_STL
#include <iterator>
#include <list>
#include <cstddef>
#endif

 

Problem: After building the Qt library the ./Configure choked at the point it was supposed to find the library.   This must have been because of it being the non threading library because of this:
Though the QTDIR environment variable is setup correctly, it may happen that the configure script cannot find the Qt® libraries because it is initially looking for the threaded libraries (the libqt-mt.so link). If you have installed the non-threaded library (the libqt.so link) configure fails. This can be worked around by

	./configure --disable-mt    THIS WORKED </span></pre>   	You can probably avoid this issue if you install the mt ( multi threaded ) QT libraries.    UpDate: 3-17-13:  After using Synaptic to manage which QT3 libraries are installed it was no longer necessary to use the --disable-mt switch.    	     	<span style="font-size:14px;"><u><strong>Problem: During the make: "The header file 'componentdialog.h' doesn't include <QObject>. ....waterfall error : Due to incorrect version of MOC being used  from Qt4<img alt="" height="25" src="/04.gif" width="25" /></strong></u></span>    	It appears that the componentdialog.moc.cpp file is being generated by the wrong version of Qt. In the top of the componentdialog.moc.cpp file I found the following annotation:    	** Meta object code from reading C++ file 'componentdialog.h' ** **    	Created: Mon Feb 25 21:11:45 2013 ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.3)   <ul> 	<li> 		Y<a href="http://www.linuxquestions.org/questions/linux-software-2/kdevelop-3-5-1-wont-compile-642311/">ou probably figured this out months ago, being that its now mid november, but you would need to use "./configure --with-qt-dir=/path/to/qt3" where the moc is in the bin directory in that path.</a>  - this did configured with same 4.8.3  	</li> 	<li> 		ComponentDialog.moc.cpp is generated when MAKE is run.  ( I deleted and reran ./configure ...it did not reappear.  Ran MAKE and it reappeared.  	</li> 	<li> 		<a href="http://harmattan-dev.nokia.com/docs/library/html/qt4/moc.html">Explanation on Nokia site of MOC file with QObject and what it does</a> 	</li> 	<li> 		<a href="http://linux.die.net/man/1/moc">MOC Linux Man Page</a> 	</li> </ul>   	     	I theorized that the since the Qt 4 Designer was installed the MOC version being used would be version 4.  Thus I removed the Qt4 Designer and ran <strong>./Configure</strong> and <strong>Make</strong> again.  The following resulted:    	make[3]: Entering directory `/home/freemonsandlewould/Documents/qucs-0.0.16/qucs/components' 	/usr/bin/moc-qt3 -o componentdialog.moc.cpp componentdialog.h 	/bin/bash: /usr/bin/moc-qt3: No such file or directory 	make[3]: *** [componentdialog.moc.cpp] Error 127 	     	This confirmed my theory.  Next step installed Qt 3 Designer.    	<span style="font-size:14px;"><strong><u>Solution: Installing qt3-dev-tools - Getting the correct MOC</u></strong></span>   <ul> 	<li> 		Could not find using apt-get 	</li> 	<li> 		lit up synaptic:  entered qt3 into the filter 	</li> 	<li> 		installed qt3-dev-tools - this managed to install the correct version of MOC 	</li> </ul>   	The make made much more progress this time but encountered a compile error:    	<span style="font-size:14px;"><strong><u>Compiler Ambiguous Reference Issue<img alt="" height="25" src="/04.gif" width="25" /></u></strong></span>    	spfile.cpp: In member function ‘matrix spfile::correlationMatrix(double, nr_complex_t, double, matrix)’: 	spfile.cpp:412:21: error: call of overloaded ‘conj(nr_complex_t)’ is ambiguous 	spfile.cpp:412:21: note: candidates are: 	In file included from /usr/include/c++/4.7/tr1/complex:35:0, 	                 from ../../src/math/complex.h:34, 	                 from component.h:37, 	                 from spfile.cpp:29:   <ul> 	<li> 		<a href="http://forums.opensuse.org/english/get-technical-help-here/applications/462968-qucs-suse-11-4-a.html">qucs and suse 11.4</a>  - Suggested hiding<strong> tr1 folder </strong>by naming it<strong> xtr1</strong> temporarily.   <  <strong>My Error! : I retried after <a href="http://www.softprayog.in/tutorials/understanding-gnu-build-system">make distclean</a>  this time the compile finished</strong> 	</li> </ul>   	<em>Other possibilities: rather complex include the following: </em>   <ul> 	<li> 		<a href="http://sourceforge.net/p/qucs/discussion/311050/thread/ea0834ef">qucs compile error</a>  - appears more on target. Did not work.  <strong>using std:conj </strong>  in complex  breaks the code sooner 	</li> </ul>   	Patches for this found ( not tried yet )   <ul> 	<li> 		<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615684">gcc-4.5 with QUCS</a>   rather intricate patch file.  Too risky as I don't know the exact file version to run against. 	</li> 	<li> 		<a href="https://github.com/Sitwon/SlackBuilds/blob/master/academic/qucs/qucs-disable-tr1.patch">qucs-disable-tr1.patch</a>  - much simpler but I could not get it to run under the PATCH command 	</li> </ul>   	     	<span style="font-size:12px;"><u><strong>Step:  I did the  make INSTALL</strong></u>   This appeared to complete successfully</span>    	<span style="font-size:14px;"><strong><u>Problem: When I attempted to run QUCS the following error message was returned</u>:   libqt.so.3: cannot open shared object file: No such file or directory<img alt="" height="25" src="/02.gif" width="25" /></strong></span>   <ul> 	<li> 		<span style="font-size:12px;">I found      /usr/local/qt/lib/libqt.so.3    This is a link file to the version of qt3 lib file whose name varies according to version thus the level of indirection</span> 	</li> 	<li> 		<span style="font-size:12px;">I added <strong>/usr/local/qt/lib</strong> manually to:   </span><strong>/etc/ld.so.conf</strong> 	</li> 	<li> 		During this phase of problem solving I deleted the qt3 library that I previous configure / make / install -  I replace with the libqt3 multi threaded - It could be the next time I try to build the project that it may snag there. 	</li> 	<li> 		<span style="font-size:12px;">Using the ldd - list dependency command:</span><span style="font-size:12px;"> </span> 		 			  		  		 			  		  		 			  		  		 			  		 	</li> </ul>   	<strong>freemonsandlewould@lucy:/usr/local/bin ldd /usr/local/bin/qucs
    linux-gate.so.1 =>  (0xb76f9000)
    libqt.so.3 => not found
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb75fa000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb75cd000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7423000)
    /lib/ld-linux.so.2 (0xb76fa000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7405000)

  • using locate command I found the library:

freemonsandlewould@lucy:/usr/local/bin$ locate libqt.so.3
/usr/local/qt/lib/libqt.so.3
/usr/local/qt/lib/libqt.so.3.3
/usr/local/qt/lib/libqt.so.3.3.8

  • I used the following command and it must have place the path to the library in the correct place because after this QUCS ran 

sudo ldconfig /usr/local/qt/lib

QUCS  booted up at this point

 

How to pull from Git and build

QUCS build with Qt4

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *