[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA: Win compile help please



An observation: it seems that you have both Mingw and Cygwin installed (based on the fact that you have two libiberty's). Can you confirm this? Which g++ is being used? (issue the command 'which g++'. Does the result have 'mingw' in the path or 'cygwin'?)


You should be able to link the extra lib(s) with -l<lib>: -liberty or -lmingwex, since both are in 'system' directories (at least for Mingw/Cygwin). With gcc -L<path> adds a search path for libraries. If g++ reports that the library cannot be found, add -L<path_to_lib_dir> to your link line (-L/c/mingw/lib)

Your link link should look something like this when run:
g++ -o ivl.exe <objects ...> -liberty

Don't worry about the two scripts I refer to in my instructions. I am stubbing these scripts out under Mingw, so that the build completes. You have the actual applications, so you don't need 'stub' scripts.

Regards,
Matthew

On 7/4/05, CN <mis4@scionix.com> wrote:
please see imbedded

--Original Message Text---
From: Matthew Ballance
Date: Mon, 4 Jul 2005 17:58:37 -0700

Hi,
Okay, I did bit more digging and discovered that 'getopt' is also contained in libmingwex.a. GCC - in the mingw version that I have - links this library by default (see the output of gcc -dumpspecs).


$ nm c:/MinGW/lib/libiberty.a | grep getopt
getopt.o:
00000008 D ___getopt_initialized
00000130 t __getopt_initialize
000003f0 T __getopt_internal
00000f20 T _getopt
getopt1.o:
U __getopt_internal
00000000 T _getopt_long
00000030 T _getopt_long_only

I have also two libmingwex.a
$ nm c:/MinGW/lib/libmingwex.a | grep getopt
(none)

$ nm c:/cygwin/lib/mingw/libmingwex.a | grep getopt
getopt.o:
00000670 T _getopt
00000070 t _getopt_internal
000007d0 T _getopt_long

I know that I had to link libiberty.a explicitly when I first compiled Icarus on Windows. You might try that...
How do I do that? In the g++ -o step below I added (modified as)
g++ -Lc:/MinGW/lib/libiberty.a -o ivl.exe main.o ....

but it still gives the same errors:
main.o: In function `Z17read_iconfig_filePKc':
c:/ivl/v81/main.cc:406: undefined reference to `optarg'
main.o: In function `main':
c:/ivl/v81/main.cc:492: undefined reference to `getopt'
c:/ivl/v81/main.cc:461: undefined reference to `optarg'
c:/ivl/v81/main.cc:471: undefined reference to `optarg'
c:/ivl/v81/main.cc:474: undefined reference to `optarg'
main.o: In function `main':
c:/MinGW/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `optarg'
c:/MinGW/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `optarg'
main.o: In function `main':
c:/ivl/v81/main.cc:518: undefined reference to `optind'
c:/ivl/v81/main.cc:552: undefined reference to `optind'
lexor.o: In function `Z14VL_init_bufferP15yy_buffer_stateP6_iobuf':
c:/ivl/v81/lexor.cc:2409: undefined reference to `isatty(int)'

Same result if add the other lib -Lc:/cygwin/lib/mingw/libmingwex.a instead.

Do I need to change the compile step too any way? Exactly what is the change needed?


With respect to gperf and bison, I assume Cygwin is providing appropriate versions. If everything compiles okay, then the versions are probably appropriate.

The last step of my instructions is necessary on Mingw because man and ps2pdf are not provided by Mingw.

D. This may not be my immedate problem; but I am not clear about your last step... am I supposed to create those two files each with just those 3 lines? Do I simply create these two files man and ps2pdf and add the three lines you gave? Where should I place these two new files?

Try modifying the Makefile for ivl.exe to link in libiberty. If libmingwex exists in your install, try linking this (you can run 'nm' on the lib first to see if getopt exists in that libmingwex).

Let me know what you find...

Regards,
Matthew

Cordially,
Chacko




On 7/4/05, CN <mis4@scionix.com> wrote: Hello Mathew,

Thank you for the response! This is very encouraging that you have had success recently. I was getting a bit desparate :) Even though I have been programming for the last 40 years or so, I am very new to cygwin, ivl, and openSrc in general ... [I had no problem compiling ivl under linux.]

A. My cygwin setup shows gperf 2.7.2-1 as the latest... Is 3.0.1 needed? How come my cygwin installer does not show any past 2.7.2?

B. Bison installed shows 20030307-1.

C. I do have libiberty.a in c:\MinGW\lib (as well as in c:\cygwin\lib); but there is no getopt.h under the MinGW tree, there is one under c:\cygwin\usr\include\mingw. How does the g++ -o step below get to this lib, I do not see any CPP or LD FLAGS referring to this.

D. This may not be my immedate problem; but I am not clear about your last step... am I supposed to create those two files each with just those 3 lines? I do have a c:\cygwin\bin\ps2pdf:
----
#!/bin/sh
# $Id: ps2pdf,v 1.3 2002/02/21 21:49:28 giles Exp $
# Convert PostScript to PDF.

# Currently, we produce PDF 1.2 by default, but this is not guaranteed
# not to change in the future.
exec ps2pdf12 "$@"
----

and a c:\cygwin\etc\preremove\masn.sh:
----
#!/bin/sh
# man version 1.5p

manifest=/etc/preremove/man-manifest.lst

[ -f $manifest ] || (echo "Unable to find manifest file" && exit 0)

echo "*** Removing unmodified base files."
echo "*** These will be updated by the postinstall script."
echo "*** Please wait."

while read f; do
/bin/cmp -s "/${f}" "/etc/defaults/${f}" && \
(echo /$f hasn\'t been modified, it will be updated ; \
/bin/rm -f "/${f}")
done < ${manifest}
----

Any help will be very much appreciated!!

Cordially, CN

--Original Message Text---
From: Matthew Ballance
Date: Mon, 4 Jul 2005 01:47:09 -0700

getopt comes from libiberty.a - at least on Mingw. Here are my directions for building IVI under Mingw (I use Mingw instead of Cygwin).

- install gperf-3.0.1 (from your favorite GNU mirror)

- install bison-2.0-MSYS from the mingw site

- Create 'man' and 'ps2pdf' shell scripts. Each of these scripts is:
#!/bin/sh

echo ""


Seems to build for me...

Regards,
Matthew

On 7/3/05, CN <mis4@scionix.com> wrote: Stephen,

Any idea where the getopt library comes from for the mingw compile? I have looked everywhere, and have installed more of the cygwin related libs and other stuff without any success. If I know where the lib is located, I may be able to tune the config or Makefile

Do you know of anybody who currently builds the win version? Perhaps I can try to contact him/her?

CLUE: in the first of two steps of ivl.exe build steps,

g++ -o ivl.exe main.o async.o design_dump.o dup_expr.o elaborate.o elab_expr.o e
| lab_lval.o elab_net.o elab_anet.o elab_pexpr.o elab_scope.o elab_sig.o emit.o ev
| al.o eval_attrib.o eval_tree.o expr_synth.o functor.o lexor.o lexor_keyword.o li
| nk_const.o load_module.o netlist.o netmisc.o net_assign.o net_design.o net_event
| .o net_expr.o net_force.o net_func.o net_link.o net_modulo.o net_nex_input.o net
| _nex_output.o net_proc.o net_scope.o net_udp.o net_variable.o pad_to_width.o par
| se.o parse_misc.o pform.o pform_dump.o set_width.o symbol_search.o sync.o sys_fu
| ncs.o verinum.o verireal.o target.o targets.o Attrib.o HName.o LineInfo.o Module
| .o PData.o PDelays.o PEvent.o PExpr.o PGate.o PTask.o PUdp.o PFunction.o PWire.o
| Statement.o StringHeap.o cprop.o nodangle.o synth.o synth2.o syn-rules.o xnfio.
| o t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o t-xnf.o

since there are no additional lib directives, I assume g++ has some libs it searches by default? Do you know which one it might be?

Cordially, Chacko


On Wed, 29 Jun 2005 15:51:31 -0700, Stephen Williams wrote:
Also, there is something fishy about HAVE_GETOPT_H in your
generated config.h. That is *defined* in the example I have
in front of me.