caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

error build caffe2 on windows with lmdb

Open PaulaQin opened this issue 9 years ago • 1 comments

I tried to build caffe2 on windows10, with python 2.7.13 and VS2017. I download lmdb files from GitHub and build libs with VS2017, then add the lmdb lib path to my environment, according to the cmake file. But when I build caffe2, it always the errors in lmdb.cc: "mkdir" donot have two agruments. Then I add these code to lmdb.cc file: #ifdef _MSC_VER #include <io.h> #include <direct.h> #else #include <unistd.h> #endif

#if defined(_WIN32) #define mkdir(name, mode) mkdir(name) #ifndef W_OK #define W_OK 02 // not defined by MSVC for whatever reason #endif #ifndef F_OK #define F_OK 00 // not defined by MSVC for whatever reason #endif #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif #endif

#ifndef O_BINARY #ifdef _O_BINARY #define O_BINARY _O_BINARY #else #define O_BINARY 0 // If this isn't defined, the platform doesn't need it. #endif #endif

There is no error now. But When I run mnist example. It can not create to or read from lmdb. So I want to know how to solve this problem?

PaulaQin avatar Jul 11 '17 02:07 PaulaQin

I believe the lmdb build is fixed in the most recent repo - could you kindly recheck? feel free to reopen.

Yangqing avatar Aug 09 '17 08:08 Yangqing