Skip to content

make nnpack conda build with cmake #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions conda/nnpack/build.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
#!bin/bash

# Instead of Conda packaging these dependencies, we expect them to be installed
# pip install --upgrade git+https://github.com/Maratyszcza/PeachPy
# pip install --upgrade git+https://github.com/Maratyszcza/confu
# conda install -c conda-forge ninja
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true
make -j$(getconf _NPROCESSORS_CONF)
make install
cd ..

confu setup
$PYTHON ./configure.py
# These are the files we actually care about. If we wanted to
# isolate them, we could make install into a different location
# and then copy them into $PREFIX

# patch ninja file to compile with -fPIC support
sed -ibuild.ninja.bak "s/cflags = /cflags = -fPIC /" build.ninja
sed -ibuild.ninja.bak "s/cxxflags = /cxxflags = -fPIC /" build.ninja

ninja

# move files to expected location
mkdir -p $PREFIX/include
mkdir -p $PREFIX/lib

cp -p include/nnpack.h $PREFIX/include
cp -p lib/libnnpack.a $PREFIX/lib
cp -p lib/libpthreadpool.a $PREFIX/lib
cp -p deps/pthreadpool/include/pthreadpool.h $PREFIX/include
# cp -p include/nnpack.h $PREFIX/include
# cp -p lib/libnnpack.a $PREFIX/lib
# cp -p lib/libpthreadpool.a $PREFIX/lib
# cp -p deps/pthreadpool/include/pthreadpool.h $PREFIX/include