cmake_minimum_required(VERSION 3.4.3)
project(NeuralNet CXX)
find_package(Boost REQUIRED)
find_path(TBB_HEADER tbb/tbb.h)
find_library(TBB_LIBRARY tbb)
set(Boost_USE_STATIC_LIBS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
add_executable(nn nn.cpp)
target_link_libraries(nn ${Boost_LIBRARIES} ${TBB_LIBRARY})

cmake_minimum_required(VERSION 3.4.3)
project(NeuralNet CXX)
find_package(Boost REQUIRED)
find_path(TBB_HEADER tbb/tbb.h)
find_library(TBB_LIBRARY tbb)
set(Boost_USE_STATIC_LIBS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -march=native")
add_executable(nn nn.cpp)
target_link_libraries(nn ${Boost_LIBRARIES} ${TBB_LIBRARY})

Add -march=native CXX compiler flag.
Add -march=native CXX compiler flag.
