[Rcppoctave-user] Apple Blues

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


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


We are pretty much back to where we were some weeks ago. Remember
the trivial change that I made to Rcpp that caused it to fail with the
pointer error, by adding a function that was not even called?

Well, I just did the same with Octave 3.6.4 (the latest Homebrew
version, not the ancient MacPorts version), and now I get that pointer
error! Just drop the attached files into the Rcpp/src directory and the
build will fail due to memory corruption.

So the previous theory (old Octave version) is wrong, and once again
I suspect that there is an issue with static initializers…




On Wed, Oct 30, 2013 at 12:07 PM, Dominick Samperi <djsamperi at gmail.com>wrote:

> I am not familiar with what mkoctfile does, and I suspect it may
> be the source of the problem. Can you provide some background
> on what this does?
>
>
> On Wed, Oct 30, 2013 at 12:04 PM, 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/19bf7061/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makevars
Type: application/octet-stream
Size: 1958 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcppoctave-user/attachments/20131101/19bf7061/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strtest.cpp
Type: text/x-c++src
Size: 595 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcppoctave-user/attachments/20131101/19bf7061/attachment-0001.cpp>


More information about the Rcppoctave-user mailing list