Re: [Rd] missing sh.exe file when running "R CMD INSTALL test" (PR#8068)

2005-08-20 Thread Duncan Murdoch
[EMAIL PROTECTED] wrote:
> I am trying to learn how to make a simple package that contains no C
> or Fortran code.  I used package.skeleton(...) to make a package
> called "test".  The directory and files look good.  I downloaded and
> installed Rtools (www.murdoch-sutherland.com/Rtools/tools.zip).  I
> added the path and from the dos prompt I can verify that make.exe and
> sh.exe both exist, but when I try to run "R CMD INSTALL test" I get an
> error "make: sh.exe: Command not found"  and "make: *** [pkg-test]
> Error 127".  I get the same error message if a try the command "make
> pkg-test".

You need to make sure the tools directory (wherever you put it) is on 
your path.  Type PATH at a command prompt to see the current path; type

PATH= blah blah blah

to set a new one.  See the R Admin manual for advice on what to put  in it.

Duncan Murdoch
> 
> I saw in an old FAQ a suggestion to move sh.eve to the C:\bin\ folder,
> but my C: root does not have a "bin" folder.  Nonetheless, I created
> one and put sh.exe there and it provided no help (I didn't expect it
> too).
> 
> Can anyone help me?
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Questions on "\" vs "/" on Windows

2005-08-20 Thread Seth Falcon
On 20 Aug 2005, [EMAIL PROTECTED] wrote:
> It _does_ dynamically read .Platform$file.sep, and it has an fsep
> argument so you can do
>
> file.path("foo", "bar", fsep="\\")
>
> Beware though of namespaces: you would need to change
> .Platform$file.sep in the base namespace (which you can do):
>
>> .Platform$file.sep <- ":"
>> assignInNamespace(".Platform", .Platform, "base")
>> file.path("foo", "bar")
> [1] "foo:bar"

That's the piece I was missing, thanks.

Clearly I misremembered other details as well.  Thanks for the
reminders.

+ seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Questions on "\" vs "/" on Windows

2005-08-20 Thread Prof Brian Ripley
On Sat, 20 Aug 2005, Seth Falcon wrote:

> A recent thread on R-help reminded me of some questions I have
> regarding the path separator on Windows.
>
> The thread: [R] using paste and "\" to create a valid filename
>
> The question:
>
> What are the use-cases where "\" is required for paths passed as
> character vectors from within R?

1) A few Windows utilities require \, so we try to always use \ in paths 
exported e.g. when using system()/shell().  No Windows API call does, it 
appears.

Uwe Ligges reported that on his system Mozilla 1.7.3 did in file:// URLs, 
(although it did not on mine) so we altered the HTML help print method

2) Some Windows users file bug reports when they see / in a path.  So to 
keep them happy (or at least out of our hair) we tend to use \ in 
messages, and in normalizePath().

> My experience has been that "/" always works and "\" often fails due
> to escaping issues (the user's fault).  A pathalogical example
> that I _have_ encountered due to temp file naming on Windows:
>
>  > badpath <- "foo\\2\\bar"
>  > root <- "c:\\HERE\\file.txt"
>  > gsub("HERE", badpath, root)
>  Error in gsub("HERE", badpath, root) : invalid backreference 2 in regular 
> expression
>
> Using file.path is recommended as a best practice, but AFAICT, it
> forces "\" on Windows.

Wrong (how did you 'T'?).  On Windows:

> file.path("foo", "bar")
[1] "foo/bar"

> Why not have file.path dynamically read .Platform$file.sep
> so that in code that uses file.path one could modify
> .Platform$file.sep and change the behavior of all subsequent file.path
> calls?

It _does_ dynamically read .Platform$file.sep, and it has an fsep argument 
so you can do

file.path("foo", "bar", fsep="\\")

Beware though of namespaces: you would need to change .Platform$file.sep 
in the base namespace (which you can do):

> .Platform$file.sep <- ":"
> assignInNamespace(".Platform", .Platform, "base")
> file.path("foo", "bar")
[1] "foo:bar"

> Python's os.path.join function behaves similarly to R's: changing
> os.sep doesn't change the behavior of os.path.join.
> .Platform$file.sep = "/" and change the behavior of all subsequent
> calls.
>
> With both languages, I've found that for glue-code type tasks,
> sticking to "/" on Windows is much easier and I've been frustrated by
> the built-in path handling function.

Why, as R's uses "/"?  I wonder if you did consult the help pages before 
posting 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Questions on "\" vs "/" on Windows

2005-08-20 Thread Gabor Grothendieck
On 8/20/05, Seth Falcon <[EMAIL PROTECTED]> wrote:
> A recent thread on R-help reminded me of some questions I have
> regarding the path separator on Windows.
> 
> The thread: [R] using paste and "\" to create a valid filename
> 
> The question:
> 
> What are the use-cases where "\" is required for paths passed as
> character vectors from within R?

I think Windows itself allows / but some programs require \.

> 
> My experience has been that "/" always works and "\" often fails due
> to escaping issues (the user's fault).  A pathalogical example
> that I _have_ encountered due to temp file naming on Windows:
> 
>  > badpath <- "foo\\2\\bar"
>  > root <- "c:\\HERE\\file.txt"
>  > gsub("HERE", badpath, root)
>  Error in gsub("HERE", badpath, root) : invalid backreference 2 in regular 
> expression
> 
> Using file.path is recommended as a best practice, but AFAICT, it
> forces "\" on Windows.

Actually it uses /. On my Windows XP system:

> file.path("a", "b")
[1] "a/b"
> R.version.string
[1] "R version 2.1.1, 2005-06-23"
 

> 
> Why not have file.path dynamically read .Platform$file.sep
> so that in code that uses file.path one could modify
> .Platform$file.sep and change the behavior of all subsequent file.path
> calls?
> 
> Python's os.path.join function behaves similarly to R's: changing
> os.sep doesn't change the behavior of os.path.join.
> .Platform$file.sep = "/" and change the behavior of all subsequent
> calls.
> 
> With both languages, I've found that for glue-code type tasks,
> sticking to "/" on Windows is much easier and I've been frustrated by
> the built-in path handling function.
> 
> + seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Different gcc versions

2005-08-20 Thread Dirk Eddelbuettel

Göran,

On 20 August 2005 at 13:54, Göran Broström wrote:
| I have both gcc-3.4 and gcc-4.0(.1) installed on my system 
| (debian-amd64 unstable), with links /usr/bin/gcc, g77, etc. to
| the 3.4 versions. When I build R, the 3.4 version is picked up, 
| which is fine.
| 
| However, when I 'install.packages("xyz")', R uses gcc-4.0 and
| gfortran-4.0! Should I accept this or do something about it?
| And if so, what? Of course, removing all 4.0 versions would 
| help, but what if I don't want to do that?

There are several way about it. 

The first would be to actually use one of Debian's packages -- unstable
currently uses gcc 4.0.1 / g77 3.4.*. That seems to work well. You'd get the
same released version for amd64 as well. I'd do that.

The second would be to continue building on your own, but to make sure the
generated Makeconf (which the Debian package copies into /etc/R/) has the
right settings.

Hope this helps, Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
 -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Questions on "\" vs "/" on Windows

2005-08-20 Thread Seth Falcon
A recent thread on R-help reminded me of some questions I have
regarding the path separator on Windows.

The thread: [R] using paste and "\" to create a valid filename

The question:

What are the use-cases where "\" is required for paths passed as
character vectors from within R?

My experience has been that "/" always works and "\" often fails due
to escaping issues (the user's fault).  A pathalogical example
that I _have_ encountered due to temp file naming on Windows:

  > badpath <- "foo\\2\\bar"
  > root <- "c:\\HERE\\file.txt"
  > gsub("HERE", badpath, root)
  Error in gsub("HERE", badpath, root) : invalid backreference 2 in regular 
expression

Using file.path is recommended as a best practice, but AFAICT, it
forces "\" on Windows.  

Why not have file.path dynamically read .Platform$file.sep
so that in code that uses file.path one could modify
.Platform$file.sep and change the behavior of all subsequent file.path
calls?

Python's os.path.join function behaves similarly to R's: changing
os.sep doesn't change the behavior of os.path.join.  
.Platform$file.sep = "/" and change the behavior of all subsequent
calls.

With both languages, I've found that for glue-code type tasks,
sticking to "/" on Windows is much easier and I've been frustrated by
the built-in path handling function.

+ seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Different gcc versions

2005-08-20 Thread Göran Broström
I have both gcc-3.4 and gcc-4.0(.1) installed on my system 
(debian-amd64 unstable), with links /usr/bin/gcc, g77, etc. to
the 3.4 versions. When I build R, the 3.4 version is picked up, 
which is fine.

However, when I 'install.packages("xyz")', R uses gcc-4.0 and
gfortran-4.0! Should I accept this or do something about it?
And if so, what? Of course, removing all 4.0 versions would 
help, but what if I don't want to do that?

 > version
 _
platform x86_64-unknown-linux-gnu
arch x86_64
os   linux-gnu
system   x86_64, linux-gnu
status
major2
minor1.1
year 2005
month06
day  20
language R
 
-- 
Göran Broströmtel: +46 90 786 5223
Department of Statistics  fax: +46 90 786 6614
Umeå University   http://www.stat.umu.se/~goran.brostrom/
SE-90187 Umeå, Sweden e-mail: [EMAIL PROTECTED]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel