Skip to content

Instantly share code, notes, and snippets.

@vignesh0025-zz
Created November 5, 2017 14:05
Show Gist options
  • Save vignesh0025-zz/86f13865e95b2cbc3f3f491e1c6e9ab0 to your computer and use it in GitHub Desktop.
Save vignesh0025-zz/86f13865e95b2cbc3f3f491e1c6e9ab0 to your computer and use it in GitHub Desktop.
#Download and extract boost
http://www.boost.org/users/history/version_1_58_0.html
#Create a build directory
mkdir build
#Run this command
#Check the python version available
./bootstrap.sh --with-python-version=3.5 --prefix=./build --with-libraries=python
#Install the build
./b2 install
#Add the following to zshrc
export BOOST_ROOT=$HOME/Applications/boost_1_49_0/build
export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):${BOOST_ROOT}/lib
#use the following makefile
PYTHON_VERSION = 3.5
PYTHON_INCLUDE = /usr/include/python$(PYTHON_VERSION)
BOOST_INC := $(BOOST_ROOT)/include
BOOST_LIB := $(BOOST_ROOT)/lib
# compile mesh classes
TARGET = hello
$(TARGET).so: $(TARGET).o
g++ -shared -Wl,--export-dynamic $(TARGET).o -L$(BOOST_LIB) -lboost_python3 -o $(TARGET).so
$(TARGET).o: $(TARGET).c
g++ -I$(PYTHON_INCLUDE) -I$(BOOST_INC) -fPIC -c $(TARGET).c
clean:
rm -rf *.so *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment