[R-SIG-Mac] building 32-bit version of R 3.x
Simon Urbanek
simon.urbanek at r-project.org
Tue Mar 4 19:44:37 CET 2014
On Mar 4, 2014, at 1:38 PM, Alexy Khrabrov <deliverable at gmail.com> wrote:
> OK, after moving aside brew and building with ATT gfortran-4.3 and
> your options above, I've installed over previous binary install of R.
> It starts up 32-bit version fine via R, but --arch=x86_64 says
> subarchitecture not installed. Anything else needed to enable it?
>
Did you build and install the 64-bit version as well? And did you use r_arch=x86_64 in the 64-bit build?
Cheers,
S
> A+
>
> On Mon, Mar 3, 2014 at 2:17 PM, Simon Urbanek
> <simon.urbanek at r-project.org> wrote:
>> On Mar 3, 2014, at 4:50 PM, Alexy Khrabrov <deliverable at gmail.com> wrote:
>>
>>> That's my own prefix gave to configure with your options above. I've
>>> installed gfortran-4.8.2 via brew, and gfortran symlink is pointing to
>>> it. For this 32-bit build, I've changed your flags to refer to
>>> gfortran-4.2, which is the one installed from the tools link on CRAN.
>>
>> Ah, no, you cannot mix homebrew and native builds. As I said, if you use anything other that the native toolchain all bets are off and you'll need to pickup the mess yourself. In particular Homebrew doesn't provide fat binaries so you cannot mix it with 32-bit at all. Remove homebrew (move /usr/local aside), re-install the CRAN compiler and go from there. If you need any dependencies, have a look in
>> http://r.research.att.com/libs/
>>
>> Cheers,
>> Simon
>>
>>
>>
>>> Yet I get warnings during build:
>>>
>>> ld: warning: ignoring file
>>> /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libquadmath.dylib, file
>>> was built for x86_64 which is not the architecture being linked
>>> (i386): /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libquadmath.dylib
>>>
>>> ld: warning: ignoring file
>>> /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/libgcc.a,
>>> file was built for archive which is not the architecture being linked
>>> (i386): /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/libgcc.a
>>>
>>> -- hence I configured my own --prefix=/opt/R/R32 to first see whether
>>> my build works, and it doesn't run from it. make check seems to pass.
>>> Should I just make install and hope R --arch=i386 will work?
>>>
>>
>>
>>> A+
>>>
>>> On Mon, Mar 3, 2014 at 1:32 PM, Simon Urbanek
>>> <simon.urbanek at r-project.org> wrote:
>>>> On Mar 3, 2014, at 4:24 PM, Alexy Khrabrov <deliverable at gmail.com> wrote:
>>>>
>>>>> So in what sense is R on Mac OSX now supported as only 64-bit for 3.0
>>>>> and after? BTW, for the freshly built R32, I'm getting
>>>>>
>>>>> [126] $ /opt/R/R32/R.framework/R
>>>>> zsh: exec format error:
>>>>> /opt/R/R32/R.framework/R
>>>>>
>>>>
>>>> What is that? That's neither the proper place for a framework nor the correct build. Are you trying to run the framework library as opposed to the R binary?
>>>>
>>>> If you do
>>>>
>>>> make && make install
>>>>
>>>> then the framework will be in
>>>>
>>>> /Library/Frameworks/R.framework
>>>>
>>>> and the R start script in
>>>>
>>>> /Library/Frameworks/R.framework/Resources/bin/R
>>>>
>>>> You should not need to set anything else.
>>>>
>>>> Cheers,
>>>> Simon
>>>>
>>>>
>>>>
>>>>
>>>>> setting DYLD_LIBRARY_PATH=/opt/R/R32/R.framework/Libraries doesn't help.
>>>>>
>>>>> A+
>>>>>
>>>>> On Mon, Mar 3, 2014 at 12:54 PM, Simon Urbanek
>>>>> <simon.urbanek at r-project.org> wrote:
>>>>>> On Mar 3, 2014, at 3:41 PM, Alexy Khrabrov <deliverable at gmail.com> wrote:
>>>>>>
>>>>>>>> They are both installed into the same "fat" framework. Everything is shared (i.e. files exist only once) except for the .so objects and some configurations that are in separate subdirectories based on the r_arch setting. OS X supports multiple architectures in one binary, that's why you don't need to modify any paths. OS X was running several architectures in parallel for a long time (first PPC+Intel then ppc+ppc64+i386+x86_64) so it "just works". The only thing to remember is that when you are compiling 3rd party dependencies, you must compile them "fat" for both architectures as well (or use lipo to combine them).
>>>>>>>
>>>>>>> Great -- so how should I configure R build to do that? Obviously the
>>>>>>> above builds only one.
>>>>>>>
>>>>>>
>>>>>> You always build one, but they both install into one merged framework. You choose which to invoke by setting the --arch parameter, e.g. R --arch=x86_64 to run the 64-bit version. The default will be whichever you install last.
>>>>>>
>>>>>> Cheers,
>>>>>> Simon
>>>>>>
>>>>>
>>>>
>>>
>>
>
More information about the R-SIG-Mac
mailing list