Git Product home page Git Product logo

Comments (18)

willyd avatar willyd commented on May 28, 2024

Depends on what you want. LevelDB python bindings are not installed by caffe-builder. The exe you mention are there because caffe requires leveldb c++ and pycaffe requires both leveldb c++ and pyleveldb. Please see BVLC/caffe#15 and/or ask @lunzueta or @happynear for help on getting pyleveldb installed.

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

Building leveldb.lib is easy, as there are many resources. However, I
could not find any reference on building the python binding.

On Tue, Sep 15, 2015 at 11:36 PM Guillaume Dumont [email protected]
wrote:

Depends on what you want. LevelDB python bindings are not installed by
caffe-builder. The exe you mention are there because caffe requires leveldb
c++ and pycaffe requires both leveldb c++ and pyleveldb. Please see
BVLC/caffe#15 BVLC/caffe#15 and/or ask
@lunzueta https://github.com/lunzueta or @happynear
https://github.com/happynear for help on getting pyleveldb installed.


Reply to this email directly or view it on GitHub
#12 (comment)
.

Regards,
David

from caffe-builder.

happynear avatar happynear commented on May 28, 2024

@davidshen84
I guess you can read Mandarin from your name. Here is a blog describes how to build leveldb.pyd:
http://blog.csdn.net/toontong/article/details/8442995

If you cannot read it. Try this repository:
https://github.com/chirino/leveldb/blob/master/WINDOWS.md

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

@happynear I have build leveldb from @chirino 's repository, and got the lib files. The code snippet in that blog seems very old. I will try if it still applies. Thanks.

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

My working environment is Windows 8 64 bit, VS 2012, leveldb 0.193. I added these lines to the setup.py file in leveldb:

else:
  #print >>sys.stderr, "Don't know how to compile leveldb for %s!" % system
  #sys.exit(0)
  extra_compile_args = common_flags + [
      '-fPIC',
      '-Wall',
      '-g2',
      '-D_GNU_SOURCE',
      '-O2',
      '-DNDEBUG',
      '-DLEVELDB_PLATFORM_WINDOWS',
      ]
  extra_link_args = ['shlwapi.lib', 'snappy.lib','leveldb.lib',]

And made some other changed by following the blog. The error message I got was:

running build
running build_ext
building 'leveldb' extension
error: [Error 2] ???????????

The ? are literal...so I have no idea what it is.

from caffe-builder.

happynear avatar happynear commented on May 28, 2024

@davidshen84
I have just created a new repository https://github.com/happynear/py-leveldb-windows .
Sorry that I am not familiar with cmake, so I just created a VS project.
May it help.

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

Indeed it helps. Thanks a lot!

On Wed, Sep 16, 2015 at 5:26 PM Feng Wang [email protected] wrote:

@davidshen84 https://github.com/davidshen84
I have just created a new repository
https://github.com/happynear/py-leveldb-windows .
Sorry that I am not familiar with cmake, so I just created a VS project.
May it help.


Reply to this email directly or view it on GitHub
#12 (comment)
.

Regards,
David

from caffe-builder.

vfdev-5 avatar vfdev-5 commented on May 28, 2024

A CMake version to compile python leveldb wrapper under Windows using Caffe-builder dependencies:
https://github.com/vfdev-5/py-leveldb-windows

from caffe-builder.

happynear avatar happynear commented on May 28, 2024

@vfdev-5
Thanks for your work.

from caffe-builder.

willyd avatar willyd commented on May 28, 2024

@vfdev-5 Thanks. I might consider integrating this in caffe-builder at some point.

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

@willyd I am trying to integrate @vfdev-5 's work into caffe-builder, but I am stuck at setting the build type. LevelDB python build need to link with python library files. But I don't have the debug version of the python.lib file, and I think most people will not have it either. So only the Release could success.

Now I could not find a way to pass some arguments to your buildem_cmake_recipe macro to only build Release build for this project.

Please kindly advice.

Thanks,
David

from caffe-builder.

vfdev-5 avatar vfdev-5 commented on May 28, 2024

If you modify the file cmake/packages/leveldb.cmake

set(leveldb_CMAKE_ARGS 
    -DBUILD_SHARED_LIBS=OFF
    -DCMAKE_DEBUG_POSTFIX=d

    -DCMAKE_BUILD_TYPE=Release

    -DBoost_USE_STATIC_LIBS=ON
    -DBoost_USE_MULTITHREAD=ON
    -DBoost_USE_STATIC_RUNTIME=OFF   
    )

it does not work ?

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

@vfdev-5 MSVC does not accept build type in configuration, it has to be specified at build type. So I guess it won't work.

But I saw you were using nmake. Maybe it works with nmake. But I will have to find a way to let nmake build in 32/64 bit mode.

from caffe-builder.

vfdev-5 avatar vfdev-5 commented on May 28, 2024

The way to choose 32 or 64 bit mode can be defined, for example, with
vcvarsall.bat (https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx).
Somewhere in Visual Studio folder you, probably, have a folder with .bat
files which define an environment to compile in a chosen mode. E.g C:\Program
Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
Hope it helps

On Mon, Dec 28, 2015 at 1:32 PM, Xi Shen [email protected] wrote:

@vfdev-5 https://github.com/vfdev-5 MSVC does not accept build type in
configuration, it has to be specified at build type. So I guess it won't
work.

But I saw you were using nmake. Maybe it works with nmake. But I will have
to find a way to let nmake build in 32/64 bit mode.


Reply to this email directly or view it on GitHub
#12 (comment)
.

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

But I prefer not to relay on the .bat file. I want to integrate the
py-leveldb into the caffe-builder.

On Mon, Dec 28, 2015 at 10:15 PM vfdev [email protected] wrote:

The way to choose 32 or 64 bit mode can be defined, for example, with
vcvarsall.bat (https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx).
Somewhere in Visual Studio folder you, probably, have a folder with .bat
files which define an environment to compile in a chosen mode. E.g
C:\Program
Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
Hope it helps

On Mon, Dec 28, 2015 at 1:32 PM, Xi Shen [email protected] wrote:

@vfdev-5 https://github.com/vfdev-5 MSVC does not accept build type in
configuration, it has to be specified at build type. So I guess it won't
work.

But I saw you were using nmake. Maybe it works with nmake. But I will
have
to find a way to let nmake build in 32/64 bit mode.


Reply to this email directly or view it on GitHub
<
https://github.com/willyd/caffe-builder/issues/12#issuecomment-167562113>
.


Reply to this email directly or view it on GitHub
#12 (comment)
.

Regards,
David

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

@vfdev-5 do you know why we want to enforce build a Debug version? I am trying to find a way to only build a Release version for my pyleveldb project, without changing https://github.com/willyd/caffe-builder/blob/master/cmake/buildem_cmake_recipe.cmake#L36.

from caffe-builder.

willyd avatar willyd commented on May 28, 2024

Hi @davidshen84 why not add an option like this:

option(BUILD_DEBUG_AND_RELEASE "Build debug and release simultaneously" ON)
    if(MSVC AND BUILD_DEBUG_AND_RELEASE)        

        externalproject_add_step(${_name} BuildOtherConfig
                            COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR} --config "$<$<CONFIG:Debug>:Release>$<$<CONFIG:Release>:Debug>" --target INSTALL
                            DEPENDEES install
                            )
    endif()

and then you can disable this option on the command-line how does that sound?

from caffe-builder.

davidshen84 avatar davidshen84 commented on May 28, 2024

Hi @guillaume,

I see. I will try that out.

Thanks,
David

On Mon, Jan 4, 2016 at 11:32 PM Guillaume Dumont [email protected]
wrote:

Hi @davidshen84 https://github.com/davidshen84 why not add an option
like this:

option(BUILD_DEBUG_AND_RELEASE "Build debug and release simultaneously" ON)
if(MSVC AND BUILD_DEBUG_AND_RELEASE)

    externalproject_add_step(${_name} BuildOtherConfig
                        COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR} --config "$<$<CONFIG:Debug>:Release>$<$<CONFIG:Release>:Debug>" --target INSTALL
                        DEPENDEES install
                        )
endif()

and then you can disable this option on the command-line how does that
sound?


Reply to this email directly or view it on GitHub
#12 (comment)
.

Regards,
David

from caffe-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.