1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#---------------------------------------------------------------------------------------
# mshadow configuration script
#
# include dmlc.mk after the variables are set
#
# Add DMLC_CFLAGS to the compile flags
# Add DMLC_LDFLAGS to the linker flags
#----------------------------------------------------------------------------------------
ifndef LIBJVM
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
endif
# Mac OS X does not support "-lrt" flag
ifeq ($(OS), Windows_NT)
UNAME=Windows
MACHINE=Windows
else
UNAME=$(shell uname)
MACHINE=$(shell $(CC) -dumpmachine)
endif
ifneq ($(USE_OPENMP), 0)
DMLC_CFLAGS += -fopenmp
DMLC_LDFLAGS += -fopenmp
endif
ifeq (-android, $(findstring -android,$(MACHINE)))
#$(info $$MACHINE is [${MACHINE}])
#$(info detected ANDROID)
else
ifeq (-linux, $(findstring -linux,$(MACHINE)))
#$(info detected Linux)
DMLC_LDFLAGS += -lrt
endif
endif
# handle fpic options
ifndef WITH_FPIC
WITH_FPIC = 1
endif
ifeq ($(WITH_FPIC), 1)
DMLC_CFLAGS += -fPIC
endif
# Using default hadoop_home
ifndef HADOOP_HDFS_HOME
HADOOP_HDFS_HOME=$(HADOOP_HOME)
endif
ifeq ($(USE_HDFS),1)
ifndef HDFS_INC_PATH
HDFS_INC_PATH=$(HADOOP_HDFS_HOME)/include
endif
ifndef HDFS_LIB_PATH
HDFS_LIB_PATH=$(HADOOP_HDFS_HOME)/lib/native
endif
DMLC_CFLAGS+= -DDMLC_USE_HDFS=1 -I$(HDFS_INC_PATH) -I$(JAVA_HOME)/include
ifneq ("$(wildcard $(HDFS_LIB_PATH)/libhdfs.so)","")
DMLC_LDFLAGS+= -L$(HDFS_LIB_PATH) -lhdfs
else
DMLC_LDFLAGS+= $(HDFS_LIB_PATH)/libhdfs.a
endif
DMLC_LDFLAGS += -L$(LIBJVM) -ljvm
ifeq ($(UNAME), Darwin)
DMLC_LDFLAGS += -Wl,-rpath,$(LIBJVM)
else
DMLC_LDFLAGS += -Wl,-rpath=$(LIBJVM)
endif
else
DMLC_CFLAGS+= -DDMLC_USE_HDFS=0
endif
# setup S3
ifeq ($(USE_S3),1)
DMLC_CFLAGS+= -DDMLC_USE_S3=1
DMLC_LDFLAGS+= -lcurl -lssl -lcrypto
else
DMLC_CFLAGS+= -DDMLC_USE_S3=0
endif
ifeq ($(USE_GLOG), 1)
DMLC_CFLAGS += -DDMLC_USE_GLOG=1
DMLC_LDFLAGS += -lglog
endif
ifeq ($(USE_AZURE),1)
DMLC_CFLAGS+= -DDMLC_USE_AZURE=1
DMLC_LDFLAGS+= -lazurestorage
else
DMLC_CFLAGS+= -DDMLC_USE_AZURE=0
endif
|