ceu-lang / ceu

The Programming Language Céu

Home Page:http://www.ceu-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errors with "make samples"

wluker opened this issue · comments

$ make samples

is printing errors

>>> ERROR : expected option `ceu-features-dynamic`

For example the first sample prints:

##########################################################################
File: samples/test-04.ceu -> /tmp/test-04
Description: Prints "Lua X" every second from three `lua` states.
Features:
 - three `lua` states: one global and two local
##########################################################################
Press <enter> to start...
ceu --pre --pre-input=samples/test-04.ceu --pre-args="-I./include" --ceu --ceu-features-lua=true --ceu-features-thread=true --ceu-err-unused=pass --env --env-types=env/types.h --env-threads=env/threads.h --env-main=env/main.c --cc --cc-args="-llua5.3 -lpthread" --cc-output=/tmp/test-04
>>> ERROR : expected option `ceu-features-dynamic`
/bin/sh: line 20: /tmp/test-04: No such file or directory
>>> OK

Does this mean the sample is failing?

Yes, it is still failing.
You should now checkout the master branch and try again:

$ git checkout master
$ make samples

Please, let me know if it works.

Thanks! That fixed that issue, but now the compiler can't find lua5.3/lua.h. On arch linux it looks like lua5.3 is the default lua, so lua.h is /usr/include/lua.h.

##########################################################################
File: samples/test-00.ceu -> /tmp/test-00
Description: Terminates immediatelly with an `escape`.
Features:
 - `escape`
##########################################################################
Press <enter> to start...
ceu --pre --pre-input=samples/test-00.ceu --pre-args="-I./include" --ceu --ceu-features-lua=true --ceu-features-thread=true --ceu-features-dynamic=true --ceu-err-unused=pass --env --env-types=env/types.h --env-threads=env/threads.h --env-main=env/main.c --cc --cc-args="-llua5.3 -lpthread" --cc-output=/tmp/test-00
>>> ERROR : /tmp/lua_GnX6O5:650:10: fatal error: lua5.3/lua.h: No such file or directory
 #include <lua5.3/lua.h>
          ^~~~~~~~~~~~~~
compilation terminated.

/bin/sh: line 20: /tmp/test-00: No such file or directory
>>> OK

On arch pkg-config --modversion lua returns 5.3.4, and pkg-config --libs --cflags lua returns -llua -lm.

Ok, this is a bit trickier to fix.

As a workaround for now, you have two options:

  1. Disable support for lua in the Makefile:
    • remove --ceu-features-lua=true and -llua5.3
    • only the examples that use embedded Lua within Céu will not compile
  2. Edit two files:
    • Makefile: change -llua5.3 to -llua
    • src/c/ceu.c: change #include <lua5.3/*> to #include <lua/*>

I used option 2 and make samples now passes. Thanks.

#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>

Ceu looks very interesting. I look forward to learning it.

Great!
Thanks for your interest in Céu.
If you have any questions, feel free to contact me directly.
We also have a mailing list and a chat.