QUCS build notes
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.
- Recents notes on sourceforge by Frans on building regarding qt3 and qt4
- ADMS – analog mixed signal – I had to download and build. The build system specified the correct location under linux to match the QUCS build – When I search for this I was only using APT-GET. Need to recheck using Synaptic – much easier to find packages.
- download Qt3 3.3.8 – download to personal file area. Follow instructions here on how to setup. / unzip / rename to Qt and use terminal command: sudo mv ./qt /usr/local
- Qt 3.3.8 Download from Nokia FTP
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
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.
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
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)
- You 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. – this did configured with same 4.8.3
- ComponentDialog.moc.cpp is generated when MAKE is run. ( I deleted and reran ./configure …it did not reappear. Ran MAKE and it reappeared.
- Explanation on Nokia site of MOC file with QObject and what it does
- MOC Linux Man Page
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 ./Configure and Make 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.
Solution: Installing qt3-dev-tools – Getting the correct MOC
- Could not find using apt-get
- lit up synaptic: entered qt3 into the filter
- installed qt3-dev-tools – this managed to install the correct version of MOC
The make made much more progress this time but encountered a compile error:
Compiler Ambiguous Reference Issue
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:
- qucs and suse 11.4 – Suggested hiding tr1 folder by naming it xtr1 temporarily. < My Error! : I retried after make distclean this time the compile finished
Other possibilities: rather complex include the following:
- qucs compile error – appears more on target. Did not work. using std:conj in complex breaks the code sooner
Patches for this found ( not tried yet )
- gcc-4.5 with QUCS rather intricate patch file. Too risky as I don't know the exact file version to run against.
- qucs-disable-tr1.patch – much simpler but I could not get it to run under the PATCH command
Step: I did the make INSTALL This appeared to complete successfully
Problem: When I attempted to run QUCS the following error message was returned: libqt.so.3: cannot open shared object file: No such file or directory
- 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
- I added /usr/local/qt/lib manually to: /etc/ld.so.conf
- 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.
-
Using the ldd – list dependency command:
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
- Sourceforge qt4 QUCS
- Version 0.0.17 Unstable with Qt4
- Gopala Krishna is working with QUCS migration to Qt4
QUCS Quite Universal Circuit Simulator Table of Contents TOC
0 Comments