AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Mac Build Fail
 
 

Can’t get this to compile on a mac, El Capitan 10.11.5

Did the cp MacCompile.sh to ..
ran it and get in error.txt

SRC/mongodb.cpp:23:10: fatal error: ‘bson.h’ file not found
#include “bson.h”

Other cpp files find there headers prior to this line.

Look like someone has had issues as the <bson.h> are commented out in the mongodb.cpp.

also weird output with ‘command’ things too:

ChatScript-6.86\ $ ./MacCompile.sh
: command not found 1:
: command not found 3:
: command not found 5:

Thanks
Kim

 

 
  [ # 1 ]

Just the clarify the cpp file has line #include “bson.h”

 

 
  [ # 2 ]

Probably you are not even wanting MONGODB installed, so in common.h
under #elif __MACH__
#define DISCARDMYSQL 1
//#define DISCARDMONGO 1
uncomment that define so mongo is discarded.

 

 
  [ # 3 ]

OK thanks, 3 Questions:

1) Now it complies and links but does nothing when your run it, either in single terminal or client/server. I have installed on Windows in a VM too and all works there, no issues, just MAC. Yes I checked I am running the output of the link !

when I run:

$ ./BINARIES/ChatScript
ChatScript Release Version 6.86 64 bit MACH compiled Oct 27 2016 15:13:46 host=0.0.0.0
WordNet: dict=201372 fact=85707 stext=12704204 Oct23’16-10:49:29
  Dictionary building disabled.

======== Began server 6.86 compiled Oct 27 2016 15:13:46 on host 0.0.0.0 port 1024 at Thu Oct 27 15:27:40 2016 serverlog:1 userlog: 1
Server ready - logfile:LOGS/serverlog1024.txt serverLog:1 userLog:1


thats it; it never returns the prompt. Seems not writing/reading STDOUT/STDIN ?

Log Extract

======== Began server 6.86 compiled Oct 27 2016 15:13:46 on host 0.0.0.0 port 1024 at Thu Oct 27 15:22:11 2016 serverlog:1 userlog: 1
Server ready - logfile:LOGS/serverlog1024.txt serverLog:1 userLog:1

Server ChatScript Release Version 6.86 64 bit MACH compiled Oct 27 2016 15:13:46 host=0.0.0.0
Params:  dict:720895 fact:800000 text:70000kb hash:50000
      buffer:22x80kb cache:1x5000kb userfacts:100
Build0:  dict=67753 fact=130444 stext=1146028 Oct23’16-10:49:34 0
Build1:  dict=167 fact=15 stext=211788 Oct23’16-10:48:15 harry
Used 51MB: dict 269,293 (21543kb) hashdepth 18/1 fact 216,166 (8646kb) text 14185kb
        buffer (1760kb) cache (5000kb) POS: 918 (29kb)
Free 79MB: dict 451,602 hash 922 fact 583,834 text 55,814KB

  *** Server WIDE OPEN to :command use.

Seems it is ready ? thought that maybe its in server mode by default, but no, starting another instance with client parameters does not work either, it also has no STDIN ?

2) what if I want to use Mongo and Mysql ? ..... Give up on the MAC !

3) Is there a Xcode project that is up to date for Macs

 

 

 
  [ # 4 ]

SO it appears to be staring in server mode by default ?

However, in another terminal I run the client:

ChatScript-6.86\ $ ./BINARIES/ChatScript client=localhost:1024
ChatScript-6.86\ $

Nothing !

 

 
  [ # 5 ]

So discovered the code does not compile and has error:

SRC/tokenSystem.cpp:415:31: error: use of undeclared identifier ‘JSONParseCode’
                                FunctionResult result = JSONParseCode(word);
                                               

I uncommented #DISCARD JSON, but no difference as the code has no #ifdef so obviously no effect.

What is stranger is why it produces ChatScript in BINARIES with current time? As I did check this grin

So Found the XCODE directory and that builds but with the same error.

 

 
  [ # 6 ]

SO using
g++ -funsigned-char SRC/*.cpp -o BINARIES/ChatScript -lpthread -lcurl 2>err.txt

with JSON not discarded the file compiles with no error using MacCompile.sh. However does provide a prompt as above.

The Xcode does not compile with undeclared identifier ‘JSONParseCode’ as the project does not include JSON.cpp

So neither approach works yet ?

 

 
  [ # 7 ]

Sorry i meant to say it does not provide a prompt as I described above in #3

 

 
  [ # 8 ]

I have added in tokensystem.cpp #ifndef DISCARDJSON around the json parse call, so if json is not built it will not have an issue there anymore.

 

 
  [ # 9 ]

On Mac: OS X: Trying to compile using Xcode 8.1 (under Sierra 10.12.1), but failing consistently.  See error messages attached.  I am simply launching Xcode by opening MacChatScript.xcodeproj in the folder Xcode.  Am I supposed to move files around before compiling perhaps?  Or might the latest pull request address my issues (https://github.com/bwilcox-1234/ChatScript/pull/21)?

Image Attachments
Screen_Shot_2016-11-29_at_9.11.41_AM.png
 

 
  [ # 10 ]

Hey Ted, I’m maintaining the Xcode project.  It’s always a release behind, so it’s probably better to look at my latest commit and pull that, it will build.  The binary in BINARIES is also in that commit so you don’t really need to compile it.  The Xcode project has all the files in source, so you may have to update the source code by deleting the reference and the re importing the source files.  There are also -D defines you need to add to remove the javascript, server, etc stuff.  The latest from GitHub today should compile out of the box with Xcode 8.1 and Sierra since Bruce just merged my build/xcode project and that is the exact environment I’m running.  Let me know if that works for you.

 

 
  login or register to react