From: Sparapani, R. <rsp...@mc...> - 2007-09-18 14:44:19
|
> findUnixBinary(x=3D"wine") env WINE=20 "/Applications/Darwine/Wine.bundle/Contents/bin/wine"=20 > findUnixBinary(x=3D"winepath") env WINEPATH=20 "/Applications/Darwine/Wine.bundle/Contents/bin/winepath"=20 > .Platform$OS.type [1] "unix" >=20 I'm just going to elaborate on /Applications... GUI (Cocoa/Carbon) apps must be in the /Applications tree or a bad = things happen=20 (an exception is made for /Developer, but most people don't use/know = about that). =20 For any other apps, like command-line tools or X11, Mac OS X doesn't = care where you put them and it doesn't matter. Command-line tools are generally in /usr/local = unless they come with a GUI app which means that they are in a bundle like = wine/winepath. So, there is no standard place for DarWINE, but most likely it will be found = in /Applications. That's the directory that has the correct permissions for installing = system-wide apps and where everything else is going to be put by habit. Similarly, when = you install WinBUGS it tries to place it on your C: drive. However, if you do that, = then no one else will be able to use it. So, you choose z:\Applications\WinBUGS14. Rodney -----Original Message----- From: Gregor Gorjanc [mailto:gre...@bf...] Sent: Tue 9/18/2007 6:18 AM To: Sparapani, Rodney Cc: bug...@li... Subject: MacOS and wine and bugs.directory arguments (was: Recent = changes) =20 Hi! Sparapani, Rodney wrote: >>> Sys.setenv(DISPLAY=3D":0.0") >>> schools.sim <- bugs (data=3Ddata, >> + inits=3Dinits, >> + parameters.to.save=3Dparameters, >> + model.file=3D"schools.txt", >> + n.chains=3D3, >> + n.iter=3D1000, >> + bugs.directory=3D"/Applications/WinBUGS14", >> + debug=3DFALSE) >> > Doesn't work: >=20 > sh: line 1: no: command not found ... > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, = na.strings, : > scan() expected 'a real', got 'WinBUGS' WINE and WINEPATH arguments can be NULL and findUnixBinary() in=20 R/wineutils tries to find corresponding binaries. Can you copy the=20 following (slightly modified findUnixBinary()) into your R. I would like = to know which command has not been found on mac, is it either which or=20 locate. findUnixBinary <- function(x) { ## --- Environmental variable --- cat("env\n") tmp <- Sys.getenv(toupper(x)) if(nchar(tmp) !=3D 0) return(tmp) ## else ## --- Standard place --- cat("/usr/bin\n") tmp <- paste("/usr/bin", x, sep=3D"") if(file.exists(tmp)) return(tmp) ## else ... ## --- Which --- cat("which\n") tmp <- system(paste("which ", x, sep=3D""), intern=3DTRUE) if(length(tmp) !=3D 0) return(tmp) ## else .. ## --- Locate --- cat("locate\n") tmp <- system(paste("locate ", x, " | grep bin/", x, "$", sep=3D""),=20 intern=3DTRUE) tmp <- tmp[length(tmp)] ## keep only last hit if(length(tmp) > 0) return(tmp) stop(paste("couldn't find", x, "binary file")) } findUnixBinary(x=3D"wine") findUnixBinary(x=3D"winepath") > And you are correct. /Applications is the standard place to install = GUI applications > such as R. Command-line only applications can be installed anywhere. How do you install WinBUGS on Mac? Do you choose /Aplications folder or = ... I just want to be sure that /Applications is a safe default as=20 C:\Program Files is on MS Windows. Additionally, how can we know if R is running on Mac? I guess that .Platform$OS.type has value "unix" as for Linux/Unix. --=20 Lep pozdrav / With regards, Gregor Gorjanc ---------------------------------------------------------------------- University of Ljubljana PhD student Biotechnical Faculty www: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department blog: http://ggorjan.blogspot.com Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe tel: +386 (0)1 72 17 861 ---------------------------------------------------------------------- |