From ripley at stats.ox.ac.uk  Tue Oct 20 07:08:23 2009
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 20 Oct 2009 06:08:23 +0100 (BST)
Subject: [Rd] Changing options in R CMD SHLIB
In-Reply-To: <284062.25948.qm@web59715.mail.ac4.yahoo.com>
References: <284062.25948.qm@web59715.mail.ac4.yahoo.com>
Message-ID: <alpine.LFD.2.00.0910200600080.6426@gannet.stats.ox.ac.uk>

Please see the manual -- 'Writing R Extensions'.  If you want to use 
custom compiler flags, you use a Makevars or personal .Makevars file.
Something like

PKG_FCFLAGS=-fopenmp

(you haven't told us your OS or version of R).

On Mon, 19 Oct 2009, Fabio Mathias Corr?a wrote:

> Dear,
>
> When trying to use directive OpenMP in my code, I observed that the directive ones were being considered as commentaries.
> Compiling with command R CMD SHLIB xxx.f95 - fopenmp and calling the function in the R verified that threads was not being considered.
> I was to observe the options of the compiler
>
> R CMD SHLIB --help
>
> Usage: R CMD SHLIB [options] files | linker options
>
> Build a shared library for dynamic loading from the specified source or
> object files (which are automagically made from their sources) or
> linker options.? If not given via '--output', the name for the shared
> library is determined from the first source or object file.
>
> Options:
> ? -h, --help??? ??? print short help message and exit
> ? -v, --version??? ??? print version info and exit
> ? -o, --output=LIB??? use LIB as (full) name for the built library
> ? -c, --clean??? ??? remove files created during compilation
> ? --preclean??? ??? remove files created during a previous run
> ? -n, --dry-run??? ??? dry run, showing commands that would be used
>
> Windows only:
> ? -d, --debug??? ??? build a debug DLL
>
>
> How can I enable -fopenmp for use with R CMD SHLIB?
>
>
> ? ???????????? F?bio Mathias Corr?a
> Estat?stica e Experimenta??o Agropecu?ria/UFLA

-- 
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] Changing options in R CMD SHLIB
Prof Brian Ripley