From: Stefan J. <st...@gr...> - 2006-09-11 06:41:51
|
Am Mo, 11.09.2006, 00:37, schrieb Craig Harman: Hello Craig, > I just compiled Qucs on 0.0.10 on my OS Tiger machine. I'm emailing the > list to document the changes I made to the configuration files and > source in order to compile a working version. > > > SYSTEM CONFIGURATION: > > My machine is running OS X 10.4.7, PowerPC version. I used the Fink > package manager (v0.8.1) to install to install the QT3 developer > package (qt3-dev, v3.3.5-1023). My gcc version is reported as: > > powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. > build 5341) > > > PROBLEMS RUNNING CONFIGURE SCRIPT: > > When the configure script is run on a freshly extracted copy of the Qucs > source, it fails with the error message: > > checking for Qt headers... configure: error: not found > > Fink installs the QT headers in /sw/include/qt, and the QT libraries in > /sw/lib. The Qucs configure script looks for the header and library > files in several different locations, including /usr/local/qt. I > created the directory /usr/local/qt, and created symbolic links in this > directory to the actual location of the header and footer files: > > ln -s /sw/include/qt /usr/local/qt/include > ln -s /sw/lib /usr/local/qt/lib > > The configure script now runs successfully (but you'll run into problems > later on unless you run configure with the --enable-debug flag, as > explained below). > > > PROBLEMS RUNNING MAKE: > > Make fails with the following error message: > > if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../src/components -O2 -pipe > -fno-exceptions -fno-rtti -fno-check-new -MT parse_zvr.o -MD -MP -MF > ".deps/parse_zvr.Tpo" -c -o parse_zvr.o parse_zvr.cpp; \ > then mv -f ".deps/parse_zvr.Tpo" ".deps/parse_zvr.Po"; else rm -f > ".deps/parse_zvr.Tpo"; exit 1; fi > /usr/include/architecture/ppc/math.h:513: error: expected > unqualified-id before numeric constant > > The parse_zvr.cpp file (in qucs-core/src) #include's vector.h, which > #include's consts.h, which #include's math.h. > > Here are the relevant lines from math.h: > > 512: typedef struct __complex_s { > 513: double Real; > 514: double Imag; > 515: } __complex_t; > > This error message occurs because parse_zvr.cpp has #define'd 'Real' as > a constant: > > #define Real 261 > > So the preprocessor changes line 513 of math.h to: > > double 261; > > which obviously causes problems. One solution to the problem would be > to not use a constant named 'Real'. The workaround/hack that I used was > to #define a constant that causes the offending portion of math.h to be > skipped. Adding the line: > > #define __NOEXTENSIONS__ 1 > > to parse_zvr.cpp before the line: > > #include "vector.h" > > circumvents the problem. > > The parse_mdl.cpp in qucs-core/src has the same problem as the > parse_zvr.cpp file, and can be fixed in the same way. > > > PROBLEMS RUNNING QUCS: > > Qucs now compiles, but when I run the 'qucs' program, it fails with the > error message: > > dyld: lazy symbol binding failed: lazy pointer not found > dyld: lazy pointer not found > Trace/BPT trap > > This posting: > > http://forums.codeblocks.org/index.php?topic=3976.msg31422;topicseen > > claims that the primary reason for this error message is "gcc packaged > with 10.4 should not be used with the -s option. It over strips your > programs and libraries." And this is in fact the problem here. The > '-s' flag is added to the LDFLAGS variable in both the configure and > qucs-core/configure scripts. If we look at the configure.ac file that > is used to generate the configure script, we see that the '-s' flag is > only used if debugging code is disabled: > > if test "$enable_debug" = yes; then > AC_DEFINE(DEBUG, 1, [Define if debug output should be supported.]) > QT_DEF="" > else > AC_DEFINE(NDEBUG, 1, [Define if debug code should be suppressed.]) > QT_DEF="-DQT_NO_DEBUG" > if test "x$GCC" = xyes; then > CFLAGS="`echo $CFLAGS | sed -e 's/\-g //g'`" > CXXFLAGS="`echo $CXXFLAGS | sed -e 's/\-g //g'`" > LDFLAGS="$LDFLAGS -s" > fi > fi > > Running the configure script with the --enable-debug flag prevents the > '-s' flag from being used, and gives us a working version of Qucs 0.0.10 > on OS X. > > > If the development team is interested in modifying the Qucs source code > so that it compiles cleanly on OS X, let me know. I'm willing to do > some legwork. Thanks a lot for this report! I am going to add these things to the current CVS code by myself. When it's done -- could you verify if it is working? Thanks, Stefan. |