Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS #17

Open
AmenRa opened this issue Nov 15, 2016 · 3 comments
Open

MacOS #17

AmenRa opened this issue Nov 15, 2016 · 3 comments

Comments

@AmenRa
Copy link

AmenRa commented Nov 15, 2016

Hello, is it possibile to use this tool on MacOS or it runs only on Linux?
I read that Linux is a requirement but I tried anyway to run it and I got an error at compile time:

./getopt.h:131:12: error: conflicting types for 'getopt'
extern int getopt ();
           ^
/usr/include/unistd.h:503:6: note: previous declaration is here
int      getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);
         ^
param.cpp:217:17: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
    char *tmp = "TinySVM::Param::set";
                ^
1 warning and 1 error generated.
make[2]: *** [param.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is this related to MacOS?

@lx865712528
Copy link

I met this too, but it seems TinySVM is to be blamed.

@AlJohri
Copy link

AlJohri commented Dec 13, 2016

#5 (comment)

@Johnsonxiong
Copy link

Johnsonxiong commented Dec 4, 2017

Hey, guys, good news for Mac users!

I ended up being able to build on Mac (10.12.6) by doing the following:

Download TinySVM and unzip it to the folder of twitter_nlp-master:
https://github.com/shogo82148/TinySVM

Change build.sh in twitter_nlp-master as below:
cd hbc/models
gcc -O3 labels.c stats.c samplib.c LabeledLDA_infer_stdin.c -o LabeledLDA_infer_stdin.out -lm
cd ../../TinySVM
./configure --prefix=pwd/../ && make && make install
cd ../python/cap
./build.sh

Then change the python/cap/build.sh into like below:

c++ -o cap_classify cap_classify.cpp -ltinysvm

Then run
$ ./build.sh
$ export TWITTER_NLP=./
$ cat test.1k.txt | python2 python/ner/extractEntities2.py

Dont forget to install tinysvm anyway using :
$ brew install tinysvm

This works!
Below is part of the result:
@Jessica_Chobot/O did/O you/O see/O the/O yakuza/B-ENTITY vs/O zombies/O ..../O smh/O but/O cool/O at/O the/O same/O time/O
RT/O @daviddesrosiers/O :/O Happy/O birthday/O @chuckcomeau/O !/O have/O fun/O in/O vancouver/B-ENTITY tonight/O !/O
Spotted/O :/O Kanye/B-ENTITY West/I-ENTITY Celebrates/O LAMB/B-ENTITY With/O Gwen/B-ENTITY Stefani/I-ENTITY :/O New/B-ENTITY York/I-ENTITY Fashion/I-ENTITY Week/I-ENTITY is/O coming/O to/O a/O close/O ,/O but/O not/O before/O .../O http://bit.ly/cSyZUi/O
@zeeDOTi/O i/O might/O join/O in/O if/O I/O make/O it/O home/O in/O time/O ./O :)/O

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@AlJohri @lx865712528 @AmenRa @Johnsonxiong and others