Send grass-windows mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/grass-windows
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of grass-windows digest..."
Today's Topics:
1. Compile r.example for GRASS6.4 in Windows (Ant?nio Rocha)
2. Re: Compile r.example for GRASS6.4 in Windows (Glynn Clements)
----------------------------------------------------------------------
Message: 1
Date: Wed, 18 Nov 2009 14:03:17 +0000
From: Ant?nio Rocha <[email protected]>
Subject: [GRASS-windows] Compile r.example for GRASS6.4 in Windows
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Greetings all
First of all let me thank Glynn and Markus for helping me on this. This
is breaking my head...
1- First I installed GRASS6.4 binaries in C:/grass6
2- I used this website to install msys and libraries in order to compile
C functions, just like r.example.
http://trac.osgeo.org/grass/wiki/CompileOnWindows
OSGEO4w was installed in c:/osgeo4w
3- I place r.example folder in code in C:/grass6/tests/r.example
4- So far, so good. Using msys I decided to compile using make file.
After a few try outs, Glynnn told me to use this expression:
make -C c:/grass6/tests/r.example MODULE_TOPDIR=c:/grass6
and I got a few errors. Glynn also told me to change a few variables at
c:/grass6/include/make
Those were:
- At platform.make now it's:
GRASS_HOME = /c/grass6
RUN_GISBASE = c:/grass6
RUN_GISBASE = c:/grass6
- At platform.make I left ARCH empty:
- At grass.make now they are written in msys style:
ARCH_DISTDIR = /c/grass6
ARCH_BINDIR = /c/grass6/bin
ERRORLOG = /c/grass6
5- Then I was getting this error, with a few other small
*** No rule to make target `/c/grass6/lib/libgrass_gis.dll', needed by
6- Markus suggested me to make a copy of libgrass_gis.6.4.0svn.dll with
the name libgrass_gis.dll.
7- And after this I got this error:
make: Entering directory `/c/grass6/tests/r.example'
c:/grass6/include/Make/Grass.make:418: warning: overriding commands for
target `/c/grass6/bin'
c:/grass6/include/Make/Grass.make:409: warning: ignoring old commands
for target `/c/grass6/bin'
test -d OBJ. || mkdir -p OBJ.
gcc -I/c/grass6/include -I/OSGeo4W/apps/gdal-16/include
-I/OSGeo4W/include -g -O2 -I/OSGeo4W/apps/gdal-16/include
-I/OSGeo4W/include -DPACKAGE=\""grassmods"\" -I/c/grass6/include -o
OBJ./main.o -c main.c
gcc -L/c/grass6/lib -Wl,--export-dynamic,--enable-runtime-pseudo-reloc
-L/OSGeo4W/apps/gdal-16/lib -L/OSGeo4W/lib -o
/c/grass6/bin/r.example.exe OBJ./main.o c:/grass6/lib/gis/OBJ./fmode.o
-lgrass_gis -lgrass_datetime -lxdr -liberty -lws2_32 -lz -lintl
-lxdr -liberty -lws2_32 -lz
gcc.exe: c:/grass6/lib/gis/OBJ./fmode.o: No such file or directory
make: *** [/c/grass6/bin/r.example.exe] Error 1
make: Leaving directory `/c/grass6/tests/r.example'
At C:/grass6/tests/r.example a new folder was created "OBJ " with the
file main.o.
Question? What else Should I do or what am I doing wrong?
After this; I promise I will submit my quest in GRASS Wiki :)
Thanks
Best Regards
Antonio ROcha
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4617 (20091118) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
------------------------------
Message: 2
Date: Wed, 18 Nov 2009 16:15:43 +0000
From: Glynn Clements <[email protected]>
Subject: Re: [GRASS-windows] Compile r.example for GRASS6.4 in Windows
To: Ant?nio Rocha <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
António Rocha wrote:
> ERRORLOG = /c/grass6
Note: this needs to refer to a file, not a directory. The default is
$(GRASS_HOME)/error.log.
> 5- Then I was getting this error, with a few other small
> *** No rule to make target `/c/grass6/lib/libgrass_gis.dll', needed by
>
> 6- Markus suggested me to make a copy of libgrass_gis.6.4.0svn.dll with
> the name libgrass_gis.dll.
Ah. On Unix, the libraries include the version number, and symlinks
are created without the version number. Windows doesn't have symlinks,
so MSys' "ln -s ..." simply copies the file. Presumably the OSGeo4W
installer omits the unversioned files to save space. This will prevent
you from being able to build modules against the libraries, so you
will need to manually make copies without the version number.
We need to come up with a solution for this. Options include:
1. Omitting the version number altogether on Windows.
2. Creating linker scripts[*] on Windows, in place of the symlinks.
3. Creating import libraries on Windows, in place of the symlinks.
4. Including both versioned and unversioned DLLs in the Windows installer.
5. Including the version number in the -l switch.
[*] I don't know whether MinGW actually supports linker scripts.
> 7- And after this I got this error:
> gcc.exe: c:/grass6/lib/gis/OBJ./fmode.o: No such file or directory
Does fmode.o exist anywhere in c:/grass6?
If it does, you can override the location with e.g.:
make ... FMODE_OBJ=/path/to/fmode.o
If it doesn't, you'll need to create it first. The source file
(fmode.c) is just:
#include <stdlib.h>
#include <fcntl.h>
#undef _fmode
int _fmode = _O_BINARY;
You can compile it with "gcc -c fmode.c".
In 7.0, the fmode.o file is created as $(GISBASE)/lib/fmode.o, so it
should be included in binary packages.
> make: *** [/c/grass6/bin/r.example.exe] Error 1
> make: Leaving directory `/c/grass6/tests/r.example'
>
> At C:/grass6/tests/r.example a new folder was created "OBJ " with the
> file main.o.
This indicates that the source code compiled but couldn't be linked.
> Question? What else Should I do or what am I doing wrong?
You aren't doing anything wrong here. Both of the above problems are a
result of the Windows binary packages for GRASS 6.x being incomplete.
Unfortunately, we don't have any "active" Windows developers.
Occasionally people will build Windows packages or run specific tests
on Windows, but the active developers are all using Linux or MacOSX as
their main platform.
Also, some of the things which cause problems on Windows (e.g. relying
upon shell scripts) can't easily be fixed in 6.x. In 7.0, we are less
worried about compatibility, so it's easier to change things.
In 6.x, building modules against an installed version of GRASS still
isn't ideal even on Unix, and most things are a bit more trouble on
Windows than they are on Unix.
--
Glynn Clements <[email protected]>
------------------------------
_______________________________________________
grass-windows mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-windows
End of grass-windows Digest, Vol 39, Issue 10
*********************************************