From ripley at stats.ox.ac.uk  Thu Nov  4 07:44:25 2010
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 4 Nov 2010 06:44:25 +0000 (GMT)
Subject: [Rd] Calling C in R in Windows 64 bit
In-Reply-To: <63E83206-D5AF-40FB-9C02-24FE0E1177C5@r-project.org>
References: <2098458241.10945.1288786828198.JavaMail.root@serv223.segi.ulg.ac.be>
	<63E83206-D5AF-40FB-9C02-24FE0E1177C5@r-project.org>
Message-ID: <alpine.LFD.2.00.1011040641020.24342@gannet.stats.ox.ac.uk>

More simply, he wants to set his paths as described in the CHANGES 
file and R-admin manual, to

C:\Program Files\R\R-2.12.0\bin\x64

and so on.  C:\Program Files\R\R-2.12.0\bin\R is only provided for 
some backwards compatibilty (as the CHANGES file says) and may not be 
retained in future versions.

On Thu, 4 Nov 2010, Simon Urbanek wrote:

>
> On Nov 3, 2010, at 1:20 PM, aysun.cetinyurek at ulg.ac.be wrote:
>
>> Dear developers,
>>
>> I am trying to run some C/ Fortran code in R. Although I have experience with that in Windows (Vista) 32 bit, I could not succeed in 64 bit. I downloaded the following:
>> - R 2.12.0
>> - Rtools 212
>> - miktex 2.9
>> - inno setup 5
>>
>> -Afterwards, I changed the path as:
>> ?C:\Program Files\R\R-2.12.0\bin;C:\Rtools\bin;C:\Rtools\MinGW64\bin;C:\Program Files\HTML Help Workshop;C:\Program Files (x86)\CodeBlocks\bin;C:\Program Files\Insight\bin;C:\Rtools\perl\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Broadcom\Broadcom 802.11\Driver;?
>>
>> - started Command Prompt and checked the path by typing 'path'
>> - then I typed
>>
>> 'x86_64-w64-mingw32-gcc -c COXPHmatprod24delta.c -o COXPHmatprod24delta.o -I"C:\Program Files\R\R-2.12.0\include"'
>>
>> the above command produced the file with .o extension.
>>
>> -Afterwards I typed
>> 'x86_64-w64-mingw32-gcc -shared -o COXPHmatprod24delta.dll COXPHmatprod24delta.o -I"C:\Program Files\R\R-2.12.0\include" -L"C:\Program Files\R\R-2.12.0\bin" ?lR'
>>
>> it produces the error:
>> 'x86_64-w64-mingw32-gcc: -lR: No such file or directory'
>>
>> -The problem here is that it does not produce .dll file. I cannot find the solution to that although I tried for 2 days.
>>
>
> Well, you are pointing -L to the wrong path (it's missing the architecture - in your case x64), so it's no wonder. What you really want is  R --arch x64 CMD SHLIB
>
>
>> --Alternatively I tried ?R CMD SHLIB COXPHmatprod24delta.c? and it produces the error:
>> 'cygwin warning:
>>  MS-DOS style path detected: C:/PROGRA~1/R/R-212~1.0/etc/i386/Makeconf
>>  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-212~1.0/etc/i386/Makec
>> onf
>>  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>>  Consult the user's guide for more details about POSIX paths:
>>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
>> nm: not found
>> gcc -shared -s -static-libgcc -o COXPHmatprod24delta.dll tmp.def COXPHmatprod24d
>> elta.o -LC:/PROGRA~1/R/R-212~1.0/bin/i386 -lR
>> gcc: not found'
>>
>
> You are compiling 32-bit and you don't have the tools installed. If 
> you meant to use 64-bit you want to use R --arch x64 CMD SHLIB 
> instead.
>
> Cheers,
> Simon
>
>
>> Every comment is appreciated. Many thanks in advance.
>>
>> Sincerely Yours,
>>
>> Aysun Cetinyurek
>>
>> Services de Statistique
>> Institut de Math?matique (B37)
>> Grande Traverse, 12
>> B4000 Li?ge
>> Belgique
>>
>>
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Calling C in R in Windows 64 bit
Prof Brian Ripley