Created
July 26, 2019 05:25
-
-
Save ninjakx/f18242a00e907c808650dfdc8891ffdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm *.o myknn_wrap.cpp _myknn.so myknn.py | |
rm -rf __pycache__ | |
g++ -O3 -march=native -fPIC -c myknn.cpp | |
# Invoke SWIG on the interface file 'knn.i' to produce C/C++ wrapper | |
# code ('knn_wrap.cpp'): | |
swig -python -c++ -o myknn_wrap.cpp myknn.i | |
# Next, compile the wrapper code: | |
g++ -O3 -march=native -w -fPIC -c $(pkg-config --cflags --libs python3) -I /home/kriti/anaconda3/lib/python3.7/site-packages/numpy/core/include myknn.cpp myknn_wrap.cpp | |
g++ -std=c++11 -O3 -march=native -shared myknn.o myknn_wrap.o -o _myknn.so -lm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment