public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* posix vs. win32 paths (segfault vs. gdb)
@ 2015-12-09 18:53 Martin Landa
  2015-12-10 22:58 ` Warren Young
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Landa @ 2015-12-09 18:53 UTC (permalink / raw)
  To: cygwin

Hi all,

I am new to cygwin, so sorry for probably silly questions. I am trying
to compile GRASS GIS program on cygwin using *mingw32-w64* toolchain.
I am able to compile GRASS libs and tools. Part of build process is
calling compiled GRASS tools to produce their manual pages. The
critical part of build system (which is based on GNU make) looks like:

if [ "/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin/db.columns.exe"
!= "" ] ; then GISRC=/home/landa/grass_trunk/dist.x86_64-w64-mingw32/demolocation/.grassrc71
GISBASE=/dist.x86_64-w64-mingw32
PATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/scripts:$PATH"
PYTHONPATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/etc/python;/home/landa/grass_trunk/dist.x86_64-w64-mingw32/gui/wxpython;$PYTHONPATH"
PATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/scripts:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/lib:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/lib:./:/usr/bin/:/usr/local/bin::/cygdrive/c/OSGeo4W64/bin:/home/landa/grass_trunk/mswindows/osgeo4w"
LC_ALL=C /home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin/db.columns.exe
--html-description < /dev/null | grep -v '</body>\|</html>' >
db.columns.tmp.html ; fi
../../include/Make/Html.make:14: target „db.columns.tmp.html“ failed
make[4]: *** [db.columns.tmp.html] Error 1

First of all tried to launch this command from terminal:

GISRC=/home/landa/grass_trunk/dist.x86_64-w64-mingw32/demolocation/.grassrc71 \
GISBASE=/dist.x86_64-w64-mingw32 \
PATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/scripts:$PATH"
\
PYTHONPATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/etc/python;/home/landa/grass_trunk/dist.x86_64-w64-mingw32/gui/wxpython;$PYTHONPATH"
\
PATH="/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/scripts:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/lib:/home/landa/grass_trunk/dist.x86_64-w64-mingw32/lib:./:/usr/bin/:/usr/local/bin::/cygdrive/c/OSGeo4W64/bin:/home/landa/grass_trunk/mswindows/osgeo4w"
LC_ALL=C \
/home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin/db.columns.exe
--html-description

and it failed with Segmentation fault.

Then I tried to launch it via gdb (so I changed last line to `gdb
--args /home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin/db.columns.exe
--html-description` and type `run`:

* program started (no segfault)
* it failed to open file on disc which exist and is readable
* if I change path to this file from posix to win32 then the program
run successfully without any error and produce desired output.

I spent several hours on this issue and starting to be lost. I will
appreciate any help, thanks in advance for any kind of support! Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: posix vs. win32 paths (segfault vs. gdb)
  2015-12-09 18:53 posix vs. win32 paths (segfault vs. gdb) Martin Landa
@ 2015-12-10 22:58 ` Warren Young
  2015-12-14 15:56   ` Martin Landa
  0 siblings, 1 reply; 3+ messages in thread
From: Warren Young @ 2015-12-10 22:58 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Dec 9, 2015, at 11:53 AM, Martin Landa <landa.martin@gmail.com> wrote:
> 
> I am trying
> to compile GRASS GIS program on cygwin using *mingw32-w64* toolchain.

MinGW isn’t really on topic here.  Although these are Cygwin packages, build problems using them are typically not Cygwin problems.

Cygwin GNU make and MinGW GNU make behave quite differently, even though they’re built from the same source code.  The two key differences are that MinGW make uses cmd.exe for shell commands instead of /bin/sh, and that MinGW make can’t understand Cygwin’s POSIX paths.

Consequently, a package that supports building under both Cygwin and MinGW must have two different build systems.  The makefiles must differ.

GIS is a pretty specialized field, and GRASS is huge, so you’ll be lucky if anyone on the list has even tried what you’re proposing.  (Which is why I’m bothering to respond in the first place, even though I am not a GRASS user, and the closest I’ve gotten to GIS is the “ooo, maps” level of spectator appreciation.)

> First of all tried to launch this command from terminal:

Good, you’ve already tried the first thing I thought of asking.

Not everyone would even recognize that monstrosity as a single command, much less know enough to try and run it to see what happens.  Good job.

> and it failed with Segmentation fault.
> 
> Then I tried to launch it via gdb (so I changed last line to `gdb
> --args /home/landa/grass_trunk/dist.x86_64-w64-mingw32/bin/db.columns.exe
> --html-description` and type `run`:

You should prefix “gdb” with the PATH and LC_ALL environment overrides to fully match what GNU make is doing.

I don’t know if it matters, but let’s not introduce unnecessary variables.

> if I change path to this file from posix to win32 then the program
> run successfully without any error and produce desired output.

That sounds like the GRASS build process detected a POSIX-like environment, so it assumed that the resulting executables would also understand POSIX paths, which they won’t if built by MinGW GCC.

That means that either GRASS requires a POSIX environment, or it has a separate build process for MinGW, which you aren’t using by building under Cygwin.

Have you read this?

  https://trac.osgeo.org/grass/wiki/CompileOnWindows
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: posix vs. win32 paths (segfault vs. gdb)
  2015-12-10 22:58 ` Warren Young
@ 2015-12-14 15:56   ` Martin Landa
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Landa @ 2015-12-14 15:56 UTC (permalink / raw)
  To: cygwin

Hi,

2015-12-10 23:58 GMT+01:00 Warren Young <wyml@etr-usa.com>:

first of all thanks for the feedback!

> Have you read this?
>
>   https://trac.osgeo.org/grass/wiki/CompileOnWindows

Yes, some parts of this page has been written by me some years ago:-)
Now I came back to establish 64bit workflow. After some playing with
Cygwin I end up with MSYS2 which solved most of my problems.

Best regards, Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-14 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 18:53 posix vs. win32 paths (segfault vs. gdb) Martin Landa
2015-12-10 22:58 ` Warren Young
2015-12-14 15:56   ` Martin Landa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).