clingku / w2v_kr

This repository includes scripts and text resources related to the task of automatic compositionality detection using word2vec embeddings. We test the applicability of the method to ambiguous phrases for Korean language.
Apache License 2.0
1 stars 0 forks source link

compile관련 #7

Open hauni opened 7 years ago

hauni commented 7 years ago

이 thread에서는 c compile할 때 생기는 문제점 들 올리기로.

그전에 참고사항: makefile 말씀하셨는데, makefile을 다운받으셔서 같은 directory에 두시고

make distance 라고 치시면, 거기서 지정한 distance.c 파일 컴파일링이 진행돼요. make clean 라고 치면 기존에 생성된 실행파일이 모두 삭제

컴파일 에러는 sqrt 관련이라면 컴파일할때 math library 추가 안 해서 그런거 같아요 gcc -o distance2 distance2.c -lm 아마도 이것? 흠 정확한 건 기억이 가물가물

CFLAGS에 -lm이 들어 있네. 그거 이외에도 여러개가. 모두 넣어야 된다는 말?

============ http://word2vec.googlecode.com/svn/trunk/ http://word2vec.googlecode.com/svn/trunk/makefile CC = gcc

Using -Ofast instead of -O3 might result in faster code, but is supported only by newer GCC versions

CFLAGS = -lm -pthread -O3 -march=native -Wall -funroll-loops -Wno-unused-result

all: word2vec word2phrase distance word-analogy compute-accuracy

word2vec : word2vec.c $(CC) word2vec.c -o word2vec $(CFLAGS) word2phrase : word2phrase.c $(CC) word2phrase.c -o word2phrase $(CFLAGS) distance : distance.c $(CC) distance.c -o distance $(CFLAGS) word-analogy : word-analogy.c $(CC) word-analogy.c -o word-analogy $(CFLAGS) compute-accuracy : compute-accuracy.c $(CC) compute-accuracy.c -o compute-accuracy $(CFLAGS) chmod +x *.sh

clean: rm -rf word2vec word2phrase distance word-analogy compute-accuracy