Code Monkey home page Code Monkey logo

Comments (27)

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

I would be interested in the following approach: embed the uscxml interpreter as a LUA module.

Thank you !

from uscxml.

sradomski avatar sradomski commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

Oh, and if you find some deficiencies, we can most definitely polish the API some more - currently, all of it is generated.

from uscxml.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

ed@ubuntu:/usr/uscxml/build$ sudo cmake --version
cmake version 2.8.12.2
ed@ubuntu:/usr/uscxml/build$

from uscxml.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

sradomski avatar sradomski commented on August 21, 2024

Why did you close the issue - was it resolved? And if so, how?

from uscxml.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

‘wchar’ was not declared in file "uscxml/build/src/bindings/swig/lua/uscxmlLUA_wrap.cxx:2010:6"

from uscxml.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

I am working on a virtual machine VMware Workstation Player 12.
This VM installed Ubuntu 14.04.3.

from uscxml.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

Dear Stefan !

Everything is fine !
"uscxmlNativeLua.so" library has turned out !

Thus, this is what had to be done:

  1. 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

  1. it was necessary to install the latest version of SWIG >= 3.0

This topic can be closed.
Thanks you !

from uscxml.

sradomski avatar sradomski commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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.

EduardShaid avatar EduardShaid commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.