Browse files

Add darknet-nnpack doc.

Signed-off-by: Bofu Chen (bafu) <>
  • Loading branch information...
bafu committed Oct 7, 2018
1 parent 3af2349 commit 496824e6120c41a89a5410b8a82505bc4fd64929
Showing with 53 additions and 0 deletions.
  1. +53 −0 doc/
@@ -0,0 +1,53 @@
# Get darknet-nnpack and NNPack-darknet


* When running ninja and make on RPi3, add `-j 3` parameter to prevent system from being blocked.

# Link NNPack and pthreadpool libraries

Because NNPACK-darknet only generates static libraries (.a).

1. Modify and add -fPIC (and -shared?) to cflags, still only create .a.
1. But it's okay because the key is `-fPIC`. Compiler can combine
static libraries and object files if static libraries contain
PIC object files.
1. [Patch]( darknet-nnpack source and Makefile.
* I patched C code directly because the Darknet library users will have consistent API, and do not need to initialize NNPack and pthreadpool by themselves.
* You can initialize NNPack and pthreadpool in Python ([example]( to initialize NNPack only).
* Simpler than adding `-Wl,--whole-archive /usr/lib/libnnpack.a /usr/lib/libpthreadpool.a -Wl,--no-whole-archive`
to darknet-nnpack Makefile in NNPACK section.


* Issue discussion
* Link .a to .so

# Verification

Run []( which loads libdarknet and model from system filepaths.

# Further Optimization


* Known issues:

# Upstream NNPACK (drop)


1. $ pip3 install --user --upgrade confu # update from v0.0.1 to v0.0.3, use pip3 instead of pip
1. $ sudo apt install clog

0 comments on commit 496824e

Please sign in to comment.