Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 1560620

Browse files
authored
Merge pull request #16 from killeent/nnpack-conda-cmake
make nnpack conda build with cmake
2 parents 65c2c2d + e213b9b commit 1560620

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

conda/nnpack/build.sh

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
#!bin/bash
22

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

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

11-
# patch ninja file to compile with -fPIC support
12-
sed -ibuild.ninja.bak "s/cflags = /cflags = -fPIC /" build.ninja
13-
sed -ibuild.ninja.bak "s/cxxflags = /cxxflags = -fPIC /" build.ninja
14-
15-
ninja
16-
17-
# move files to expected location
18-
mkdir -p $PREFIX/include
19-
mkdir -p $PREFIX/lib
20-
21-
cp -p include/nnpack.h $PREFIX/include
22-
cp -p lib/libnnpack.a $PREFIX/lib
23-
cp -p lib/libpthreadpool.a $PREFIX/lib
24-
cp -p deps/pthreadpool/include/pthreadpool.h $PREFIX/include
14+
# cp -p include/nnpack.h $PREFIX/include
15+
# cp -p lib/libnnpack.a $PREFIX/lib
16+
# cp -p lib/libpthreadpool.a $PREFIX/lib
17+
# cp -p deps/pthreadpool/include/pthreadpool.h $PREFIX/include

0 commit comments

Comments
 (0)