Browse Source

sync with master, commit id: 02737b5e32

pull/12525/head
zhanghaibo5 5 years ago
parent
commit
cfd4ba5ed0
3 changed files with 88 additions and 0 deletions
  1. +44
    -0
      mindspore/lite/examples/train_lenet/Makefile
  2. +41
    -0
      mindspore/lite/examples/transfer_learning/Makefile
  3. +3
    -0
      model_zoo/official/cv/centerface/dependency/centernet/src/lib/external/Makefile

+ 44
- 0
mindspore/lite/examples/train_lenet/Makefile View File

@@ -0,0 +1,44 @@
BASE_DIR=$(realpath ../../../../)
APP:=bin/net_runner
MSLIB:=mindspore-lite
LMDLIB:=-lminddata-lite -ljpeg
LHIAILIB:=-lhiai_ir_build -lhiai_ir -lhiai
MSDIR:=$(realpath package-$(TARGET)/lib)

SRC:=src/net_runner.cc
OBJ:=$(SRC:.cc=.o)

CFLAGS := -Ofast -std=c++17 \
-I . \
-I ./msl \
-I ./msl/minddata \
-I ./msl/third_party/flatbuffers/include


ifeq ($(TARGET),arm64)
CXX := ${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
CFLAGS += --target=aarch64-none-linux-android21 --gcc-toolchain=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fdata-sections -ffunction-sections
LDFLAGS := --target=aarch64-none-linux-android21 --gcc-toolchain=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Wl,--gc-sections
LDFLAGS += -L$(MSDIR) -l$(MSLIB) $(LMDLIB) -pthread -llog -latomic -lm $(LHIAILIB)
else
CFLAGS += -g
LDFLAGS := -L$(MSDIR) -l$(MSLIB) $(LMDLIB) -lpthread -Wl,-rpath,$(MSDIR)
endif
LD := ${CXX}


all:$(APP)

$(APP): $(OBJ) $(MSDIR)/lib$(MSLIB).so
@mkdir -p bin
$(LD) $(OBJ) $(LDFLAGS) -o $@

clean:
rm -rf src/*.o bin/


mrproper:
rm -rf package* msl src/*.o bin/ model/*.mindir model/*.ms model/*.so model/converter_lite

%.o:%.cc
$(CXX) $(CFLAGS) -c $< -o $@

+ 41
- 0
mindspore/lite/examples/transfer_learning/Makefile View File

@@ -0,0 +1,41 @@
BASE_DIR=$(realpath ../../../../)
APP:=bin/net_runner
MSLIB:=mindspore-lite
MSDIR:=$(realpath package-$(TARGET)/lib)

SRC:=src/net_runner.cc src/dataset.cc
OBJ:=$(SRC:.cc=.o)

CFLAGS := -Ofast -std=c++17 \
-I . \
-I ./msl \
-I ./msl/third_party/flatbuffers/include


ifeq ($(TARGET),arm64)
CXX := ${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
CFLAGS += --target=aarch64-none-linux-android21 --gcc-toolchain=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fdata-sections -ffunction-sections
LDFLAGS := --target=aarch64-none-linux-android21 --gcc-toolchain=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Wl,--gc-sections
LDFLAGS += -L$(MSDIR) -l$(MSLIB) -pthread -llog -latomic -lm
else
CFLAGS += -g
LDFLAGS := -L$(MSDIR) -l$(MSLIB) -lpthread -Wl,-rpath,$(MSDIR)
endif
LD := ${CXX}


all:$(APP)

$(APP): $(OBJ) $(MSDIR)/lib$(MSLIB).so
@mkdir -p bin
$(LD) $(OBJ) $(LDFLAGS) -o $@

clean:
rm -rf src/*.o bin/


mrproper:
rm -rf dataset package* msl src/*.o bin/ model/*.mindir model/*.ms model/*.so model/converter_lite

%.o:%.cc
$(CXX) $(CFLAGS) -c $< -o $@

+ 3
- 0
model_zoo/official/cv/centerface/dependency/centernet/src/lib/external/Makefile View File

@@ -0,0 +1,3 @@
all:
python setup.py build_ext --inplace
rm -rf build

Loading…
Cancel
Save