The CUDA Toolkit installs the CUDA driver and tools needed to create, build and run a CUDA application as well as libraries, header files, CUDA samples source code, and other resources
driver install to C:/Program Files/NVIDIA Corporation and C:/ProgramData/NVIDIA Corporation
tookit install to C:/Program Files/NVIDIA GPU Computing Toolkit,which contains headers,libs,tools for compiling CUDA applications. C:/ProgramData/NVIDIA GPU Computing Toolkit contains cuda plugins for Visual Studio.
verify
1 2
cd C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\bin\win64\Release ./deviceQuery.exe
cudnn
extract cudnn-8.0-windows10-x64-v5.0-ga.zip and copy include,liband bin to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0
# BOOST config set(BOOST_ROOT "C:/Boost/") set(BOOST_INCLUDEDIR ${BOOST_ROOT}/include/boost-1_64 CACHE PATH "") set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib CACHE PATH "") set(Boost_USE_MULTITHREADED ON CACHE BOOL "") set(Boost_USE_STATIC_LIBS ON CACHE BOOL "") set(Boost_USE_STATIC_RUNTIME OFF CACHE BOOL "")
edit caffe-windows/cmake/Dependencies.cmake
1 2
set(Boost_USE_STATIC_LIBS ON) find_package(Boost 1.64 REQUIRED COMPONENTS system thread filesystem)
Tips: (1) we use C:\Boost\ 1.64 to replace caffe dependencies C:\Users\zunli\.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\ 1.61, because we have compile PCL 1.8.1 with Boost 1.64 static. (2) we use caffe C:\Users\zunli\.caffe\dependencies\libraries_v140_x64_py27_1.1.0\libraries\x64\vc14\lib to replace C:/Program Files/opencv. (opencv3.1 <====opencv3.4)
Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.15063. Boost version: 1.64.0 Found the following Boost libraries: system thread filesystem chrono date_time atomic Found gflags (include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include, library: gflags_shared) Found glog (include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include, library: glog) Found PROTOBUF Compiler: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/bin/protoc.exe Found lmdb (include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include, library: lmdb) Found LevelDB (include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include, library: leveldb) Found Snappy (include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include, library: snappy_static;optimized;C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/lib/caffezlibd.lib) CUDA detected: 8.0 Found cuDNN: ver. 5.0.5 found (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64/cudnn.lib) Added CUDA NVCC flags for: sm_61 OpenCV found (C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries) Found OpenBLAS libraries: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/lib/libopenblas.dll.a Found OpenBLAS include: C:/Users/zunli/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include NumPy ver. 1.11.3 found (include: C:/Python27/lib/site-packages/numpy/core/include) Boost version: 1.64.0 Found the following Boost libraries: python
******************* Caffe Configuration Summary ******************* General: Version : 1.0.0 Git : unknown System : Windows C++ compiler : C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe Release CXX flags : /MD /O2 /Ob2 /DNDEBUG /MP /DWIN32 /D_WINDOWS /W3 /GR /EHsc Debug CXX flags : /MDd /Zi /Ob0 /Od /RTC1 /DWIN32 /D_WINDOWS /W3 /GR /EHsc Build type : Release
BUILD_SHARED_LIBS : OFF BUILD_python : ON BUILD_matlab : OFF BUILD_docs : CPU_ONLY : OFF USE_OPENCV : ON USE_LEVELDB : ON USE_LMDB : ON USE_NCCL : OFF ALLOW_LMDB_NOLOCK : OFF
# Boost if(MSVC) # use static boost on windows set(Boost_USE_STATIC_LIBS ON) # else() # use release boost on linux set(Boost_USE_STATIC_LIBS OFF) endif(MSVC)
set(Boost_USE_MULTITHREAD ON) # Find Boost package 1.64 (caffe also use Boost 1.64) find_package(Boost 1.64 REQUIRED COMPONENTS serialization date_time system filesystem thread timer math_tr1)
check the result: (1) -javaagent:C:\Users\zunli\eclipse\jee-oxygen\eclipse\lombok.jar in C:\Users\zunli\eclipse\jee-oxygen\eclipse\eclipse.ini (2) lombok.jar has been copied to eclipse plugins folder C:\Users\zunli\eclipse\jee-oxygen\eclipse\plugins.
restart eclipse and import settings.gradle.
install lombok plugin for IDEA
Install lombok plugin by File->Settings->Plugins->Browse repositories... and search for lombok online and install.
git clone https://github.com/davisking/dlib.git cd dlib && mkdir build && cd build cmake-gui ..
with options
CMAKE_INSTALL_PREFIX C:/Program Files/dlib
configure and compile with Visual Studio 2015 and install to C:/Program Files/dlib.
By default, dlib19.10.0_release_64bit_msvc1900.lib will be generated.
CMakeLists.txt
1 2 3 4 5 6 7 8 9 10 11 12
cmake_minimum_required(VERSION 2.8.12) # Every project needs a name. We call this the "examples" project. project(examples)
# Tell cmake we will need dlib. This command will pull in dlib and compile it # into your project. Note that you don't need to compile or install dlib. All # cmake needs is the dlib source code folder and it will take care of everything. add_subdirectory(../dlib dlib_build)
/* #include <pybind11/pybind11.h> namespace py = pybind11; int add(int i, int j) { return i + j; } struct Pet { Pet(const std::string &name) : name(name) { } void setName(const std::string &name_) { name = name_; } const std::string &getName() const { return name; } std::string name; }; /* module: examplelib target: examplelib cpp: example.cpp */ PYBIND11_MODULE(examplelib, m) { // optional module docstring m.doc() = "pybind11 example plugin";
// FUNCTIONS // expose add function, and add keyword arguments and default arguments m.def("add", &add, "A function which adds two numbers", py::arg("i") = 1, py::arg("j") = 2);
// DATA // exporting variables m.attr("the_answer") = 42; py::object world = py::cast("World"); m.attr("what") = world;
python3 Python 3.5.3 (v3.5.3:1880cb95a742, Jan 162017, 16:02:32) [MSC v.190064 bit (AMD64)] on win32 Type"help", "copyright", "credits"or"license"for more information. >>> import examplelib >>> help(examplelib) Help on module examplelib:
NAME examplelib - pybind11 example plugin
CLASSES pybind11_builtins.pybind11_object(builtins.object) Pet
classPet(pybind11_builtins.pybind11_object) | Method resolution order: | Pet | pybind11_builtins.pybind11_object | builtins.object | | Methods defined here: | | __init__(...) | __init__(self: examplelib.Pet, arg0: str) -> None | | getName(...) | getName(self: examplelib.Pet) -> str | | setName(...) | setName(self: examplelib.Pet, arg0: str) -> None | | ---------------------------------------------------------------------- | Methods inherited from pybind11_builtins.pybind11_object: | | __new__(*args, **kwargs) from pybind11_builtins.pybind11_type | Create andreturn a new object. See help(type) for accurate signature.
FUNCTIONS add(...) method of builtins.PyCapsule instance add(i: int = 1, j: int = 2) -> int
/* import sys print sys.path print "Hello,World!" */ py::module sys = py::module::import("sys"); py::print(sys.attr("path")); py::print("Hello, World!"); // use the Python API
/* import example n = example.add(1,2) */ py::module example = py::module::import("example"); py::object result = example.attr("add")(1, 2); int n = result.cast<int>(); assert(n == 3); std::cout << "result from example.add(1,2) = " << n << std::endl;
/* from example import MyMath obj = MyMath("v0") obj.my_add(1,2) */ py::object MyMath = py::module::import("example").attr("MyMath"); // class py::object obj = MyMath("v0"); // class object py::object my_add = obj.attr("my_add");// object method py::object result2 = my_add(1, 2); // result int n2 = result2.cast<int>(); // cast from python type to c++ type assert(n2 == 3); std::cout << "result from obj.my_add(1,2) = " << n2 << std::endl;
/* from example import MyMath obj = MyMath("v0") obj.my_strcon("abc","123"); */
# exec-prefix=/usr/local/ for /bin and /lib # prefix=/usr/local/include/libjpegturbo for /include ./configure --exec-prefix=/usr/local --prefix=/usr/local/include/libjpegturbo --with-jpeg8 --disable-static
# - Try to find LIBJPEGTURBO # # The following variables are optionally searched for defaults # LIBJPEGTURBO_ROOT_DIR: Base directory where all LIBJPEGTURBO components are found # # The following are set after configuration is done: # LIBJPEGTURBO_FOUND # LIBJPEGTURBO_INCLUDE_DIRS # LIBJPEGTURBO_LIBRARIES # LIBJPEGTURBO_LIBRARYRARY_DIRS