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

Not being able to build on a Mac #5

Closed
raisen opened this issue Nov 27, 2013 · 7 comments
Closed

Not being able to build on a Mac #5

raisen opened this issue Nov 27, 2013 · 7 comments

Comments

@raisen
Copy link

raisen commented Nov 27, 2013

I am trying to build on a Mac but it's failing with the following:

c++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -O9 -funroll-all-loops -finline -ffast-math -mieee-fp -c param.cpp  -fno-common -DPIC -o .libs/param.lo
In file included from common.h:76,
                 from param.cpp:28:
./getopt.h:131: error: declaration of C function 'int getopt()' conflicts with
/usr/include/unistd.h:548: error: previous declaration 'int getopt(int, char* const*, const char*)' here

Any ideas on how to solve it?

@aritter
Copy link
Owner

aritter commented Nov 27, 2013

I have only used it on Linux so far, so unfortunately mac is currently unsupported...
I think it would be great to get it working though; would be interested to hear if you figure out how to solve this.

-Alan

@aritter aritter closed this as completed Nov 27, 2013
@aritter aritter reopened this Nov 27, 2013
@kennyjoseph
Copy link

Hey guys-

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

First, in python/cap/build.sh, remove the -static flag.

Then, instead of untarring the build of TinySVM in the repo, I used the "unofficial fork" at the following GitHub repository:
https://github.com/shogo82148/TinySVM

I then used basically the same steps as are currently in build.sh, except obviously not using the tar:

$ 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

As far as I can tell, this seems to work. I don't want to request a commit, though, because I haven't tested removing the -static flag on Linux.

Anyway, hope this helps.

@aritter
Copy link
Owner

aritter commented Jan 29, 2014

That's great, thanks so much for sharing your experience with this!

@AlJohri
Copy link

AlJohri commented Feb 20, 2014

Hey! Just wanted to let anyone know there is a much easier way to get it running on a Mac with homebrew.

brew install tinysvm
echo "c++ -o cap_classify cap_classify.cpp -ltinysvm" > python/cap/build.sh
cat test.1k.txt | python python/ner/extractEntities2.py

@aritter, should I submit a PR to modify the build.sh to change configuration automatically?

if [ "$(uname)" == "Darwin" ]; then
    c++ -o cap_classify cap_classify.cpp -ltinysvm
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/../../lib
    c++ -I. -static -L../../lib cap_classify.cpp -o cap_classify -ltinysvm
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
    echo "Get a Mac! (or linux)"
fi

P.S This issue can be closed! :)

@obuzek
Copy link

obuzek commented Feb 20, 2014

D= http://bits.blogs.nytimes.com/2014/02/19/university-of-maryland-computer-breach-exposes-records-of-students-and-staff/?partner=rss&emc=rss

olivia buzek

On Thursday, February 20, 2014 at 5:21 AM, Al Johri wrote:

Hey! Just wanted to let anyone know there is a much easier way to get it running on a Mac with homebrew.
brew install tinysvm echo "c++ -o cap_classify cap_classify.cpp -ltinysvm" > python/cap/build.sh (http://build.sh) cat test.1k.txt | python python/ner/extractEntities2.py
@aritter (https://github.com/aritter), should I submit a PR to modify the build.sh (http://build.sh) to change configuration automatically?
if [ "$(uname)" == "Darwin" ]; then c++ -o cap_classify cap_classify.cpp -ltinysvm elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:pwd/../../lib c++ -I. -static -L../../lib cap_classify.cpp -o cap_classify -ltinysvm elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then echo "Get a Mac! (or linux)" fi


Reply to this email directly or view it on GitHub (#5 (comment)).

@obuzek
Copy link

obuzek commented Feb 20, 2014

Er, sorry about that, mis-sent this email.

olivia buzek

On Thursday, February 20, 2014 at 5:25 AM, Olivia Buzek wrote:

D= http://bits.blogs.nytimes.com/2014/02/19/university-of-maryland-computer-breach-exposes-records-of-students-and-staff/?partner=rss&emc=rss

olivia buzek

On Thursday, February 20, 2014 at 5:21 AM, Al Johri wrote:

Hey! Just wanted to let anyone know there is a much easier way to get it running on a Mac with homebrew.
brew install tinysvm echo "c++ -o cap_classify cap_classify.cpp -ltinysvm" > python/cap/build.sh (http://build.sh) cat test.1k.txt | python python/ner/extractEntities2.py
@aritter (https://github.com/aritter), should I submit a PR to modify the build.sh (http://build.sh) to change configuration automatically?
if [ "$(uname)" == "Darwin" ]; then c++ -o cap_classify cap_classify.cpp -ltinysvm elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:pwd/../../lib c++ -I. -static -L../../lib cap_classify.cpp -o cap_classify -ltinysvm elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then echo "Get a Mac! (or linux)" fi


Reply to this email directly or view it on GitHub (#5 (comment)).

@aritter
Copy link
Owner

aritter commented Feb 20, 2014

@AlJohri This looks awesome, but I won't have time to check it out until next week. Anyway, a pull request sounds great.

Thanks!

@aritter aritter closed this as completed Feb 20, 2014
@AlJohri AlJohri mentioned this issue Dec 13, 2016
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