Created
September 8, 2015 12:07
-
-
Save shun91/ed604455722cd170e727 to your computer and use it in GitHub Desktop.
LIBLINEAR 2.01 の Makefile に cross-validation の評価尺度変更のコードを追記したもの.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LIBLINEAR 2.01 の Makefile に cross-validation の評価尺度変更のコードを追記したもの. | |
# | |
# cross-validation の評価尺度変更 | |
# http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/eval/ | |
CXX ?= g++ | |
CC ?= gcc | |
CFLAGS = -Wall -Wconversion -O3 -fPIC | |
LIBS ?= blas/blas.a | |
SHVER = 3 | |
OS = $(shell uname) | |
#LIBS = -lblas | |
all: train predict | |
lib: linear.o tron.o blas/blas.a | |
if [ "$(OS)" = "Darwin" ]; then \ | |
SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \ | |
else \ | |
SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear.so.$(SHVER)"; \ | |
fi; \ | |
$(CXX) $${SHARED_LIB_FLAG} linear.o tron.o blas/blas.a -o liblinear.so.$(SHVER) | |
train: tron.o linear.o train.c blas/blas.a eval.o | |
$(CXX) $(CFLAGS) -o train train.c tron.o eval.o linear.o $(LIBS) | |
predict: tron.o linear.o predict.c blas/blas.a eval.o | |
$(CXX) $(CFLAGS) -o predict predict.c tron.o eval.o linear.o $(LIBS) | |
tron.o: tron.cpp tron.h | |
$(CXX) $(CFLAGS) -c -o tron.o tron.cpp | |
linear.o: linear.cpp linear.h | |
$(CXX) $(CFLAGS) -c -o linear.o linear.cpp | |
blas/blas.a: blas/*.c blas/*.h | |
make -C blas OPTFLAGS='$(CFLAGS)' CC='$(CC)'; | |
clean: | |
make -C blas clean | |
make -C matlab clean | |
rm -f *~ tron.o linear.o train predict liblinear.so.$(SHVER) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment