[Rcppoctave-user] Apple Blues

Renaud Gaujoux renaud at mancala.cbio.uct.ac.za
Fri Nov 1 08:17:50 CET 2013


---------- Forwarded message ----------
From: Renaud Gaujoux <renaud at mancala.cbio.uct.ac.za>
Date: 31 October 2013 09:27
Subject: Re: Apple Blues
To: Dominick Samperi <djsamperi at gmail.com>


I find it strange that you have to modify Makefile.in. It should get R
locations and flags associated with the R binary you are using to build the
package, in this case the clang-compiled one.
Can you please send the install log, which shows the resolved LDFLAGS and
CPPFLAGS?


On 30 October 2013 18:04, Dominick Samperi <djsamperi at gmail.com> wrote:

> I built R using clang/clang++/gfortran-4.2(from Simon of R core) and
> installed Rcpp using the same tools, and
> there were no obvious problems.
>
> There was a problem with RcppOctave/src/modules/Makefile.in.
> I've attached my work-around.
>
> When I try to install RcppOctave with Octave 3.6.4
> I get the familiar issue:
>
> clang++ -arch x86_64 -std=c++11
> -I/Users/dsamperi/bin/R-clang/R.framework/Resources/include -DNDEBUG
> `"/Users/dsamperi/bin/R-clang/R.framework/Resources/bin/Rscript" -e
> "Rcpp:::CxxFlags()"` -DOCT_POST_3_4_0=1
> -I"/usr/local/Cellar/octave/3.6.4/include/octave-3.6.4/octave"
> -I"/usr/local/Cellar/octave/3.6.4/include/octave-3.6.4/octave/../"
> -I"/usr/local/Cellar/octave/3.6.4/include/octave-3.6.4/octave/octave"
> -I/usr/local/include
> -I"/Users/dsamperi/bin/R-clang/R.framework/Versions/3.0/Resources/library/Rcpp/include"
>   -fPIC  -g -O2  -c rcpp_octave.cpp -o rcpp_octave.o
> clang++ -arch x86_64 -std=c++11 -dynamiclib
> -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module
> -multiply_defined suppress -L/usr/local/lib -o RcppOctave.so conversion.o
> rcpp_octave.o
> /Users/dsamperi/bin/R-clang/R.framework/Versions/3.0/Resources/library/Rcpp/lib/libRcpp.a
> -L/usr/local/Cellar/octave/3.6.4/lib/octave/3.6.4
> -L/usr/local/Cellar/octave/3.6.4/lib -loctinterp -loctave -lcruft
> -F/Users/dsamperi/bin/R-clang/R.framework/.. -framework R -Wl,-framework
> -Wl,CoreFoundation
> installing to
> /Users/dsamperi/bin/R-clang/R.framework/Versions/3.0/Resources/library/RcppOctave/libs
> ** R
> ** demo
> ** inst
> ** preparing package for lazy loading
> ** help
> R(45582) malloc: *** error for object 0x1058257c0: pointer being freed was
> not allocated
> *** set a breakpoint in malloc_error_break to debug
> /Users/dsamperi/bin/R-clang/R.framework/Resources/bin/INSTALL: line 34:
> 45581 Done                    echo 'tools:::.install_packages()'
>      45582 Abort trap: 6           | R_DEFAULT_PACKAGES= LC_COLLATE=C
> "${R_HOME}/bin/R" $myArgs --slave --args ${args}
>
>
> On Wed, Oct 30, 2013 at 1:32 AM, Dominick Samperi <djsamperi at gmail.com>wrote:
>
>> A little more searching revealed that llvm-g++
>> and llvm-gcc are part of LLVM releases 2.9 and
>> earlier, see...
>> http://llvm.org/releases/download.html#3.3
>>
>> It seems like Mac OS X users of R will have to
>> use a specific toolchain for all apps that need to
>> link against each other, and this is especially true
>> for RcppOctave…
>>
>> And the easiest toolchain to use under Mac OS X is
>> the one specified by Apple! (Unfortunately this does
>> not solve the Fortran problem.)
>>
>>
>>
>> On Wed, Oct 30, 2013 at 1:11 AM, Dominick Samperi <djsamperi at gmail.com>wrote:
>>
>>> Hello Renaud,
>>>
>>> I just tried unsuccessfully to upgrade my Apple desktop to
>>> Mac OS X 10.9 (Mavericks), but due to a few technical
>>> problems I had to backtrack to the previous version
>>> 10.8 for now.
>>>
>>> After restoring from backups and checking
>>> that everything works, I discovered that RcppOctave
>>> does not install. I get the same invalid malloc error that
>>> I was getting before. But this time I have not used
>>> MacPorts at all, only Homebrew, and the version of
>>> Octave is 3.6.4 as it should be.
>>>
>>> (I am downloading source, not using install.packages(), because
>>> the latter tends to download old archives.)
>>>
>>> Indeed, with my fresh install of Mac OS X, with the
>>> command line tools and Xcode installed, R does not
>>> issue the correct command: R CMD config CXX
>>> returns: llvm-g++-4.2 -arch x86_64.
>>>
>>> But there is no llvm-g++-4.2, only /usr/bin/g++ (version
>>> 4.2.1) and /usr/bin/gcc (version 4.2.1). I tried to work-around
>>> this problem by defining symbolic links llvm-g++-4.2 and
>>> llvm-gcc-4.2 pointing to these files, but this does not work.
>>>
>>> There are a couple of open issues:
>>> 1. Apple no longer ships binaries named llvm-g++-4.2 and
>>>    llvm-gcc-4.2 (only g++ and gcc).
>>> 2. Apple no longer supports Fortran at all (the R core team
>>>     provides gfortran-4.2…see R Mac OS FAQ).
>>> 3. 'brew install octave' does not show you what it is doing,
>>>    and I think it may be using clang instead of gcc, clang++
>>>    instead of g++.
>>> 4. The segfault error when I try to install RcppOctave is
>>>     probably due to compiler version incompatibilities, either
>>>     gcc-4.2 vs gcc-4.2.1, or more likely, gcc-4.2.1 vs clang, etc.
>>>
>>> Thus under Mac OS X the correct long-term solution is to
>>> stop using gcc/g++ and follow Apple in using clang/clang++.
>>> In the mean time, Apple will make life difficult for people who
>>> continue to use gcc/g++/gfortran! (There is an open source
>>> project to write an LLVM Fortran front-end, but I don't know
>>> what the status of that project is.)
>>>
>>> Dominick
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcppoctave-user/attachments/20131101/a453e245/attachment.html>


More information about the Rcppoctave-user mailing list