$ git clone http://luajit.org/git/luajit-2.0.git $ cd luajit-2.0 $ make
Step 7 - Deploying New FBs With the Dynamic Type Loader
This page is part of a guide that gives a walk-through of the major 4diac IDE features.
-
Deploying new FBs with the Dynamic Type Loader (YOU ARE HERE!)
In this tutorial, you will learn how to deploy and test your function blocks, without compiling and adding them to 4diac FORTE .
Each time you created new function blocks, a new 4diac FORTE has to be compiled. This takes time, which is wasted just for compiling. Therefore, we have a feature called "Dynamic Type Loader". With this feature, new functions blocks can be deployed and tested without the need to compile them. Instead of directly compiled into 4diac FORTE, the FBs are downloaded as LUA Code and a Lua-Interpreter, running inside 4diac FORTE, interprets this code then.
Downloading the Compiler
Before we can use the Dynamic Type Loader, we have to compile a new 4diac FORTE with the Lua JIT (Just-In-Time Compiler). Therefore we are going to need a C-compiler. If you have done the tutorial, on how to create your own 4diac FORTE, everything you need should already be installed. Otherwise, follow the steps here.
We recommend using the minGW compiler.
Downloading Lua
Now we need to download the Lua source code and build the libraries. We are using LuaJit. Open the folder, you want to build Lua in. Start Git Bash there and enter this commands:
The libs should be successfully created.
Compiling 4diac Forte with the LuaJit
At first download the 4diac FORTE source code from here or clone the 4diac FORTE repository.
$ git clone git://git.eclipse.org/gitroot/4diac/org.eclipse.4diac.forte.git
Then create an folder where we are going to build our 4diac FORTE in. Open CMake and set the source folder, to the folder where your 4diac FORTE source files are in. Then set the build folder, to folder where you want to build 4diac FORTE in.
Before configuring the Lua options, please enable all options, shown in this tutorial. Before pressing generate, we have to configure all Lua options.
-
Set
FORTE_USE_LUATYPES
toLUAJIT
and press configure -
For
LUAJIT_INCLUDE_DIR
choose the folder, where your compiled library is in,YOUR_FOLDER/src/
. -
For
LUAJIT_LIBRARY
choose theLua51.dll
which should be in your folder where compiled Lua underYOUR_FOLDER/src/Lua51.dll
-
Press Configure. All red marked lines should be gone. At last press generate, open Git Bash in your build folder and enter
make
You should have now successfully built your 4diac FORTE with the integration of the Lua JIT compiler.
Enabling the Dynamic Type Loader
Before you can use theDynamic Type Loader, you have to enable it in the 4diac IDE.
-
Then choose your system application, where you can see all your resources
-
Then choose the 4diac FORTE resources, where you want to deploy the new FBs to
-
In the properties tab, change the profile above the "Inputs" of the tab, to "DynamicTypeLoad"
Everything should be set up and you can deploy your FBs, like you learned earlier in the tutorial, without compiling a new 4diac FORTE.
Where to go from here?
-
If you want to go back to the Start Here page, we leave you here a fast access:
Where to Start