[GRASS-dev] compiling GRASS 6.3.0RC2 on Solaris 10

Hi,
i finally managed to compile and install GRASS 6.3.0RC2 on Solaris 10
Sparc.

I installed the packages from www.sunfreeware.com for the gnu tools
(tar, gcc etc.). I can mail a list of the packages if needed.

I had to compile gdal, as there is no solaris pkg. There is no pkg for
fftw2, so this had to be compiled too.

I found the following problems:

- fftw has to be compiled/installed with ./configure --with-pic
--enable-shared or the grass libraries are not built.

- make has to be used with "make SHELL=/bin/bash" or the scripts are not
executed (there are still many "bash'isms" in the scripts!).

- ./configure needs to be executed with:
./configure --with-srcdir=$(pwd) or
$(pwd)/configure
or it does not work.

- i had to manually edit include/make/Platform.make
to change CURSES = -lncurses $(COMPATLIB) to
CURSES = -lcurses $(COMPATLIB).
Problem on solaris 10 is, that ncurses is installed in /usr/local, but
the header file is in /usr/local/include/ncurses/ncurses.h
configure detects ncurses, but the link phase does not work, as
initscr32 from system curses library is needed.
Maybe ln -s /usr/local/include/ncurses/ncurses.h
/usr/local/include/ncurses.h works too.

- the scripts in tools directory are not working on solaris, as /bin/sh
is a standard unix shell, no bash as on linux. So i had to edit all to
#!/bin/bash . I think that the configure/make mechanism has to be
changed, so that bash is used (then bash has to be a prerequisite) or
the scripts should be edited to contain no bash-specific code.

- all the startup scripts use "#!/bin/sh", but use bash-specific code.
So with default installation, grass can not be started. I had to edit
all to
"#!/bin/bash". On Solaris 10 /bin/sh is a symlink to /sbin/sh, but i am
not shure if it is wise to change to /bin/bash, as the system may not
start in case of problems.

GIS Manager, nviz and the modules i tested worked.

But the help system needs konquerer, which is not present on Solaris.
exporting GRASS_HELP_BROWSER=firefox works.
Suggestion: add another line in Init.sh to detect "firefox".

The option "Help->About System" starts another instance of the gis
manager.

Compiling on Solaris 10 i86/i64 has other problems (e. g. libGLU missing
on Solaris/Intel). I'll try this in the next days.

Where is the correct place to add the information about compiling on
solaris (grass wiki or other?)?
I hope i can add the text later.

Andreas

--
Andreas Lange

Andreas Lange wrote:

i finally managed to compile and install GRASS 6.3.0RC2 on Solaris 10
Sparc.

I installed the packages from www.sunfreeware.com for the gnu tools
(tar, gcc etc.). I can mail a list of the packages if needed.

yes please.

I found the following problems:

...

- make has to be used with "make SHELL=/bin/bash" or the scripts are not
executed (there are still many "bash'isms" in the scripts!).

...

- the scripts in tools directory are not working on solaris, as /bin/sh
is a standard unix shell, no bash as on linux. So i had to edit all to
#!/bin/bash . I think that the configure/make mechanism has to be
changed, so that bash is used (then bash has to be a prerequisite) or
the scripts should be edited to contain no bash-specific code.

- all the startup scripts use "#!/bin/sh", but use bash-specific code.
So with default installation, grass can not be started. I had to edit
all to "#!/bin/bash".

Please report all bashisms you find. (specifically what breaks & where)
Most bashisms should be removed already due to newer Ubuntus using dash as
/bin/sh -- there shouldn't be many left.

But the help system needs konquerer, which is not present on Solaris.
exporting GRASS_HELP_BROWSER=firefox works.
Suggestion: add another line in Init.sh to detect "firefox".

You are right, the test is for mozilla-firefox not firefox. It only defaults to
konq if no other browser was found. Init.sh does this:
...
        if [ -f "$i/htmlview" ] ; then
            GRASS_HTML_BROWSER=htmlview
            break
        elif [ -f "$i/konqueror" ] ; then
            GRASS_HTML_BROWSER=konqueror
            break
        elif [ -f "$i/mozilla" ] ; then
            GRASS_HTML_BROWSER=mozilla
            break
        elif [ -f "$i/mozilla-firefox" ] ; then
            GRASS_HTML_BROWSER=mozilla-firefox
            break
        elif [ -f "$i/opera" ] ; then
            GRASS_HTML_BROWSER=opera
            break
        elif [ -f "$i/netscape" ] ; then
            GRASS_HTML_BROWSER=netscape
            break
        elif [ -f "$i/dillo" ] ; then
            GRASS_HTML_BROWSER=dillo
            break
        fi
...
if [ ! "$GRASS_HTML_BROWSER" ] ; then
    echo "WARNING: Searched for a web browser, but none found." 1>&2
    # even so we set konqueror to make lib/gis/parser.c happy:
    GRASS_HTML_BROWSER=konqueror
fi
export GRASS_HTML_BROWSER

The option "Help->About System" starts another instance of the gis
manager.

ISTR someone else had reported this recently?

Where is the correct place to add the information about compiling on
solaris (grass wiki or other?)?
I hope i can add the text later.

the wiki is a great place for it. we can link to it from the downloads page.

thanks,
Hamish

      ____________________________________________________________________________________
Be a better sports nut! Let your teams follow you
with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ

Andreas C. Lange wrote:

- ./configure needs to be executed with:
./configure --with-srcdir=$(pwd) or
$(pwd)/configure
or it does not work.

In what way does it not work? On Linux, I don't have any problems
using "./configure" without any --with-srcdir switch.

- i had to manually edit include/make/Platform.make
to change CURSES = -lncurses $(COMPATLIB) to
CURSES = -lcurses $(COMPATLIB).
Problem on solaris 10 is, that ncurses is installed in /usr/local, but
the header file is in /usr/local/include/ncurses/ncurses.h
configure detects ncurses, but the link phase does not work, as
initscr32 from system curses library is needed.
Maybe ln -s /usr/local/include/ncurses/ncurses.h
/usr/local/include/ncurses.h works too.

--with-includes=/usr/local/include/ncurses would probably suffice,
assuming that you want to use that version.

- the scripts in tools directory are not working on solaris, as /bin/sh
is a standard unix shell, no bash as on linux. So i had to edit all to
#!/bin/bash . I think that the configure/make mechanism has to be
changed, so that bash is used (then bash has to be a prerequisite) or
the scripts should be edited to contain no bash-specific code.

- all the startup scripts use "#!/bin/sh", but use bash-specific code.
So with default installation, grass can not be started. I had to edit
all to
"#!/bin/bash". On Solaris 10 /bin/sh is a symlink to /sbin/sh, but i am
not shure if it is wise to change to /bin/bash, as the system may not
start in case of problems.

Can you describe the specific problems?

Although there are some bash-isms, I don't believe that they are
nearly as widespread as you suggest.

--
Glynn Clements <glynn@gclements.plus.com>

Hi,

yes, this issue affects Gentoo Linux too. Someone has broken this feature.

Maris.

2007/11/25, Hamish <hamish_nospam@yahoo.com>:

> The option "Help->About System" starts another instance of the gis
> manager.

ISTR someone else had reported this recently?

> > The option "Help->About System" starts another instance of the gis
> > manager.

Hamish:

> ISTR someone else had reported this recently?

Maris Nartiss wrote:

yes, this issue affects Gentoo Linux too. Someone has broken this feature.

gui/tcltk/gis.m/gmmenu.tcl has:
{command {[G_msg "About &System"]}
   {} {[G_msg "About System"]} {} -command {
   exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}

and tksys.tcl starts with:
#!/bin/sh
# the next line restarts using wish \
exec $GRASS_WISH "$0" "$@"

perhaps it is wish running twice, or the $0 is finding gis.m? the extension
being .tcl when it starts with #!/bin/sh doesn't look good either.

?
Hamish

      ____________________________________________________________________________________
Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/

Hi,
maybe disabling this would be the best solution. I could'nt find the
problem. The culprit is that tksys.tcl grabs the main window (.), but it
seems to me that it is not started as a new instance of wish, but
inherits the windows from gis.m.

Andreas

Hamish wrote:

> > > The option "Help->About System" starts another instance of the gis
> > > manager.
Hamish:
> > ISTR someone else had reported this recently?
Maris Nartiss wrote:
> yes, this issue affects Gentoo Linux too. Someone has broken this feature.

gui/tcltk/gis.m/gmmenu.tcl has:
{command {[G_msg "About &System"]}
   {} {[G_msg "About System"]} {} -command {
   exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}

and tksys.tcl starts with:
#!/bin/sh
# the next line restarts using wish \
exec $GRASS_WISH "$0" "$@"

perhaps it is wish running twice, or the $0 is finding gis.m? the extension
being .tcl when it starts with #!/bin/sh doesn't look good either.

--
Andreas Lange

Hi Glynn,

many thanks for your answers.

Glynn Clements wrote:

Andreas C. Lange wrote:

> - ./configure needs to be executed with:
> ./configure --with-srcdir=$(pwd) or
> $(pwd)/configure
> or it does not work.

In what way does it not work? On Linux, I don't have any problems
using "./configure" without any --with-srcdir switch.

It works without absolute directory, i tried. I was wrong about that.

> - i had to manually edit include/make/Platform.make
> to change CURSES = -lncurses $(COMPATLIB) to
> CURSES = -lcurses $(COMPATLIB).
> Problem on solaris 10 is, that ncurses is installed in /usr/local, but
> the header file is in /usr/local/include/ncurses/ncurses.h
> configure detects ncurses, but the link phase does not work, as
> initscr32 from system curses library is needed.
> Maybe ln -s /usr/local/include/ncurses/ncurses.h
> /usr/local/include/ncurses.h works too.

--with-includes=/usr/local/include/ncurses would probably suffice,
assuming that you want to use that version.

this works too.

> - the scripts in tools directory are not working on solaris, as /bin/sh
> is a standard unix shell, no bash as on linux. So i had to edit all to
> #!/bin/bash . I think that the configure/make mechanism has to be
> changed, so that bash is used (then bash has to be a prerequisite) or
> the scripts should be edited to contain no bash-specific code.
>
> - all the startup scripts use "#!/bin/sh", but use bash-specific code.
> So with default installation, grass can not be started. I had to edit
> all to
> "#!/bin/bash". On Solaris 10 /bin/sh is a symlink to /sbin/sh, but i am
> not shure if it is wise to change to /bin/bash, as the system may not
> start in case of problems.

I can now narrow down the problems to:
tools/mkhtml.sh
tools/module_synopsis.sh

Changing all occurences of "if ! test ..." to "if [ ! test ... ]" it
works now.

I confused the error messages from shell with the curses/ncurses
problem.

I found further problems:
liblibr_li.so should be named: libr_li.so.
r.sim.water and r.sim.sediment do not work (ldd gives: signal 9).

Andreas

--
Andreas Lange

Andreas C. Lange wrote on 11/26/2007 04:26 PM:

I found further problems:
liblibr_li.so should be named: libr_li.so.
  

I have fixed the name to 'libgrass_rli.so'. In all r.li Makefiles,
I changed:

-LIB_NAME = libr_li
+LIB_NAME = grass_rli

Markus

Andreas C. Lange wrote:

> > - the scripts in tools directory are not working on solaris, as /bin/sh
> > is a standard unix shell, no bash as on linux. So i had to edit all to
> > #!/bin/bash . I think that the configure/make mechanism has to be
> > changed, so that bash is used (then bash has to be a prerequisite) or
> > the scripts should be edited to contain no bash-specific code.
> >
> > - all the startup scripts use "#!/bin/sh", but use bash-specific code.
> > So with default installation, grass can not be started. I had to edit
> > all to
> > "#!/bin/bash". On Solaris 10 /bin/sh is a symlink to /sbin/sh, but i am
> > not shure if it is wise to change to /bin/bash, as the system may not
> > start in case of problems.
>

I can now narrow down the problems to:
tools/mkhtml.sh
tools/module_synopsis.sh

Changing all occurences of "if ! test ..." to "if [ ! test ... ]" it
works now.

The latter is incorrect; it should just be "if [ ! ... ]", without the
"test".

"[" is just an alias for "test", except that it requires a matching "]".

Does Solaris' shell have "test" built in, or is it supposed to be an
external program? Bash has test and [ built in, but most Linux systems
also have them as external programs (from the GNU coreutils package).

--
Glynn Clements <glynn@gclements.plus.com>

Hamish wrote:

> > > The option "Help->About System" starts another instance of the gis
> > > manager.
Hamish:
> > ISTR someone else had reported this recently?
Maris Nartiss wrote:
> yes, this issue affects Gentoo Linux too. Someone has broken this feature.

gui/tcltk/gis.m/gmmenu.tcl has:
{command {[G_msg "About &System"]}
   {} {[G_msg "About System"]} {} -command {
   exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}

and tksys.tcl starts with:
#!/bin/sh
# the next line restarts using wish \
exec $GRASS_WISH "$0" "$@"

perhaps it is wish running twice, or the $0 is finding gis.m? the extension
being .tcl when it starts with #!/bin/sh doesn't look good either.

The problem is that tksys.tcl has:

  source $env(GISBASE)/etc/gm/gm.tcl

--
Glynn Clements <glynn@gclements.plus.com>