Compiler Qucs (avec Qt) sous Mac OS X

overmac

Membre junior
30 Juillet 2004
24
0
37
Bonjour à tous,
je suis un utilisateur du prometteur logiciel Qucs (soft de simulation de circuits électroniques) qui à été conçu sur Qt. Donc, ce soft peut fonctionner sur différentes plates-formes dont Mac OS X.
Seulement, le portage sur des plates-formes autres que Linux ne se fait pas par l'équipe en charge du développement de Qucs, mais par des volontaires qui mettent à disposition leurs temps pour cette tâche. La personne qui s'occupe du portage pour Mac (qui se nomme Markus) s'est arrêter à la version 0.0.8 (actuellement on en est à la 0.0.9-1) et semble ne plus pouvoir continuer l'aventure faute de temps :
Hello,

thanks for your email. ATG is a leisure time project so there is
usually at least some delay before a new version of any of the
programs appears on it. Related to the page I'm actually
restructuring several aspects of it including how installers are
provided, feedback, etc. These changes will be revealed starting from
the next weekend.
There are still some technical issues I have to address mainly how to
create comfortable and somewhat elegant installers for both PPC- and
Intel-based Macs. This "eats" much the spare time I can attribute to
ATG, even much more then creating the actual installer, so the
easiest way might be for you to compile the latest qucs *or any other
newer version of any of the programs on ATG* by yourself.

Due to the large amount of traffic the page is sometimes generating
I'm not even sure wether I'll keep *and can keep* the actual
distribution scheme. I'll hope to solve most technical issues till
this sunday. If everything goes well I'll then go and update every
day contents, images, RSS-feed generation and one of the installers,
etc.…

Because ATG is a "one-man-for-fun-project" I'm sorry but I can't
offer any, more specific date regarding for example an update to
qucs. It might show up sooner or later… *actually regarding qucs:
I'm trying to include the digital simulation stuff working on MacOSX
(Intel & PCC), but there are some issues. I decided not to update
the installer during the last weeks simply because of this, and this
time I'll presumably not do it until I solved these issues (which
will take some time because I received several emails with request
regarding other programs).*

So for the moment I'm sorry. Cheers,

Markus
Pour compiler ce logiciel, il faut Qt version 3 et donc installer la version minimum 3.3.6, pour mac. Elle doit se trouver ici : previous version
On peut lire dans le fichier d'installation :
INSTALLING Qt/Mac Version 3.3.6 (for Mac OS X)


1. Unpack the archive if you have not done so already:

cd /Developer
gnutar xzvf Full_Path_to_Directory_You_Unpacked_To/qt-mac-free-3.3.6.tar.gz

This creates the directory /Developer/qt-mac-free-3.3.6 containing the
files from the main archive.

Rename qt-mac-free-3.3.6 to qt (or make a symlink):

mv qt-mac-free-3.3.6 qt

The rest of this file assumes that Qt is unpacked in /Developer/qt.

2. Set some environment variables in the file .login (or .profile or
something else depending on your shell) in your home directory.
Create this file if it is not already there. You can check your shell
by typing:

finger Your_Login

The variables that you must set are:

QTDIR - wherever you installed Qt
PATH - to locate the moc program and other Qt tools
DYLD_LIBRARY_PATH - for the shared Qt library

This is done like this:

In .login (in case your shell is csh or tcsh), add the following lines:

setenv QTDIR /Developer/qt
setenv PATH $QTDIR/bin:$PATH
setenv DYLD_LIBRARY_PATH $QTDIR/lib:$DYLD_LIBRARY_PATH

***************************WARNING******************************
* Some versions of tcsh do not understand the expansion of empty
* variables. If you experience any error messages with the above
* instructions, you may want to replace them with:
*
* setenv QTDIR /Developer/qt
* setenv PATH $QTDIR/bin:$PATH
* setenv DYLD_LIBRARY_PATH $QTDIR/lib

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

QTDIR=/Developer/qt
PATH=$QTDIR/bin:$PATH
DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH

export QTDIR PATH DYLD_LIBRARY_PATH

If you use a different shell, please modify your environment variables
accordingly.

After you have done this, you will need to login again, or re-source the
profile before continuing, so that $QTDIR, $PATH, and $DYLD_LIBRARY_PATH
are set. Without these the installation will halt with an error message.

3. Make a symbolic link from $QTDIR/doc/man to $QTDIR/man by typing the following:

ln -s $QTDIR/doc/man $QTDIR/man

This will give you the man pages for the commandline Qt programs.

4. If you have the commercial edition of Qt, install your license
file as $HOME/.qt-license.

5. Building.

This step compiles the Qt library, and builds the example programs,
the tutorial, and the tools (e.g. Qt Designer, etc.).

Type:

cd $QTDIR
./configure

This will configure the Qt library for your machine. Run ./configure -help
to get a list of configuration options.

To create the library and compile all the examples and the
tutorial, type:

/usr/bin/make

If your platform or compiler is not supported, please contact us at
qt-bugs@trolltech.com so that we can assist you. If it is supported
but you have problems, see http://www.trolltech.com/platforms/ for
information on known issues.


6. Launching Qt applications from the Finder.

If you built Qt using the -static option, your executables will contain the
Qt library and can be run from Finder automatically. Otherwise, your
executables will need to use the Qt library on your system. You can achieve
this by using symbolic links.

We recommend making these symbolic links (if you have configured Qt with
-thread [ie threading enabled], please change the libqt below with
libqt-mt):

ln -sf $QTDIR/lib/libqt.3.dylib /usr/lib
ln -sf $QTDIR/lib/libqui.1.dylib /usr/lib

You may need to have 'administrator' access to do this, (in which
case, precede each command with 'sudo', e.g. 'sudo ln -s ...'). If
you use sudo you'll be prompted for your password.

If you do not have administrator access, or you would prefer to do
a user install (rather than system install) of the libraries you
can do (if you have configured Qt with -thread [ie threading enabled],
please change the libqt below with libqt-mt):

ln -sf $QTDIR/lib/libqt.3.dylib $HOME/lib
ln -sf $QTDIR/lib/libqui.1.dylib $HOME/lib

Note: you can also achieve similar functionality by adding your
DYLD_LIBRARY_PATH to the GUI's environment.

That's all! Qt is now installed. Qt's documentation can be read with
Qt Assistant or by any web browser; the contents page is:
$QTDIR/doc/html/index.html

See the PLATFORM file for details pertaining to your environment.
Donc j'ouvre le fichier .profile avec la commande open .profile. Dedans j'ai la ligne :
Bloc de code:
test -r /sw/bin/init.sh && . /sw/bin/init.sh
puis je rajoute le reste, ce qui donne dans ce fichier :
Bloc de code:
test -r /sw/bin/init.sh && . /sw/bin/init.sh
QTDIR=/Developer/qt
PATH=$QTDIR/bin:$PATH
DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH

export QTDIR PATH DYLD_LIBRARY_PATH
Ensuite, j'enregistre ce fichier (il était en lecture seule donc j'ai dû l'écraser) et je tape dans le terminal la commande :
Bloc de code:
ln -s $QTDIR/doc/man $QTDIR/man
mais j'obtiens comme réponse :
Bloc de code:
DYLD_LIBRARY_PATH=/sw/lib:/man: No such file or directoryin:/usr/X11R6/bin
Je ne sais ce qu'il faut faire maintenant pour continuer l'installation de Qt.
Quelqu'un aurait-il une idée ?

Merci…
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
Après avoir modifier le .profile, il faut "sourcer" ce fichier : 'source .profile' pour prendre en compte les modifications.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
ntx a dit:
Après avoir modifier le .profile, il faut "sourcer" ce fichier : 'source .profile' pour prendre en compte les modifications.
J'ai ouvert le terminal et tapé :
Bloc de code:
source .profile
après, le terminal me redonne la main. Je retape
Bloc de code:
ln -s $QTDIR/doc/man $QTDIR/man
mais j'obtiens toujours :
Bloc de code:
DYLD_LIBRARY_PATH=/sw/lib:/man: No such file or directoryin:/usr/X11R6/bin
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
Donc il y a un problème dans ton fichier .profile. Tu devrais avoir "/Developer/qt". Vérifie ton fichier.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
ntx a dit:
Donc il y a un problème dans ton fichier .profile. Tu devrais avoir "/Developer/qt". Vérifie ton fichier.
Voilà ce que j'ao quand j'ouvre le fichier :
Bloc de code:
test -r /sw/bin/init.sh && . /sw/bin/init.sh
QTDIR=/Developer/qt
PATH=$QTDIR/bin:$PATH
DYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_LIBRARY_PATH

export QTDIR PATH DYLD_LIBRARY_PATH
Et j'ai bien le dosssier qt dans le dosseir Developer.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
ntx a dit:
Commente la ligne qui commence par test (met un #) et vois ce que cela donne.
Je viens de le faire, et j'ai "sourcer" le fichier. A la fin, j'obtiens ça :
Bloc de code:
DYLD_LIBRARY_PATH=/sw/lib:/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/uDYLD_LIBRARY_PATH=/sw/lib:/lib:/man: No such file or directorysr/X11R6/bin
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
Il vaut mieux utiliser un éditeur de texte "Unix" dans le terminal comme pico, emacs ou vi. Textedit va ajouter des caractères de contrôles dans tes lignes d'où tes problèmes. Si tu fais "more .profile" je pense qu'il y a des caractères indésirables qui traînent :confused:
 

overmac

Membre junior
30 Juillet 2004
24
0
37
ntx a dit:
Il vaut mieux utiliser un éditeur de texte "Unix" dans le terminal comme pico, emacs ou vi. Textedit va ajouter des caractères de contrôles dans tes lignes d'où tes problèmes. Si tu fais "more .profile" je pense qu'il y a des caractères indésirables qui traînent :confused:
J'ai ça dans mon fichier :
Bloc de code:
#test -r /sw/bin/init.sh && . /sw/bin/init.sh
QTDIR=/Developer/qt^MPATH=$QTDIR/bin:$PATH^MDYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_L
IBRARY_PATH

export QTDIR PATH DYLD_LIBRARY_PATH
je vais essayer de réparer avec vi, ou autre…
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
overmac a dit:
J'ai ça dans mon fichier :
Bloc de code:
#test -r /sw/bin/init.sh && . /sw/bin/init.sh
QTDIR=/Developer/qt^MPATH=$QTDIR/bin:$PATH^MDYLD_LIBRARY_PATH=$QTDIR/lib:$DYLD_L
IBRARY_PATH

export QTDIR PATH DYLD_LIBRARY_PATH
Les retours chariot sont remplacés par des "^M" : ça marche forcement moins bien. :rateau:
 

overmac

Membre junior
30 Juillet 2004
24
0
37
Voilà, ça m'à demandé presque toute la nuit mais ça y est, Qt est installé :
Bloc de code:
The Qt library is now built in ./lib
The Qt examples are built in the directories in ./examples
The Qt tutorials are built in the directories in ./tutorial

Enjoy!   - the Trolltech team
Maintenant, je suis à l'étape 6. Je vais voir comment faire pour compiler les sources du logiciel Qucs pour Mac OS X PPC. Par contre je n'ai pas trop bien compris la dernière étape, c'est quelle options que je dois mettre ?

Merci…
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
Dans l'étape 6, tu crées des liens symboliques dans le répertoire des librairies sur la librairie Qt que tu viens de compiler. Tu peux soit le positionner dans /usr/lib ou dans $HOME/lib, ailleurs si tu veux. Tu peux même utiliser celle qui est dans /Developer/qt/lib. C'est comme tu veux en fait, il faudra juste donner la bonne indication au compilateur quand tu construiras Qucs : l'option -L de gcc.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
ntx a dit:
Dans l'étape 6, tu crées des liens symboliques dans le répertoire des librairies sur la librairie Qt que tu viens de compiler. Tu peux soit le positionner dans /usr/lib ou dans $HOME/lib, ailleurs si tu veux. Tu peux même utiliser celle qui est dans /Developer/qt/lib. C'est comme tu veux en fait, il faudra juste donner la bonne indication au compilateur quand tu construiras Qucs : l'option -L de gcc.
Ok merci. Je regarderai ça ce soir chez moi.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
Je viens de télécharger la dernière version de Qucs : 0.0.10
Nous pouvons lire ça dans le fichier INSTALL :
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.

This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.

Basic Installation
==================

These are generic installation instructions.

The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').

It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)

If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.

The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.

The simplest way to compile this package is:

1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.

Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.

2. Type `make' to compile the package.

3. Optionally, type `make check' to run any self-tests that come with
the package.

4. Type `make install' to install the programs and any data files and
documentation.

5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.

Compilers and Options
=====================

Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.

You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:

./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

*Note Defining Variables::, for more details.

Compiling For Multiple Architectures
====================================

You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.

If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.

Installation Names
==================

By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.

You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.

In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.

If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.

Optional Features
=================

Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.

Specifying the System Type
==========================

There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:

CPU-COMPANY-SYSTEM

where SYSTEM can have one of these forms:

OS KERNEL-OS

See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.

If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.

If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.

Sharing Defaults
================

If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Defining Variables
==================

Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:

./configure CC=/usr/local2/bin/gcc

will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).

`configure' Invocation
======================

`configure' recognizes the following options to control how it
operates.

`--help'
`-h'
Print a summary of the options to `configure', and exit.

`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.

`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.

`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.

`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).

`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.

`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
Le dossier qucs-0.0.10 est sur mon bureau. Donc depuis le Terminal, je vais dans ce dossier puis je tape : ./configure
Bloc de code:
power-mac-g4-de-overmac-overmac:~/Desktop/qucs-0.0.10 overmac$ ./configure
checking build system type... powerpc-apple-darwin8.7.0
checking host system type... powerpc-apple-darwin8.7.0
checking target system type... powerpc-apple-darwin8.7.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for ar... ar

  The qucs package has never been compiled or run on this platform.
  Please send an email to <qucs-devel@lists.sourceforge.net> including your
  compiler and Qt version and whether it worked correctly or not.  The
  'powerpc-apple-darwin8.7.0' line will then be added to the PLATFORMS file included
  in this package.

checking for lrelease... /Developer/qt/bin/lrelease
checking for lupdate... /Developer/qt/bin/lupdate
checking for moc... /Developer/qt/bin/moc
checking for uic... /Developer/qt/bin/uic
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers in standard search path
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for Qt headers... found in /Developer/qt/include
checking for Qt... 3 (multi-threaded)
checking for Qt library... configure: error: not found
Je ne sais pas comment faire pour lui indiquer où trouver les bibliothèques de Qt.
Une idée ?
 

ntx

Vénérable sage
Club MacG
15 Octobre 2004
12 053
370
92
Il faut sûrement modifier ta variable d'environnement LD_LIBRARY_PATH pour y ajouter le chemin vers ta librairie qt.
 

overmac

Membre junior
30 Juillet 2004
24
0
37
Il faut sûrement modifier ta variable d'environnement LD_LIBRARY_PATH pour y ajouter le chemin vers ta librairie qt.
Puisque lors de la compilation des bibliothèques de Qt, j'ai eu le message :
The Qt library is now built in ./lib
The Qt examples are built in the directories in ./examples
The Qt tutorials are built in the directories in ./tutorial

Enjoy! - the Trolltech team
Je suppose qu'ellles soient dans ./lib.
Donc, si j'ai bien compris, il faut changer dans le fichier .profile, mais je ne le trouve plus dans le dossier qt qui se trouve lui-même dans Developpers.