add make system

This commit is contained in:
tqchen 2015-03-06 22:30:23 -08:00
parent 88ce76767e
commit 395d5c29d5
4 changed files with 37 additions and 7 deletions

View File

@ -6,7 +6,7 @@ MPIBIN = kmeans.mpi
OBJ = kmeans.o
# common build script for programs
include ../common.mk
include ../make/common.mk
# dependenies here
kmeans.rabit: kmeans.o lib

View File

@ -6,7 +6,7 @@ MPIBIN =
OBJ = linear.o
# common build script for programs
include ../common.mk
include ../make/common.mk
CFLAGS+=-fopenmp
linear.o: linear.cc ../../src/*.h linear.h ../solver/*.h
# dependenies here

View File

@ -1,13 +1,21 @@
# this is the common build script for rabit programs
# you do not have to use it
export CC = gcc
export CXX = g++
export MPICXX = mpicxx
export LDFLAGS= -pthread -lm -L../../lib -lrt
export CFLAGS = -Wall -msse2 -Wno-unknown-pragmas -fPIC -I../../include
# setup opencv
ifeq ($(USE_HDFS),1)
CFLAGS+= -DRABIT_USE_HDFS=1 -I$(HDFS_HOME)/include
LDFLAGS+= -L$(HDFS_HOME)/lib/native -lhdfs
else
CFLAGS+= -DRABIT_USE_HDFS=0
endif
.PHONY: clean all lib mpi
all: $(BIN) $(MOCKBIN)
mpi: $(MPIBIN)
lib:
@ -15,6 +23,7 @@ lib:
libmpi:
cd ../..;make lib/librabit_mpi.a;cd -
$(BIN) :
$(CXX) $(CFLAGS) -o $@ $(filter %.cpp %.o %.c %.cc, $^) -lrabit $(LDFLAGS)

View File

@ -0,0 +1,21 @@
#-----------------------------------------------------
# rabit-learn: the configuration compile script
#
# This is the default configuration setup for rabit-learn
# If you want to change configuration, do the following steps:
#
# - copy this file to the root of rabit-learn folder
# - modify the configuration you want
# - type make or make -j n for parallel build
#----------------------------------------------------
# choice of compiler
export CC = gcc
export CXX = g++
export MPICXX = mpicxx
# whether use HDFS support during compile
USE_HDFS = 1
# home of hadoop
HDFS_HOME = $(HADOOP_HDFS_HOME)