| initProjectFromFolder {BuildSys} | R Documentation |
Initialise an S4 BSysProject Instance based on a Project Folder
Description
Calling initProjectFromFolder initialises a project specification in an S4 BSysProject object instance. That
object instance can then be used to compile and debug the resulting shared library. A new BSysProject object instance
can be constructed by calling new("BSysProject", ...) where the argument list (...) is the same as for initProjectFromFolder.
Usage
## S4 method for signature 'BSysProject'
initProjectFromFolder(.Object,
WorkingFolder = "NULL",
Name = "",
SourceFiles = "NULL",
SourceName = "src",
IncludeName = "include",
ObjName = "obj",
InstallLibraryName = as.character(NULL),
InstallIncludeName = as.character(NULL),
Flat = TRUE,
Packages = as.character(c()),
Includes = as.character(c()),
Defines = as.character(c()),
Libraries = as.character(c()),
CFLAGS = as.character(c()),
CXXFLAGS = as.character(c()),
FFLAGS = as.character(c()),
LDFLAGS = as.character(c()),
LDLIBS = as.character(c()),
DEFINES = as.character(c()),
Debug = TRUE)
Arguments
.Object |
|
WorkingFolder |
The path to the root folder of the project, either relative or absolute and must be supplied. |
Name |
The name given to the project and will form the basename of the shared library. |
SourceFiles |
The a list of file names in WorkingFolder that should be compiled as part of the project or |
SourceName |
The sub-path / sub-drectory of the source folder (containing |
IncludeName |
The sub-path / sub-drectory of the include folder (containing |
ObjName |
The sub-path / sub-drectory of the object folder (containing the compiled |
InstallLibraryName |
The sub-path / sub-drectory of the folder to install the compiled shared library to. |
InstallIncludeName |
The sub-path / sub-drectory of the folder to install the shared library header files to. |
Flat |
A |
Packages |
A |
Includes |
A |
Defines |
A |
Libraries |
A |
CFLAGS |
A |
CXXFLAGS |
A |
FFLAGS |
A |
LDFLAGS |
A |
LDLIBS |
A |
DEFINES |
A |
Debug |
A |
Details
initProjectFromFolder constructs a project specification by scanning the WorkingFolder
and relevant sourceName sub path for source files to add to the project. If the SourceFiles
is included the the source file scan is omitted and only the named source files included. The named files
are assumed relative to the Working Folder so if a hierarchical project is being created then the relative
path to the source folder will need to be included in the SourceFiles list. Any .c, .cpp
and .f files it finds are added to the project. In the case of Fortran files the following extensions
are scanned; .f, .for, .f90, .f95 and .f77. Any added files are scanned
for include directives and those includes are added as project dependencies. If the dependency is not found
in the path described by the includeName it is regarded as an external dependency.
If the external dependency is known (TMB.hpp for example) then the appropriate Includes,
Defines and Libraries are added to the project definition. BuildSys is currently
aware of TMB, Rcpp, RcppEigen and the BLAS library support in R. External
dependencies not know to BuildSys need to be handle by adding the appropriate Includes,
Defines and Libraries to the Project manually with the arguments provided above.
initProjectFromFolder has useful defaults meaning in most cases very few arguments need be provided.
At most, the WorkingFolder and Name arguments will be required but if the project has only
a single source file then even Name can be omitted as the name will be inferred from the source file name.
Value
returns an S4 object instance of class BSysProject that describes the code project.
Note
see BuildSys-package for examples of use.
Author(s)
Paavo Jumppanen [aut, cre]
Maintainer: Paavo Jumppanen <paavo.jumppanen@csiro.au>
See Also
make
buildMakefile
vcDebug
loadLibrary
unloadLibrary
libraryPath
sourcePath
includePath
objPath
installLibraryPath
installIncludePath
BuildSys-package