asitang / word2vec

Automatically exported from code.google.com/p/word2vec
0 stars 0 forks source link

Build for Mac? #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
On a Mac:
1. svn checkout http://word2vec.googlecode.com/svn/trunk/
2. make

What is the expected output?
Binary is emitted.

What do you see instead?
pindari:word2vec pmonks$ make
gcc word2vec.c -o word2vec -lm -pthread -Ofast -march=native -Wall 
-funroll-loops -Wno-unused-result
cc1: error: invalid option argument ‘-Ofast’
cc1: error: unrecognized command line option "-Wno-unused-result"
word2vec.c:1: error: bad value (native) for -march= switch
word2vec.c:1: error: bad value (native) for -mtune= switch
make: *** [word2vec] Error 1
pindari:word2vec pmonks$

What version of the product are you using?
SVN r32

On what operating system?
Mac OSX 10.8.4

Original issue reported on code.google.com by peter.mo...@alfresco.com on 15 Aug 2013 at 5:45

GoogleCodeExporter commented 9 years ago
Updating gcc will fix this issue: e.g., 
http://superuser.com/questions/517218/how-do-i-install-gcc-4-7-2-on-os-x-10-8. 
(You'll probably have other issues after that, though. I still can't get this 
to work on OS X.)

Original comment by jesse.cz...@gmail.com on 15 Aug 2013 at 6:34

GoogleCodeExporter commented 9 years ago
Got it to work with the following steps:

1) Update gcc to 4.7: 
http://superuser.com/questions/517218/how-do-i-install-gcc-4-7-2-on-os-x-10-8
2) Change "-march=native" to "-msse4.2" in makefile
3) Add "-I/usr/include/sys" to makefile "CFLAGS = " statement

Original comment by jesse.cz...@gmail.com on 15 Aug 2013 at 7:22

GoogleCodeExporter commented 9 years ago
It compiles if you remove the -Ofast, -Wno-unused-result and -march gcc 
options, and replace malloc.h with stdlib.h in the include statements. There 
might be a better way, though.

Original comment by eaton....@gmail.com on 15 Aug 2013 at 8:01

GoogleCodeExporter commented 9 years ago
Thanks eaton...@gmail.com - that appears to have worked (binaries run, at least 
when not provided with arguments).

Original comment by peter.mo...@alfresco.com on 15 Aug 2013 at 8:15