GithubHelp home page GithubHelp logo

Port to python 3.x [sf#9] about pagmo HOT 8 CLOSED

esa avatar esa commented on August 15, 2024
Port to python 3.x [sf#9]

from pagmo.

Comments (8)

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by darioizzo on 2014-01-17 15:52:01.

  • assigned_to: Jacco Geul

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by jaccog on 2014-01-18 19:24:52.

  • Manual conversion of print statements, some were already function compatible, 2to3 caused print("blaat") to become print(("blaat"))

  • Remove del s statement that caused errors, s is cleaned up by for loop in Python 3, this change was not documented afaik.

  • Change of CMakeList to point to lib_boostpython3

    from PyGMO import *

Runs without errors now, further testing required.

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by darioizzo on 2014-01-19 14:24:16.

In CMakeList the python version should be autodetected and the correct library then linked. This way both python 2.7 and 3 would be supported at the same time without the user having to change code to make a successfull build

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by jaccog on 2014-01-19 16:50:31.

Good point, changes now implemented in CMakeLists.txt. Problem is that this should go for the source as well, as Python 3 version of PyGMO is not backwards compatible (I tested, too much changed).

This means either having two version of PyGMO in PaGMO or making PyGMO itself compatible with both version. The latter option would introduce a lot of clauses throughout the code and cloud it up. Moreover, the first option allows to simply drop the 2.7 version in the future. On the other hand, in the mean time it requires changes to the code to be made in duplicate for as long as both versions are supported.

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by jaccog on 2014-01-20 10:18:22.

Changes:

  • Split PyGMO source into PyGMO3 (Python 3, according to naming convention, e.g. boost). (git mv PyGMO PyGMO3)
  • Cloned PyGMO source of Pythen 2.7 from development. (git checkout origin/development -- PyGMO/)
  • Enabled different source directories in CMakeLists.txt.

I build from this branch the packages for both version and imported them from their respective python shells.

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by jaccog on 2014-01-23 18:24:22.

  • status: open --> pending

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Originally posted by jaccog on 2014-01-23 18:24:22.

I missed a commit of crucial fix in src/CMakeLists.txt as a result boost_python3 was not correctly added as library link. (Coincidentally, I had a working (test)build in ~/ (d'oh), so I failed to spot this earlier.)

While trying find the problem I improved the way the Python executables and libraries are detected for the different versions.

Meanwhile I successfully used the Python 3 version of PyGMO (followed a few tutorials) and it works like a charm. So I'd suggest closing the ticket. Perhaps someone else might want to test out the build process on a different OS.

Confirmed on:
Linux 3.12.8-1-ck x86_64 GNU/Linux
Python 3.3.3
gcc 4.8.2 20131219
boost 1.55.0

from pagmo.

darioizzo avatar darioizzo commented on August 15, 2024

Pulled in development ..... closed

from pagmo.

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.