Coder Social home page Coder Social logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
+1 from me. Swig does support python 3, so it should be very easy to to build a 
btk for python 3. 
http://www.swig.org/Doc3.0/SWIGDocumentation.html#Python_python3support

Original comment by [email protected] on 17 Sep 2014 at 6:44

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi,
it is very easy indeed. I just compiled python 3 compatible bindings for linux 
by simply adding the string -py3 to the swig flags variable in the swig config 
file. I tried to compile it for windows but finally gave up because I had no 64 
bit compiler. In sum, if the build environment is properly configured to 
produce python 2 bindings, producing python 3 binding is straightforward.


Original comment by [email protected] on 17 Sep 2014 at 7:55

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi again,
just to clarify, because it took some minutes to remember what I did once I 
have to repeat the process. It is a bit hackish, but for the time being it 
generates a fully functional (as far as I can tell) python 3 wrapper for b-tk.

Modify the file b-tk.core/Wrapping/Python/CMakeLists.txt 

In line 23 it says:
SET(CMAKE_SWIG_FLAGS "")

and should read
SET(CMAKE_SWIG_FLAGS "-py3")

That's it! If anyone can compile it for windows32/64, please share the library 
or the specific method, because I haven't been able after a couple of hours of 
frustation.

Best,
Jorge

Original comment by [email protected] on 15 Dec 2014 at 4:10

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi,
I just noticed that the method I posted only generates functional python 
extensions for 32 bit versions. I haven't been able to determine the problem 
for 64 bit linux compilations, and for the time being I will give up on this 
because I use it mostly in a 32 bit distribution.

Original comment by [email protected] on 7 Feb 2015 at 11:08

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi,

based on your comments, I manage to port generate python 3.4 bindings.
My os is a linux mint 17, 64 bit

Build and install cmake 3.1.3 with --qt-gui option (from here i can use python3 
compiler)
Modify the file b-tk.core/Wrapping/Python/CMakeLists.txt as you already 
mentionned.

Use cmake gui and build btk without bindings.
install btk with sudo make install in the terminal

Back to cmake-gui and enable binding.
configure give error finfing numpy, just add an entry NUMPY_VERSION and another 
named NUMPY_INCLUDE_DIR (pointing at 
/usr/lib/python3/dist_packages/numpy/core/include)
configure and build
and install again.

Finally, i don't know why but python files are not moved to the good place. I 
made it manually copying all the files in bin directory to 
/usr/local/lib/python3.4/dist-packages/btk. I also need to rename btk.py to 
__init__.py

With this method I manage to use btk in python3.4 idle and in blender python.

Original comment by [email protected] on 12 Mar 2015 at 4:12

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
[deleted comment]

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
[deleted comment]

from b-tk.googlecode.backup.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi,
I can confirm that your method to compile python 3 wrappers for amd64 linux 
works. Thanks for the nice explanation! I also had the same issue of having to 
manually move the wrapper to the appropiate location. I'm using a conda 
environment to run my analysis through ipython, and I had to move the 
"lib*.so*" files of the bin directory (so not the "_btk.so" file) in the lib 
directory of the conda installation.

I used the cmake version available in this ppa:
https://launchpad.net/~george-edison55/+archive/ubuntu/cmake-3.x

Original comment by [email protected] on 24 Mar 2015 at 4:03

from b-tk.googlecode.backup.

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.