Dear all, R on Macports relies on GCC 4.3 to build packages. I find that packages with shared objects that use C++ streams crash R if they're compiled using Macports' gcc43, but work fine if compiled in exactly the same way using Apple-supplied GCC 4.2. Has anyone here had the same issue/know what is causing this problem? Thanks, Ernest
I found this in Writing R Extensions: "Using C++ iostreams, as in this example, is best avoided. There is no guarantee that the output will appear in the R console, and indeed it will not on the R for Windows console. Use R code or the C entry points (see Printing) for all I/O if at all possible." That is, use Rprintf() instead. The fact that your code works with one version of gcc and not another can probably be chalked up to coincidence. Kjell On Jul 30, 2008, at 3:45 PM, Ernest Turro wrote:> Dear all, > > R on Macports relies on GCC 4.3 to build packages. I find that > packages with shared objects that use C++ streams crash R if they're > compiled using Macports' gcc43, but work fine if compiled in exactly > the same way using Apple-supplied GCC 4.2. Has anyone here had the > same issue/know what is causing this problem? > > Thanks, > > Ernest > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
On Jul 30, 2008, at 9:45 , Ernest Turro wrote:> Dear all, > > R on Macports relies on GCC 4.3 to build packages. I find that > packages with shared objects that use C++ streams crash R if they're > compiled using Macports' gcc43, but work fine if compiled in exactly > the same way using Apple-supplied GCC 4.2. Has anyone here had the > same issue/know what is causing this problem? >Using compilers from MacPorts and similar suites (Darwin ports, Fink etc.) is strongly discouraged (and outright not supported by the CRAN binary) since they have been known to be badly broken in the past and when whenever tested so far they were incomplete and incompatible. You have to re-compile R yourself with those tools (and you're entirely on your own) if you really want to use them. CRAN binaries work only with Apple's gcc branches, if you want to use anything else, you have to follow the unix R instructions and compile everything from sources. Cheers, Simon