Comments (27)
Currently, we only feature a LUA as a datamodel for scripting within SCXML. I can prepare LUA language bindings if you want them. There are two possible approaches we could take:
1. Generate pure LUA code via transpiling, like we do for ANSI-C with 'uscxml-transform' or
2. Embed the uscxml interpreter as a LUA module as with the C# or Java bindings.
The first approach would not need a native module compiled for the host architecture but will not support scripting in anything but LUA. With the second approach, there would be a natively compiled module loaded into the LUA host runtime, which would allow to script SCXML documents with other languages (e.g. ECMAScript). Which one would you prefer?
from uscxml.
I would be interested in the following approach: embed the uscxml interpreter as a LUA module.
Thank you !
from uscxml.
It is done. If you have SWIG as well as the Lua libraries and headers installed, just run:
$ make
...
-- Available language bindings .... : lua java
...
Then the build-process will compile a native module for Lua:
$ ls lib/
...
-rwxr-xr-x 1 sradomski staff 743392 Aug 23 15:34 uscxmlNativeLua.so
...
I have not tried it, but here is an example on how to use it generally. Let me know if this works for you.
from uscxml.
Oh, and if you find some deficiencies, we can most definitely polish the API some more - currently, all of it is generated.
from uscxml.
I am having an errors:
ed@ubuntu:/usr/uscxml/build$ sudo cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11_FLAG
-- Performing Test COMPILER_SUPPORTS_CXX11_FLAG - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X_FLAG
-- Performing Test COMPILER_SUPPORTS_CXX0X_FLAG - Success
-- Performing Test CXX_HAS_THREADS
-- Performing Test CXX_HAS_THREADS - Success
-- Performing Test CXX_HAS_SHARED_PTR
-- Performing Test CXX_HAS_SHARED_PTR - Success
-- Performing Test CXX_HAS_AUTOTYPE
-- Performing Test CXX_HAS_AUTOTYPE - Success
-- Performing Test CXX_HAS_LAMBDAS
-- Performing Test CXX_HAS_LAMBDAS - Success
-- Performing Test CXX_HAS_MEMBER_INIT
-- Performing Test CXX_HAS_MEMBER_INIT - Success
-- Performing Test CXX_HAS_INLINE_INIT
-- Performing Test CXX_HAS_INLINE_INIT - Success
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.35.0")
-- Performing Test CURL_HAS_SMTP
-- Performing Test CURL_HAS_SMTP - Success
-- Could NOT find XercesC (your CMake distribution does not include the FindXercesC module)
-- --> will download and compile
-- Found LIBEVENT: optimized;/usr/lib/x86_64-linux-gnu/libevent.so;debug;/usr/lib/x86_64-linux-gnu/libevent.so;optimized;/usr/lib/x86_64-linux-gnu/libevent_openssl.so;debug;/usr/lib/x86_64-linux-gnu/libevent_openssl.so;/usr/lib/x86_64-linux-gnu/libevent_pthreads.so;/usr/lib/x86_64-linux-gnu/libevent_extra.so;/usr/lib/x86_64-linux-gnu/libevent_core.so
-- Did not look for UriParser
-- --> will download and compile
-- Found SWIG: /usr/bin/swig2.0 (found version "2.0.11")
-- Could NOT find JSC (missing: JSC_INCLUDE_DIR JSC_LIBRARY)
-- Performing Test V8_VER_GREATER_032317
-- Performing Test V8_VER_GREATER_032317 - Failed
-- Your V8 installation is too old - we need >= 3.23.17
-- Could NOT find V8 (missing: V8_LIBRARY)
CMake Warning at CMakeLists.txt:364 (find_package):
By not providing "FindLua.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Lua", but
CMake did not find one.
Could not find a package configuration file provided by "Lua" with any of
the following names:
LuaConfig.cmake
lua-config.cmake
Add the installation prefix of "Lua" to CMAKE_PREFIX_PATH or set "Lua_DIR"
to a directory containing one of the above files. If "Lua" provides a
separate development package or SDK, be sure it has been installed.
-- SWIG version > 3.0.8 is recommended, found 2.0.11 - skipping DOM generation
-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- No JNI libraries found - not building Java wrappers
CMake Warning at src/bindings/swig/lua/CMakeLists.txt:4 (find_package):
By not providing "FindLua.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Lua", but
CMake did not find one.
Could not find a package configuration file provided by "Lua" with any of
the following names:
LuaConfig.cmake
lua-config.cmake
Add the installation prefix of "Lua" to CMAKE_PREFIX_PATH or set "Lua_DIR"
to a directory containing one of the above files. If "Lua" provides a
separate development package or SDK, be sure it has been installed.
-- No Lua headers found - not building Lua wrappers
-- SWIG version > 3.0 is recommended, found 2.0.11
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Linking against libraries (check if you need to export in LD_LIBRARY_PATH or PATH):
-- /usr/lib/x86_64-linux-gnu/libcurl.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent_core.so
-- /usr/lib/x86_64-linux-gnu/libevent_extra.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_pthreads.so
-- BUILD_DIR/deps/uriparser/lib/liburiparser.a
-- BUILD_DIR/deps/xerces-c/lib/libxerces-c.so
-- Targets:
-- Available datamodels ........... : null
-- Available invokers ............. : dirmon scxml
-- Available ioprocessors ......... : basichttp scxml
-- Available custom elements ...... :
-- Available language bindings .... :
-- General information:
-- Build type ..................... : Release for linux-x86_64-gnu
-- Building library as ............ : SHARED without plugins
-- CXX Flags : -std=c++11 -O3 -DNDEBUG
-- C Flags : -O3 -DNDEBUG
-- Definitions : USCXML_EXPORT
-- Libraries will end up in ....... : BUILD_DIR/lib
-- Binaries will end up in ........ : BUILD_DIR/bin
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/uscxml/build
from uscxml.
For a quick fix, update cmake to a more recent version, I will try to add support for older cmake versions later this week.
from uscxml.
I have the latest version of CMake.
I do as stated in http://tklab-tud.github.io/uscxml/building.html.
But most likely, I have something else set up to build, but I do not have enough experience.
from uscxml.
It may be a simple case-sensitive file issue then 'LUA' vs. 'Lua', as I am on a case-insensitive file system. I will check this evening.
from uscxml.
It's not a case-sensitive issue and the linux build-slaves pass compilation just fine. Are you sure that your CMake version is current?
$ cmake --version
What does it output on your build host?
from uscxml.
ed@ubuntu:/usr/uscxml/build$ sudo cmake --version
cmake version 2.8.12.2
ed@ubuntu:/usr/uscxml/build$
from uscxml.
That is not the latest version of cmake, however I'd like to support 2.8.12 as it is deployed with a bunch of other linux distributions. Before I check something in, can you do me a favor and install the FindLua.cmake
file from the cmake distribution in contrib/cmake
:
# starting from your uscxml source directory
$ cd contrib/cmake
$ wget https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindLua.cmake
Try to build and report if this will solve the problem?
from uscxml.
Now came this:
ed@ubuntu:/usr/uscxml/contrib/cmake$ sudo wget https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindLua.cmake
[sudo] password for ed:
--2016-08-25 01:33:32-- https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindLua.cmake
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.84.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.84.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7493 (7.3K) [text/plain]
Saving to: ‘FindLua.cmake’
100%[=================================================================================================>] 7,493 --.-K/s in 0.001s
2016-08-25 01:33:33 (7.42 MB/s) - ‘FindLua.cmake’ saved [7493/7493]
ed@ubuntu:/usr/uscxml/build$ sudo cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11_FLAG
-- Performing Test COMPILER_SUPPORTS_CXX11_FLAG - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X_FLAG
-- Performing Test COMPILER_SUPPORTS_CXX0X_FLAG - Success
-- Performing Test CXX_HAS_THREADS
-- Performing Test CXX_HAS_THREADS - Success
-- Performing Test CXX_HAS_SHARED_PTR
-- Performing Test CXX_HAS_SHARED_PTR - Success
-- Performing Test CXX_HAS_AUTOTYPE
-- Performing Test CXX_HAS_AUTOTYPE - Success
-- Performing Test CXX_HAS_LAMBDAS
-- Performing Test CXX_HAS_LAMBDAS - Success
-- Performing Test CXX_HAS_MEMBER_INIT
-- Performing Test CXX_HAS_MEMBER_INIT - Success
-- Performing Test CXX_HAS_INLINE_INIT
-- Performing Test CXX_HAS_INLINE_INIT - Success
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.35.0")
-- Performing Test CURL_HAS_SMTP
-- Performing Test CURL_HAS_SMTP - Success
-- Could NOT find XercesC (your CMake distribution does not include the FindXercesC module)
-- --> will download and compile
-- Found LIBEVENT: optimized;/usr/lib/x86_64-linux-gnu/libevent.so;debug;/usr/lib/x86_64-linux-gnu/libevent.so;optimized;/usr/lib/x86_64-linux-gnu/libevent_openssl.so;debug;/usr/lib/x86_64-linux-gnu/libevent_openssl.so;/usr/lib/x86_64-linux-gnu/libevent_pthreads.so;/usr/lib/x86_64-linux-gnu/libevent_extra.so;/usr/lib/x86_64-linux-gnu/libevent_core.so
-- Did not look for UriParser
-- --> will download and compile
-- Found SWIG: /usr/bin/swig2.0 (found version "2.0.11")
-- Could NOT find JSC (missing: JSC_INCLUDE_DIR JSC_LIBRARY)
-- Performing Test V8_VER_GREATER_032317
-- Performing Test V8_VER_GREATER_032317 - Failed
-- Your V8 installation is too old - we need >= 3.23.17
-- Could NOT find V8 (missing: V8_LIBRARY)
CMake Error at contrib/cmake/FindLua.cmake:192 (include):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
CMakeLists.txt:364 (find_package)
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.2.3")
-- SWIG version > 3.0.8 is recommended, found 2.0.11 - skipping DOM generation
-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- No JNI libraries found - not building Java wrappers
CMake Error at contrib/cmake/FindLua.cmake:192 (include):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
src/bindings/swig/lua/CMakeLists.txt:4 (find_package)
-- SWIG version > 3.0 is recommended, found 2.0.11
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Linking against libraries (check if you need to export in LD_LIBRARY_PATH or PATH):
-- /usr/lib/x86_64-linux-gnu/libcurl.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent_core.so
-- /usr/lib/x86_64-linux-gnu/libevent_extra.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_pthreads.so
-- /usr/lib/x86_64-linux-gnu/liblua5.2.so
-- /usr/lib/x86_64-linux-gnu/libm.so
-- BUILD_DIR/deps/uriparser/lib/liburiparser.a
-- BUILD_DIR/deps/xerces-c/lib/libxerces-c.so
-- Targets:
-- Available datamodels ........... : lua null
-- Available invokers ............. : dirmon scxml
-- Available ioprocessors ......... : basichttp scxml
-- Available custom elements ...... :
-- Available language bindings .... : lua
-- General information:
-- Build type ..................... : Release for linux-x86_64-gnu
-- Building library as ............ : SHARED without plugins
-- CXX Flags : -std=c++11 -O3 -DNDEBUG
-- C Flags : -O3 -DNDEBUG
-- Definitions : USCXML_EXPORT
-- Libraries will end up in ....... : BUILD_DIR/lib
-- Binaries will end up in ........ : BUILD_DIR/bin
-- Configuring incomplete, errors occurred!
See also "/usr/uscxml/build/CMakeFiles/CMakeOutput.log".
See also "/usr/uscxml/build/CMakeFiles/CMakeError.log".
ed@ubuntu:/usr/uscxml/build$ sudo make
make: *** No targets specified and no makefile found. Stop.
from uscxml.
Well:
# starting from your uscxml source directory
$ cd contrib/cmake
$ wget https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindPackageHandleStandardArgs.cmake
And try again.
from uscxml.
mistakes again:
ed@ubuntu:/usr/uscxml/build$ sudo cmake ..
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at CMakeLists.txt:246 (INCLUDE):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
-- Could NOT find XercesC (your CMake distribution does not include the FindXercesC module)
-- --> will download and compile
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at contrib/cmake/FindLibEvent.cmake:81 (INCLUDE):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
CMakeLists.txt:276 (find_package)
-- Did not look for UriParser
-- --> will download and compile
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at contrib/cmake/FindJSC.cmake:21 (INCLUDE):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
CMakeLists.txt:332 (find_package)
-- Could NOT find JSC (missing: JSC_INCLUDE_DIR JSC_LIBRARY)
-- Your V8 installation is too old - we need >= 3.23.17
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at contrib/cmake/FindV8.cmake:70 (INCLUDE):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
CMakeLists.txt:347 (find_package)
-- Could NOT find V8 (missing: V8_LIBRARY)
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at contrib/cmake/FindLua.cmake:192 (include):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
CMakeLists.txt:364 (find_package)
-- SWIG version > 3.0.8 is recommended, found 2.0.11 - skipping DOM generation
-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- No JNI libraries found - not building Java wrappers
CMake Error: Error in cmake code at
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake:3:
Parse error. Expected "(", got newline with text "
".
CMake Error at contrib/cmake/FindLua.cmake:192 (include):
include could not find load file:
/usr/uscxml/contrib/cmake/FindPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
src/bindings/swig/lua/CMakeLists.txt:4 (find_package)
-- SWIG version > 3.0 is recommended, found 2.0.11
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Linking against libraries (check if you need to export in LD_LIBRARY_PATH or PATH):
-- /usr/lib/x86_64-linux-gnu/libcurl.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent.so
-- /usr/lib/x86_64-linux-gnu/libevent_core.so
-- /usr/lib/x86_64-linux-gnu/libevent_extra.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_openssl.so
-- /usr/lib/x86_64-linux-gnu/libevent_pthreads.so
-- /usr/lib/x86_64-linux-gnu/liblua5.2.so
-- /usr/lib/x86_64-linux-gnu/libm.so
-- BUILD_DIR/deps/uriparser/lib/liburiparser.a
-- BUILD_DIR/deps/xerces-c/lib/libxerces-c.so
-- Targets:
-- Available datamodels ........... : lua null
-- Available invokers ............. : dirmon scxml
-- Available ioprocessors ......... : basichttp scxml
-- Available custom elements ...... :
-- Available language bindings .... : lua
-- General information:
-- Build type ..................... : Release for linux-x86_64-gnu
-- Building library as ............ : SHARED without plugins
-- CXX Flags : -std=c++11 -O3 -DNDEBUG
-- C Flags : -O3 -DNDEBUG
-- Definitions : USCXML_EXPORT
-- Libraries will end up in ....... : BUILD_DIR/lib
-- Binaries will end up in ........ : BUILD_DIR/bin
-- Configuring incomplete, errors occurred!
See also "/usr/uscxml/build/CMakeFiles/CMakeOutput.log".
See also "/usr/uscxml/build/CMakeFiles/CMakeError.log".
from uscxml.
Dear Stefan !
Can then go to the variant "Generate pure LUA code via transpiling, like we do for ANSI-C with 'uscxml-transform'" ?
It could be easier now ?
from uscxml.
Try again with
# starting from your uscxml source directory
$ cd contrib/cmake
$ wget https://raw.githubusercontent.com/Kitware/CMake/d1a6d15bcd4df3d3e347411bd457be32275fb594/Modules/FindPackageHandleStandardArgs.cmake
There were some syntax changes with regard to comments in cmake it seems. Preparing transpiling is way more effort.
from uscxml.
Build has started !
But in the end there was an error when creating a target uscxmlNativeLua:
...
Linking CXX shared library lib/libuscxml_transform.so
[ 70%] Built target uscxml_transform
Scanning dependencies of target uscxml-transform
[ 72%] Building CXX object CMakeFiles/uscxml-transform.dir/apps/uscxml-transform.cpp.o
[ 73%] Building CXX object CMakeFiles/uscxml-transform.dir/contrib/src/uscxml/InterpreterOptions.cpp.o
Linking CXX executable bin/uscxml-transform
[ 73%] Built target uscxml-transform
[ 74%] Swig source
/usr/uscxml/src/bindings/swig/lua/../../../uscxml/messages/Data.h:138: Warning 509: Overloaded method uscxml::Data::at(char const *) const effectively ignored,
/usr/uscxml/src/bindings/swig/lua/../../../uscxml/messages/Data.h:131: Warning 509: as it is shadowed by uscxml::Data::at(std::string const &) const.
Scanning dependencies of target uscxmlNativeLua
[ 75%] Building CXX object
src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/uscxmlLUA_wrap.cxx.o
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx: In function ‘wchar_t* str2wstr(const char*, int)’:
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:6: error: ‘wchar’ was not declared in this scope
p=(wchar *)malloc((len+1)*sizeof(wchar_t));
^
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:13: error: expected primary-expression before ‘)’ token
p=(wchar *)malloc((len+1)*sizeof(wchar_t));
^
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:14: error: expected ‘;’ before ‘malloc’
p=(wchar *)malloc((len+1)*sizeof(wchar_t));
^
make[2]: *** [src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/uscxmlLUA_wrap.cxx.o] Error 1
make[1]: *** [src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/all] Error 2
make: *** [all] Error 2
from uscxml.
Why did you close the issue - was it resolved? And if so, how?
from uscxml.
No, I did not close the issue.
The problem persists, but at the end of build:
Scanning dependencies of target uscxmlNativeLua
[ 75%] Building CXX object src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/uscxmlLUA_wrap.cxx.o
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx: In function ‘wchar_t* str2wstr(const char_, int)’:
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:6: error: ‘wchar’ was not declared in this scope
p=(wchar *)malloc((len+1)_sizeof(wchar_t));
^
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:13: error: expected primary-expression before ‘)’ token
p=(wchar _)malloc((len+1)_sizeof(wchar_t));
^
/usr/uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:14: error: expected ‘;’ before ‘malloc’
p=(wchar _)malloc((len+1)_sizeof(wchar_t));
^
make[2]: *** [src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/uscxmlLUA_wrap.cxx.o] Error 1
make[1]: *** [src/bindings/swig/lua/CMakeFiles/uscxmlNativeLua.dir/all] Error 2
make: *** [all] Error 2
from uscxml.
‘wchar’ was not declared in file "uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:6"
from uscxml.
I can not reproduce, please tell me the OS and version you are trying to compile on, I will set it up in a VM.
from uscxml.
I am working on a virtual machine VMware Workstation Player 12.
This VM installed Ubuntu 14.04.3.
from uscxml.
The SWIG version you are using contains a bug which was fixed here. Either update SWIG to a more recent version or replace wchar.i in the SWIG Lua typemaps:
$ cd /usr/share/swig2.0/lua
$ sudo rm ./wchar.i
$ sudo wget https://raw.githubusercontent.com/swig/swig/c7ef5935496a04f3a83c70af6f841abf3ad7606e/Lib/lua/wchar.i
from uscxml.
Dear Stefan !
Everything is fine !
"uscxmlNativeLua.so" library has turned out !
Thus, this is what had to be done:
- it was necessary to additionally install the following packages:
$ cd contrib/cmake
$ sudo wget https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindLua.cmake
$ sudo wget https://raw.githubusercontent.com/Kitware/CMake/d1a6d15bcd4df3d3e347411bd457be32275fb594/Modules/FindPackageHandleStandardArgs.cmake
$ sudo wget https://raw.githubusercontent.com/Kitware/CMake/master/FindPackageMessage.cmake
$ sudo wget https://raw.githubusercontent.com/Kitware/CMake/master/CMakeParseArguments.cmake
- it was necessary to install the latest version of SWIG >= 3.0
This topic can be closed.
Thanks you !
from uscxml.
With the latest push, not even those steps are required anymore. All you'd need is the updated wchar.i
or a more current SWIG version.
from uscxml.
but the question is at the library libuscxmlNativeLua.so :
ed@ubuntu:/usr/uscxml/build$ lua -llibuscxmlNativeLua -i
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
lua: error loading module 'libuscxmlNativeLua' from file '/usr/lib/lua/5.2/libuscxmlNativeLua.so':
/usr/lib/lua/5.2/libuscxmlNativeLua.so: undefined symbol: luaopen_libuscxmlNativeLua
stack traceback:
[C]: in ?
[C]: in function '_G.require'
[C]: in ?
ed@ubuntu:/usr/uscxml/build$
from uscxml.
Dear Stefan !
Whether it is possible to do as well as examples for Java (uscxml/test/bindings/java/org/uscxml/examples/xxx.java) and for Lua?
from uscxml.
Related Issues (20)
- Install fails to link (to zlib?) HOT 2
- Swig compilation issue HOT 1
- How can you get a string for the current active state? HOT 3
- How to get list of all states in scxml-defined FSM HOT 4
- How to get data model info from interpreter HOT 3
- Question: logging to file using interpreter monitor and logger HOT 3
- including states defined in external xml files HOT 1
- getExitSet() returns an incorrect result in certain configurations
- Can’t compile on Ubuntu 20 HOT 2
- [EcmaScript JSC] Encoding UTF-8 test is failed with AccessViolation on Windows codepage 1251
- [MSVC 2015] All Ctype functions like 'isspace' should be changed to be safe
- Multiple transitions on same event in parallel not working HOT 1
- active forks, alternative projects
- Could NOT find JSC (missing: JSC_INCLUDE_DIR JSC_LIBRARY) HOT 2
- Compiling on Ubuntu 22.04 fails HOT 6
- Python examples, starting server from within Python script HOT 1
- Raspberry Pi first step fails - Unable to locate package libxerces-c HOT 1
- Raspberry Pi - nearly builds, builds a lot, then fails with `/usr/bin/ld: ./.libs/libevent.so: undefined reference to `arc4random_addrandom'` 🙄 HOT 1
- New errors on RaspPi4 once I manually built libevent and got past those errors... 😅 HOT 1
- FUCK THIS LIB HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uscxml.