Atro Tossavainen
2009-Apr-20 11:54 UTC
[Rd] Problems building R 2.9.0... on SGI and Sun once again
I've successfully built R 2.9.0 on Linux (amd64, i386 and ppc), but am having a bit of trouble with legacy boxen. What should have gone into the variable that is empty at the time it is used in "for f in $SOMETHING" and why does it end up being empty? Solaris 8 with Sun Studio 11 compilers: building package 'methods' gmake[4]: Entering directory `/scratch/atossava/R-2.9.0/src/library/methods' all.R is unchanged /bin/bash: -c: line 1: syntax error near unexpected token `;' /bin/bash: -c: line 1: `for f in ; do if test -f ./${f}; then ../../../tools/install-sh -c -m 644 ./${f} ../../../library/methods; fi; done' gmake[4]: *** [front] Error 2 gmake[4]: Leaving directory `/scratch/atossava/R-2.9.0/src/library/methods' IRIX 6.5 with MIPSpro 7.4.4 compilers: building package 'methods' gmake[4]: Entering directory `/wrk/atossava/R-2.9.0/src/library/methods' all.R is unchanged /bin/sh: syntax error at line 1 : `;' unexpected gmake[4]: *** [front] Error 2 gmake[4]: Leaving directory `/wrk/atossava/R-2.9.0/src/library/methods' -- Atro Tossavainen (Mr.) / The Institute of Biotechnology at Systems Analyst, Techno-Amish & / the University of Helsinki, Finland, +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own. < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS
Darin A. England
2009-Apr-23 15:54 UTC
[Rd] Problems building R 2.9.0... on SGI and Sun once again
I have the same problem trying build R 2.9.0 on AIX using the IBM Visual Age compilers and GNU make. I'm trying to figure it out, but any hints on a fix are greatly appreciated. Thanks, Darin gmake[2]: Entering directory `/home/denglan/R/builddir/src/library/methods' building package 'methods' mkdir ../../../library/methods gmake[3]: Entering directory `/home/denglan/R/builddir/src/library/methods' mkdir ../../../library/methods/R /bin/sh: syntax error at line 1 : `;' unexpected gmake[3]: *** [front] Error 2 gmake[3]: Leaving directory `/home/denglan/R/builddir/src/library/methods' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/home/denglan/R/builddir/src/library/methods' gmake[1]: *** [R] Error 1 gmake[1]: Leaving directory `/home/denglan/R/builddir/src/library' gmake: *** [R] Error 1 make: The error code from the last command is 1. On Mon, Apr 20, 2009 at 02:54:58PM +0300, Atro Tossavainen wrote:> I've successfully built R 2.9.0 on Linux (amd64, i386 and ppc), but am > having a bit of trouble with legacy boxen. What should have gone into > the variable that is empty at the time it is used in "for f in $SOMETHING" > and why does it end up being empty? > > Solaris 8 with Sun Studio 11 compilers: > > building package 'methods' > gmake[4]: Entering directory `/scratch/atossava/R-2.9.0/src/library/methods' > all.R is unchanged > /bin/bash: -c: line 1: syntax error near unexpected token `;' > /bin/bash: -c: line 1: `for f in ; do if test -f ./${f}; then ../../../tools/install-sh -c -m 644 ./${f} ../../../library/methods; fi; done' > gmake[4]: *** [front] Error 2 > gmake[4]: Leaving directory `/scratch/atossava/R-2.9.0/src/library/methods' > > IRIX 6.5 with MIPSpro 7.4.4 compilers: > > building package 'methods' > gmake[4]: Entering directory `/wrk/atossava/R-2.9.0/src/library/methods' > all.R is unchanged > /bin/sh: syntax error at line 1 : `;' unexpected > gmake[4]: *** [front] Error 2 > gmake[4]: Leaving directory `/wrk/atossava/R-2.9.0/src/library/methods' > > -- > Atro Tossavainen (Mr.) / The Institute of Biotechnology at > Systems Analyst, Techno-Amish & / the University of Helsinki, Finland, > +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own. > < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Atro Tossavainen
2009-Apr-29 09:55 UTC
[Rd] Problems building R 2.9.0... on SGI and Sun once again
(This is really in response to Peter Dalgaard, not to myself)> This seems to come from constructions of the form > > for i in $FOO : do .... ; done > > If $FOO is empty, then the resulting "for i in ;" is a syntax error > with some versions of bash and sh.Given that one should generally be writing scripts for the Bourne shell, it is IMHO the case that "for i in ;" is a syntax error, period.> Current Linux versions of bash do not have that behaviour....violating Bourne shell compatibility in yet another way...> One workaround could be to upgrade bash.If R is to be an application that is not specific to (recent distributions of) Linux, one should expect and code for systems that may not have bash at all but only the Bourne shell.> Another workaround could be to safeguard the for-loop with > > test "$FOO" != "" && for i in $FOO : do .... ; done > > in all of the Makefiles where this can be an issue.That is one of the possible ways in which R developers could, I suppose, address the issue. -- Atro Tossavainen (Mr.) / The Institute of Biotechnology at Systems Analyst, Techno-Amish & / the University of Helsinki, Finland, +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own. < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS
Simon Urbanek
2009-Apr-29 13:36 UTC
[Rd] Problems building R 2.9.0... on SGI and Sun once again
On Apr 29, 2009, at 5:55 , Atro Tossavainen wrote:> (This is really in response to Peter Dalgaard, not to myself) > >> This seems to come from constructions of the form >> >> for i in $FOO : do .... ; done >> >> If $FOO is empty, then the resulting "for i in ;" is a syntax error >> with some versions of bash and sh. > > Given that one should generally be writing scripts for the Bourne > shell, it is IMHO the case that "for i in ;" is a syntax error, > period. > >> Current Linux versions of bash do not have that behaviour. > > ...violating Bourne shell compatibility in yet another way... > >> One workaround could be to upgrade bash. > > If R is to be an application that is not specific to (recent > distributions > of) Linux, one should expect and code for systems that may not have > bash > at all but only the Bourne shell. > >> Another workaround could be to safeguard the for-loop with >> >> test "$FOO" != "" && for i in $FOO : do .... ; done >> >> in all of the Makefiles where this can be an issue. > > That is one of the possible ways in which R developers could, I > suppose, address the issue. >You could check, I suppose, that it has been addressed in a similar way ;). Cheers, Simon