-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·28 lines (22 loc) · 1022 Bytes
/
build
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
#!/bin/bash
export LD_LIBRARY_PATH=$HOME/darknet19-gpu:$LD_LIBRARY_PATH
# get original darknet source
git clone https://github.com/pjreddie/darknet.git
# modify darknet Makefile source.
# mostly removes printf calls, so we can pipe the output into a file and parse it later
cp src/* darknet/src/
# removes compute_30 arch from original Makefile, since the amazon deep learning ami for ubuntu 18.04 uses CUDA 11 runtime, which considers compute_30 obsolete.
cp Makefile darknet/
# build the modified source code, and copy the static library (libdarknet.a) and shared library (libdarknet.so)
cd darknet
# for cpu, e.g. locally
#make
# for gpu with (ubuntu with nvidia+cuda)
make GPU=1 all
# copy out the libraries generated by make...
cp libdarknet.* ..
# ...and follow them
cd ..
# compile custom function predict_classifier_multi (and main), using external libraries generated by make
gcc -L$(pwd)/darknet -Wall -o predict_classifier_multi predict_classifier_multi.c -ldarknet
chmod 700 predict_classifier_multi