#!/usr/bin/env bash
# Optimized (slow to build)
mex CXXOPTIMFLAGS='-O0 -w -fPIC' CXXFLAGS='-DMAX_SUPPORTED_CHANNELS=1 -DNDEBUG -DUNIX_MODE -DMEXMODE -fopenmp -fPIC -ftls-model=global-dynamic' CXXLIBS='${CXXLIBS} -Wl,--export-dynamic -Wl,-e,mexFunction -shared -lgomp' -I./include/ -I/usr/include/ src/nnfMex.cpp -output nnmex -output nnmex
mex CXXOPTIMFLAGS='-O0 -w -fPIC' CXXFLAGS='-DMAX_SUPPORTED_CHANNELS=1 -DNDEBUG -DUNIX_MODE -DMEXMODE -fopenmp' CXXLIBS='${CXXLIBS} -Wl,--export-dynamic -Wl,-e,mexFunction -shared -lgomp' -I./include/ -I/usr/include/ src/voteMex.cpp -output votemex -output votemex

# Unoptimized (fast to build)
#mex CXXOPTIMFLAGS='-w -fPIC' CXXFLAGS='-DNDEBUG -DUNIX_MODE -DMEXMODE -fopenmp' CXXLIBS='${CXXLIBS} -Wl,--export-dynamic -Wl,-e,mexFunction -shared -lgomp' -inline knn.cpp mexutil.cpp nn.cpp nnmex.cpp patch.cpp vecnn.cpp simnn.cpp allegro_emu.cpp -output nnmex -output nnmex
#mex CXXOPTIMFLAGS='-w -fPIC' CXXFLAGS='-DNDEBUG -DUNIX_MODE -DMEXMODE -fopenmp' CXXLIBS='${CXXLIBS} -Wl,--export-dynamic -Wl,-e,mexFunction -shared -lgomp' -inline knn.cpp mexutil.cpp nn.cpp votemex.cpp patch.cpp vecnn.cpp simnn.cpp allegro_emu.cpp -output nnmex -output votemex

