Vuo
0.4.3
|
A compiler/linker for node classes and graphs.
Once you've compiled and linked a graph, you can use VuoRunner to execute and communicate with it.
Public Member Functions | |
void | addNodeClass (VuoCompilerNodeClass *nodeClass) |
Adds a node class to use when linking a composition. | |
void | compileGraph (VuoCompilerBitcodeGenerator *generator, string outputPath) |
Compiles a composition to LLVM bitcode. | |
void | compileGraph (string inputPath, string outputPath) |
Compiles a graph, read from file, to LLVM bitcode. | |
void | compileGraphString (const string &graphString, string outputPath) |
Compiles the graph in graphString to LLVM bitcode. | |
void | compileNodeClass (string inputPath, string outputPath) |
Compiles inputPath (a .c file) and saves the resulting LLVM bitcode in outputPath . | |
void | linkGraphIntoExecutable (string inputPath, string outputPath) |
Turns a compiled (but not linked) graph into a standalone executable by linking in all of its dependencies and adding a main function. | |
void | linkGraphIntoDynamicLibrary (string inputPath, string outputPath) |
Turns a compiled (but not linked) graph into a dynamic library by linking in all of its dependencies. | |
void | linkCompositionToCreateDynamicLibraries (string compiledCompositionPath, string linkedCompositionPath, string linkedResourcesPath, bool linkedResourcesDylibExists=false) |
Creates one dynamic library for the composition by itself and, if needed, another dynamic library for the node classes and other resources that are dependencies of the composition. | |
VuoCompilerNodeClass * | getNodeClass (const string &id) |
Looks up the VuoCompilerNodeClass for the node class specified by id. | |
map< string, VuoCompilerNodeClass * > | getNodeClasses (void) |
Returns a map linking a string representation of a node class's name to its VuoCompilerNodeClass instance. | |
VuoCompilerType * | getType (const string &id) |
Looks up the VuoCompilerType for the type specified by id. | |
void | listNodeClasses (const string &format="") |
Prints a list of all loaded node classes to standard output. | |
void | addHeaderSearchPath (const string &path) |
Adds a header search path to use when compiling a node class. | |
void | addLibrarySearchPath (const string &path) |
Adds a library search path to use when linking a graph. | |
void | addPreferredLibrarySearchPath (const string &path) |
Adds a preferred library search path to use when linking a graph. | |
void | clearPreferredLibrarySearchPaths () |
Clears the list of preferred library paths. | |
void | addFrameworkSearchPath (const string &path) |
Adds a Mac OS X framework search path to use when linking a graph. | |
void | addPreferredFrameworkSearchPath (const string &path) |
Adds a preferred Mac OS X framework search path to use when linking a graph. | |
void | setTelemetry (const string &telemetry) |
Sets the telemetry option to use when compiling a graph. | |
void | setTarget (const string &target) |
Sets the target triple to use when compiling or linking. | |
void | setVerbose (bool isVerbose) |
Sets the verbosity to use when compiling or linking. | |
void | setClangPath (const string &clangPath) |
Sets the path to the clang binary. | |
string | getCompositionLoaderPath (void) |
Returns the path to the VuoCompositionLoader executable. | |
void | print (void) |
Prints info about this compiler, for debugging. | |
Static Public Member Functions | |
static llvm::sys::Path | getVuoFrameworkPath () |
Returns the path to Vuo.framework, or an empty path if the framework cannot be located. | |
static string | getUserModulesPath () |
Returns the filesystem path to the user-specific Vuo Modules folder. | |
static string | getSystemModulesPath () |
Returns the filesystem path to the system-wide Vuo Modules folder. | |
static VuoRunner * | newSeparateProcessRunnerFromCompositionFile (string compositionFilePath) |
Creates a runner object that can run the composition in file compositionFilePath in a new process. | |
static VuoRunner * | newSeparateProcessRunnerFromCompositionString (string composition) |
Creates a runner object that can run the composition in string composition in a new process. | |
static VuoRunner * | newCurrentProcessRunnerFromCompositionFile (string compositionFilePath) |
Creates a runner object that can run the composition in file compositionFilePath in this process. | |
static VuoRunner * | newCurrentProcessRunnerFromCompositionString (string composition) |
Creates a runner object that can run the composition in string composition in this process. | |
Protected Member Functions | |
void | addModuleSearchPath (string path) |
Adds a module search path (for node classes, types, and libraries) to use when linking a composition. | |
Friends | |
class | TestVuoCompilerBitcodeGenerator |
class | TestVuoCompiler |
TestVuoCompiler needs to add a search path for its own private nodes/types. | |
class | TestGraphExecution |
TestGraphExecution needs to add a search path for its own private nodes. | |
void VuoCompiler::addNodeClass | ( | VuoCompilerNodeClass * | nodeClass | ) |
Adds a node class to use when linking a composition.
Typically, node classes are loaded from file with addModuleSearchPath()
. This function is useful if adding a node class that is generated at compile time.
void VuoCompiler::addPreferredFrameworkSearchPath | ( | const string & | path | ) |
Adds a preferred Mac OS X framework search path to use when linking a graph.
Preferred paths will be searched before any other framework paths.
void VuoCompiler::addPreferredLibrarySearchPath | ( | const string & | path | ) |
Adds a preferred library search path to use when linking a graph.
Preferred paths will be searched before any other library paths.
void VuoCompiler::compileGraph | ( | VuoCompilerBitcodeGenerator * | generator, |
string | outputPath | ||
) |
Compiles a composition to LLVM bitcode.
generator | A bitcode generator for the composition. |
outputPath | The file in which to save the compiled LLVM bitcode. |
void VuoCompiler::compileGraph | ( | string | inputPath, |
string | outputPath | ||
) |
Compiles a graph, read from file, to LLVM bitcode.
inputPath | The .vuo file containing the graph. |
outputPath | The file in which to save the compiled LLVM bitcode. |
void VuoCompiler::compileGraphString | ( | const string & | graphString, |
string | outputPath | ||
) |
Compiles the graph in graphString
to LLVM bitcode.
graphString | A string containing the graph. |
outputPath | The file in which to save the compiled LLVM bitcode. |
VuoCompilerNodeClass * VuoCompiler::getNodeClass | ( | const string & | id | ) |
Looks up the VuoCompilerNodeClass
for the node class specified by id.
The node class module is loaded if it hasn't been already.
map< string, VuoCompilerNodeClass * > VuoCompiler::getNodeClasses | ( | void | ) |
Returns a map linking a string representation of a node class's name to its VuoCompilerNodeClass
instance.
The node class modules are loaded if they haven't been already.
VuoCompilerType * VuoCompiler::getType | ( | const string & | id | ) |
Looks up the VuoCompilerType
for the type specified by id.
The type module is loaded if it haven't been already.
void VuoCompiler::linkCompositionToCreateDynamicLibraries | ( | string | compiledCompositionPath, |
string | linkedCompositionPath, | ||
string | linkedResourcesPath, | ||
bool | linkedResourcesDylibExists = false |
||
) |
Creates one dynamic library for the composition by itself and, if needed, another dynamic library for the node classes and other resources that are dependencies of the composition.
compiledCompositionPath | Path to the compiled composition (a .bc file generated by compileGraph ). |
linkedCompositionPath | Path where the resulting dynamic library for the composition should be placed. |
linkedResourcesPath | Path where the dynamic library for the resources either should be placed or already exists. |
linkedResourcesDylibExists | False if the dynamic library for the resources should be created, true if it already exists. |
void VuoCompiler::linkGraphIntoDynamicLibrary | ( | string | inputPath, |
string | outputPath | ||
) |
Turns a compiled (but not linked) graph into a dynamic library by linking in all of its dependencies.
inputPath | Path to the compiled graph (a .bc file generated by compileGraph ). |
outputPath | Path where the resulting dynamic library should be placed. |
void VuoCompiler::linkGraphIntoExecutable | ( | string | inputPath, |
string | outputPath | ||
) |
Turns a compiled (but not linked) graph into a standalone executable by linking in all of its dependencies and adding a main function.
inputPath | Path to the compiled graph (a .bc file generated by compileGraph ). |
outputPath | Path where the resulting executable should be placed. |
void VuoCompiler::listNodeClasses | ( | const string & | format = "" | ) |
Prints a list of all loaded node classes to standard output.
The node class modules are loaded if they haven't been already.
format | The format for printing the node classes.
|
void VuoCompiler::setTelemetry | ( | const string & | telemetry | ) |
Sets the telemetry option to use when compiling a graph.
Valid values are "on" and "console".
void VuoCompiler::setVerbose | ( | bool | isVerbose | ) |
Sets the verbosity to use when compiling or linking.
If true, prints some debug info and passes the -v option to Clang.