[GRASS-user] Configuring GRASS source code for compilation under Ubuntu 7.10 -- CFLAGS and LDFLAGS parameters no more necessary (?)

I just downloaded GRASS with:

$ sudo svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk

I try to compile (under Ubuntu 7.10) as I did in the past with:

$ sudo CFLAGS="-g -Wall" LDFLAGS="-s" ./configure --with-cxx
--with-freetype=yes --with-ffmpeg=yes --with-postgres=no
--with-sqlite=yes --enable-largefile=yes
--with-tcltk-includes=/usr/include/tcl8.4
--with-freetype-includes=/usr/include/freetype2
--with-ffmpeg-includes=/usr/include/ffmpeg
--with-opengl-libs=/usr/include/GL --with-readline

but I get:

"sudo: CFLAGS=-g -Wall: command not found"

and an error as well for "LDFLAGS="-s" (in case I remove CFLAGS)

These "configure-parameters" are in the script makegrass.sh
http://david.p.finlayson.googlepages.com/makegrass.sh

found in
http://grass.gdf-hannover.de/wiki/Compile_and_Install#Ubuntu_6.06.2C_7.10

After removing these parameters the configuration worked fine (with the
exception of errors about missing documentation).
---

If these parameters do not work anymore should I update the script file?

--
Nikos Alexandris
.
Department of Remote Sensing & Landscape Information Systems
Faculty of Forestry & Environmental Sciences, Albert-Ludwigs-University Freiburg
.
Tel. +49 (0) 761 203 3697 / Fax. +49 (0) 761 203 3701 / Skype: Nikos.Alexandris
.
Address: Tennenbacher str. 4, D-79106 Freiburg i. Br., Germany

On 02/01/08 10:06, Nikos Alexandris wrote:

I just downloaded GRASS with:

$ sudo svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk

I try to compile (under Ubuntu 7.10) as I did in the past with:

$ sudo CFLAGS="-g -Wall" LDFLAGS="-s" ./configure --with-cxx
--with-freetype=yes --with-ffmpeg=yes --with-postgres=no
--with-sqlite=yes --enable-largefile=yes
--with-tcltk-includes=/usr/include/tcl8.4
--with-freetype-includes=/usr/include/freetype2
--with-ffmpeg-includes=/usr/include/ffmpeg
--with-opengl-libs=/usr/include/GL --with-readline

but I get:

"sudo: CFLAGS=-g -Wall: command not found"

sudo takes the first argument as the command to execute. If you want to include several commands (CFLAGS= is one, LDFLAGS= another and configure the third), put them into a script file.

But why do you want to compile as sudo ? This is generally considered unsafe. You should only use sudo for 'make install'.

Or use the debian (and thus Ubuntu) way: dpkg-buildpackage.

Moritz

Yes correct.

I did recently a new clean install of almost everything on my machine.
The same with GRASS and I forgot to add the proper rights in
GRASS-source folder and files.

So I was getting an error and I thought trying with sudo will do the
work... which is of course wrong.

Thank you!

On Wed, 2008-01-02 at 11:46 +0100, Moritz Lennert wrote:

On 02/01/08 10:06, Nikos Alexandris wrote:
> I just downloaded GRASS with:
>
> $ sudo svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk
>
> I try to compile (under Ubuntu 7.10) as I did in the past with:
>
> $ sudo CFLAGS="-g -Wall" LDFLAGS="-s" ./configure --with-cxx
> --with-freetype=yes --with-ffmpeg=yes --with-postgres=no
> --with-sqlite=yes --enable-largefile=yes
> --with-tcltk-includes=/usr/include/tcl8.4
> --with-freetype-includes=/usr/include/freetype2
> --with-ffmpeg-includes=/usr/include/ffmpeg
> --with-opengl-libs=/usr/include/GL --with-readline
>
>
> but I get:
>
> "sudo: CFLAGS=-g -Wall: command not found"

sudo takes the first argument as the command to execute. If you want to
include several commands (CFLAGS= is one, LDFLAGS= another and configure
the third), put them into a script file.

But why do you want to compile as sudo ? This is generally considered
unsafe. You should only use sudo for 'make install'.

Or use the debian (and thus Ubuntu) way: dpkg-buildpackage.

Moritz

--
Nikos Alexandris
.
Department of Remote Sensing & Landscape Information Systems
Faculty of Forestry & Environmental Sciences, Albert-Ludwigs-University Freiburg
.
Tel. +49 (0) 761 203 3697 / Fax. +49 (0) 761 203 3701 / Skype: Nikos.Alexandris
.
Address: Tennenbacher str. 4, D-79106 Freiburg i. Br., Germany

Nikos Alexandris wrote:

I just downloaded GRASS with:

$ sudo svn checkout https://svn.osgeo.org/grass/grass/trunk grass_trunk

I try to compile (under Ubuntu 7.10) as I did in the past with:

$ sudo CFLAGS="-g -Wall" LDFLAGS="-s" ./configure --with-cxx
--with-freetype=yes --with-ffmpeg=yes --with-postgres=no
--with-sqlite=yes --enable-largefile=yes
--with-tcltk-includes=/usr/include/tcl8.4
--with-freetype-includes=/usr/include/freetype2
--with-ffmpeg-includes=/usr/include/ffmpeg
--with-opengl-libs=/usr/include/GL --with-readline

but I get:

"sudo: CFLAGS=-g -Wall: command not found"

You would need to invoke the shell explicitly, e.g.

  sudo sh -c 'CFLAGS="-g -Wall" LDFLAGS="-s" ./configure ...'

To avoid dealing with quoting issues, you could store the command as a
script, then use e.g.:

  sudo sh script.sh

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