Gnucap for windows

View: New views
3 Messages — Rating Filter:   Alert me  

Gnucap for windows

by Paul Reichl :: Rate this Message:

| View Threaded | Show Only this Message

Hi All,

First of all I would like to say a big thanks to the gnucap developers
as I have only just started using it and I have found it to be a
fantastic tool.

Also please forgive me if this email lists down what has already been
documented/discussed elsewhere, but after being asked if gnucap works in
windows (personally I much prefer Linux) and not finding any windows
executable files (or a recipe for generating them) this was the
procedure that I used to generate a gnucap.exe file that seems (from my
few limited tests) to work.
Please note that the windows executable was generated on my *linux* box
using the mingw32 cross compilers (they are fantastic as they allow you
to generate windows executables from linux!).

My computer is running Ubuntu 11.10 oneiric (64 bit). To generate
windows binaries from my Ubuntu machine I first needed to install the
mingw32 cross compilers and wine (if I didn't have wine installed it
complained during the configure process that I could not execute the
generated c++ execuatbles (or something along those lines)).

Anyway to install these I simply used

sudo apt-get install mingw32

and for wine

sudo apt-get install wine1.3

I then downloaded gnucap-2009-12-07.tar.gz (from
http://permalink.gmane.org/gmane.comp.gnu.gnucap.devel/567). I am not
sure if these are the latest files or not, but these are the ones I used.
After unpacking this archive and changing into the gnucap-2009-12-07
directory

I ran configure with the options as listed below

./configure CC=i586-mingw32msvc-cc CXX=i586-mingw32msvc-c++
CPP=i586-mingw32msvc-cpp

after this was complete I then ran

make

after compiling a number of items it later failed with the message below

i586-mingw32msvc-c++: unrecognized option '-rdynamic'
make[2]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/modelgen'
Making all in src
make[2]: Entering directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/src'
../modelgen/gnucap-modelgen -h d_mos1.model
/bin/bash: ../modelgen/gnucap-modelgen: No such file or directory
make[2]: *** [d_mos1.h] Error 127
make[2]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07'
make: *** [all] Error 2

It appears as if i586-mingw32msvc-c++ does not like the compiler flag
'-rdynamic', so I simply performed a make clean using

make clean

then I edited the configure file and changed
LDFLAGS="$LDFLAGS -rdynamic"
to
LDFLAGS="$LDFLAGS"

This essentially removed the flag -rdynamic. Is it OK to remove this
option?. Does anyone know what (if any) impact this is likely to have?.
i.e. will it break something somewhere? (my simple examples work alright
without it).
According to the gcc man page
-rdynamic
            Pass the flag -export-dynamic to the ELF linker, on targets that
            support it. This instructs the linker to add all symbols,
not only
            used ones, to the dynamic symbol table. This option is
needed for
            some uses of "dlopen" or to allow obtaining backtraces from
within
            a program.

On the assumption that it was OK to remove the flag -rdynamic,

I then ran ./configure again as

./configure CC=i586-mingw32msvc-cc CXX=i586-mingw32msvc-c++
CPP=i586-mingw32msvc-cpp

and again ran

make

This time it gets further but fails with the following error message

make[2]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/modelgen'
Making all in src
make[2]: Entering directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/src'
../modelgen/gnucap-modelgen -h d_mos1.model
/bin/bash: ../modelgen/gnucap-modelgen: No such file or directory
make[2]: *** [d_mos1.h] Error 127
make[2]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/preichl/GNUCAP/SOURCE/TEST2/gnucap-2009-12-07'
make: *** [all] Error 2

To fix this I edited the src/Makefile and changed the lines that read

%.cc : %.model %.h ${MODELGEN}${EXEEXT}
         ${MODELGEN} -cc $<

%.h : %.model ${MODELGEN}${EXEEXT}
         ${MODELGEN} -h $<

to

%.cc : %.model %.h ${MODELGEN}${EXEEXT}
         ${MODELGEN}${EXEEXT} -cc $<

%.h : %.model ${MODELGEN}${EXEEXT}
         ${MODELGEN}${EXEEXT} -h $<

I then ran did a make clean again using

make clean

and compiled again using

make

This time it ran through to completion and generated a windows
executable called gnucap.exe in the src directory.

I then copied the gnucap.exe file (roughly 38MB) from my linux machine
to a windows machine and I was able to successfully run a number of
examples in windows!.

So essentially my question is: will I have broken anything by removing
the  -rdynamic flag from the configure file?

Thanks in advance,

Paul.




_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
https://lists.gnu.org/mailman/listinfo/help-gnucap

Re: Gnucap for windows

by al davis-13 :: Rate this Message:

| View Threaded | Show Only this Message

The autoconf (configure) script doesn't get it right for
windows, as you discovered.

Instead .. try the alternate build system "configure.old".  Then
"make mingw".

Actually, that doesn't work automatically either.  Modelgen
needs to run on the host system, and you need to manually make a
link.

so ..
./configure.old
make
cd src
make mingw
ln -s gnucap-modelgen MSW
make mingw

This should give you a working windows executable.

You asked about "-rdynamic" ..  it doesn't work on windows, but
you can't just remove it.  Look in src/Make2.mingw to see what
to do.

On Linux, -rdynamic exports the symbols so they are available to
plugins.  If you just leave it out, plugins won't work.  For
windows, you also need to build a ".a" file which (as I recall)
contains the symbol table for plugins.

_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
https://lists.gnu.org/mailman/listinfo/help-gnucap

Parent Message unknown Re: Gnucap for windows

by Paul Reichl :: Rate this Message:

| View Threaded | Show Only this Message

Hi Al,

thanks for you reply.

I did a bit more searching on the -rdynamic flag and it appears as if
someone else has encountered something similar with the mineserver
software (i.e. not all symbols exported). As per
http://mineserver.be/forums/index.php?topic=89.0

The solution they suggested was to use the flag "-export-all-symbols"
with mingw32.
Anyway I modified the section of the configure file that read

LDFLAGS="$LDFLAGS -rdynamic"

to

if `echo $CC | grep "mingw" 1>/dev/null 2>&1`
then
   LDFLAGS="$LDFLAGS -export-all-symbols"
else
   LDFLAGS="$LDFLAGS -rdynamic"
fi

and ran

./configure CC=i586-mingw32msvc-cc CXX=i586-mingw32msvc-c++
CPP=i586-mingw32msvc-cpp

and then afterwards modified src/Makefile so that the lines that read

%.cc : %.model %.h ${MODELGEN}${EXEEXT}
         ${MODELGEN} -cc $<

%.h : %.model ${MODELGEN}${EXEEXT}
         ${MODELGEN} -h $<

now read

%.cc : %.model %.h ${MODELGEN}${EXEEXT}
         ${MODELGEN}${EXEEXT} -cc $<

%.h : %.model ${MODELGEN}${EXEEXT}
         ${MODELGEN}${EXEEXT} -h $<

and then ran

make

and it all compiled.
I haven't used any of the plugins so I don't know how to test this (but
it seems to work fine with my few limited test cases (although they
don't use any plugins). The generated gnucap.exe is now roughly 100kb
larger than before (when I didn't have any flags at all), so something
has changed.

Where can I find an example that uses a plugin?, so that I can test to
see if this works.

Kind Regards,

Paul.


On 08-Feb-12 04:00, help-gnucap-request@... wrote:
> Re: Gnucap for windows

_______________________________________________
Help-gnucap mailing list
Help-gnucap@...
https://lists.gnu.org/mailman/listinfo/help-gnucap