microsoft / TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
Other
1.2k stars 187 forks source link

Broken installation on MacOS + conda #11

Closed edran closed 6 years ago

edran commented 6 years ago

Tried to install on a fresh conda environment (conda=4.5.9, python=3.6.6, OS=High Sierra 10.13.5), but setup.sh returns the following error (when running it with pip):

+ echo 'Running setup.sh...'
Running setup.sh...
+ tatsu textworld/logic/logic.ebnf -o textworld/logic/parser.py -G textworld/logic/model.py
------------------------------------------------------------------------
         249  lines in grammar
          37  rules in grammar
         265  nodes in AST
+ cd textworld/thirdparty/
+ '[' '!' -e I7_6M62_Linux_all.tar.gz ']'
+ '[' '!' -d inform7-6M62 ']'
+ echo 'Installing Inform7 CLI'
Installing Inform7 CLI
+ cd inform7-6M62/
+ ./install-inform7.sh --prefix /Users/nantas/lab/textworld/textworld/thirdparty/inform7-6M62
+ '[' '!' -d frotz ']'
+ cd frotz/
+ make -B dumb
gcc -O2  -o src/common/buffer.o -c src/common/buffer.c
gcc -O2  -o src/common/err.o -c src/common/err.c
gcc -O2  -o src/common/fastmem.o -c src/common/fastmem.c
gcc -O2  -o src/common/files.o -c src/common/files.c
gcc -O2  -o src/common/hotkey.o -c src/common/hotkey.c
gcc -O2  -o src/common/input.o -c src/common/input.c
gcc -O2  -o src/common/main.o -c src/common/main.c
gcc -O2  -o src/common/math.o -c src/common/math.c
gcc -O2  -o src/common/object.o -c src/common/object.c
gcc -O2  -o src/common/process.o -c src/common/process.c
gcc -O2  -o src/common/quetzal.o -c src/common/quetzal.c
gcc -O2  -o src/common/random.o -c src/common/random.c
gcc -O2  -o src/common/redirect.o -c src/common/redirect.c
gcc -O2  -o src/common/screen.o -c src/common/screen.c
gcc -O2  -o src/common/sound.o -c src/common/sound.c
gcc -O2  -o src/common/stream.o -c src/common/stream.c
gcc -O2  -o src/common/table.o -c src/common/table.c
gcc -O2  -o src/common/text.o -c src/common/text.c
gcc -O2  -o src/common/variable.o -c src/common/variable.c

Archiving common code...
/usr/bin/ar rc src/frotz_common.a src/common/buffer.o src/common/err.o src/common/fastmem.o src/common/files.o src/common/hotkey.o src/common/input.o src/common/main.o src/common/math.o src/common/object.o src/common/process.o src/common/quetzal.o src/common/random.o src/common/redirect.o src/common/screen.o src/common/sound.o src/common/stream.o src/common/table.o src/common/text.o src/common/variable.o
/usr/bin/ranlib src/frotz_common.a

gcc -O2 -o src/dumb/dumb_init.o -c src/dumb/dumb_init.c
gcc -O2 -o src/dumb/dumb_input.o -c src/dumb/dumb_input.c
src/dumb/dumb_input.c:129:39: warning: implicit conversion from 'int' to 'char' changes value from 142 to -114 [-Wconstant-conversion]
      case '0': *dest++ = ZC_FKEY_MIN + 9; break;
                        ~ ~~~~~~~~~~~~^~~
src/dumb/dumb_input.c:252:32: warning: passing 'zchar *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        dumb_discard_old_input(strlen(continued_line_chars));
                                      ^~~~~~~~~~~~~~~~~~~~
/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t   strlen(const char *__s);
                            ^
src/dumb/dumb_input.c:267:14: warning: field precision should have type 'int', but argument has type 'long' [-Wformat]
          printf("%.*s", next_page - current_page, current_page);
                  ~~^~   ~~~~~~~~~~~~~~~~~~~~~~~~
src/dumb/dumb_input.c:375:10: warning: passing 'zchar *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  strcat(buf, read_line_buffer);
         ^~~
/usr/include/secure/_string.h:131:27: note: expanded from macro 'strcat'
                __builtin___strcat_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                        ^~~~
4 warnings generated.
gcc -O2 -o src/dumb/dumb_output.o -c src/dumb/dumb_output.c
gcc -O2 -o src/dumb/dumb_pic.o -c src/dumb/dumb_pic.c

Archiving dumb interface code...
/usr/bin/ar rc src/frotz_dumb.a src/dumb/dumb_init.o src/dumb/dumb_input.o src/dumb/dumb_output.o src/dumb/dumb_pic.o
/usr/bin/ranlib src/frotz_dumb.a

gcc -o dfrotz src/frotz_common.a src/frotz_dumb.a 
+ echo 'Installing cheapglk'
Installing cheapglk
+ cd glulx/cheapglk
+ make -B
cc -g -Wall -Werror -std=gnu99    -c -o cgfref.o cgfref.c
cc -g -Wall -Werror -std=gnu99    -c -o cggestal.o cggestal.c
cc -g -Wall -Werror -std=gnu99    -c -o cgmisc.o cgmisc.c
cc -g -Wall -Werror -std=gnu99    -c -o cgstream.o cgstream.c
cc -g -Wall -Werror -std=gnu99    -c -o cgstyle.o cgstyle.c
cc -g -Wall -Werror -std=gnu99    -c -o cgwindow.o cgwindow.c
cc -g -Wall -Werror -std=gnu99    -c -o cgschan.o cgschan.c
cc -g -Wall -Werror -std=gnu99    -c -o cgdate.o cgdate.c
cc -g -Wall -Werror -std=gnu99    -c -o cgunicod.o cgunicod.c
cc -g -Wall -Werror -std=gnu99    -c -o main.o main.c
cc -g -Wall -Werror -std=gnu99    -c -o gi_dispa.o gi_dispa.c
cc -g -Wall -Werror -std=gnu99    -c -o gi_blorb.o gi_blorb.c
cc -g -Wall -Werror -std=gnu99    -c -o gi_debug.o gi_debug.c
cc -g -Wall -Werror -std=gnu99    -c -o cgblorb.o cgblorb.c
cc -g -Wall -Werror -std=gnu99    -c -o agent.o agent.c
agent.c:54:5: error: '__builtin___memset_chk' will always overflow destination buffer [-Werror,-Wbuiltin-memcpy-chk-size]
    memset(sock_addr.sun_path, 0, 108);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:76:3: note: expanded from macro 'memset'
                __builtin___memset_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
agent.c:55:5: error: '__builtin___strncpy_chk' will always overflow destination buffer [-Werror,-Wbuiltin-memcpy-chk-size]
    strncpy(sock_addr.sun_path, sock_name, 108);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:124:3: note: expanded from macro 'strncpy'
                __builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
agent.c:129:16: error: variable 'dest_buf_len' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
            if(err == EINTR) {
               ^~~~~~~~~~~~
agent.c:178:12: note: uninitialized use occurs here
    return dest_buf_len;
           ^~~~~~~~~~~~
agent.c:129:13: note: remove the 'if' if its condition is always true
            if(err == EINTR) {
            ^~~~~~~~~~~~~~~~~
agent.c:111:8: error: variable 'dest_buf_len' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if(sent < 0) {
       ^~~~~~~~
agent.c:178:12: note: uninitialized use occurs here
    return dest_buf_len;
           ^~~~~~~~~~~~
agent.c:111:5: note: remove the 'if' if its condition is always false
    if(sent < 0) {
    ^~~~~~~~~~~~~~
agent.c:102:8: error: variable 'dest_buf_len' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if(sent < 0) {
       ^~~~~~~~
agent.c:178:12: note: uninitialized use occurs here
    return dest_buf_len;
           ^~~~~~~~~~~~
agent.c:102:5: note: remove the 'if' if its condition is always false
    if(sent < 0) {
    ^~~~~~~~~~~~~~
agent.c:139:5: note: variable 'dest_buf_len' is declared here
    glui32 dest_buf_len = ntohl(net_dest_buf_len);
    ^
5 errors generated.
make: *** [agent.o] Error 1

Maybe wrong default compiler / missing dependency?

tavianator commented 6 years ago

This should have been fixed by https://github.com/Microsoft/TextWorld/pull/7. From the lines of code that appear in those errors, it looks like your checkout isn't up to date. Can you try a git pull and see if the errors go away?

edran commented 6 years ago

Hi @tavianator - you are indeed right, I should have checked my working commit first :)

Closing this.

tavianator commented 6 years ago

@edran No worries! I just merged https://github.com/Microsoft/TextWorld/pull/13 which adds a couple more macOS fixes, make sure you pull that as well.