{"action":"created","issue":{"url":"https://api.github.com/repos/gadgetron/gadgetron/issues/96","labels_url":"https://api.github.com/repos/gadgetron/gadgetron/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/gadgetron/gadgetron/issues/96/comments","events_url":"https://api.github.com/repos/gadgetron/gadgetron/issues/96/events","html_url":"https://github.com/gadgetron/gadgetron/pull/96","id":60199105,"number":96,"title":"only look for Python 2 in FindPythonLibs","user":{"login":"ghisvail","id":1964655,"avatar_url":"https://avatars.githubusercontent.com/u/1964655?v=3","gravatar_id":"","url":"https://api.github.com/users/ghisvail","html_url":"https://github.com/ghisvail","followers_url":"https://api.github.com/users/ghisvail/followers","following_url":"https://api.github.com/users/ghisvail/following{/other_user}","gists_url":"https://api.github.com/users/ghisvail/gists{/gist_id}","starred_url":"https://api.github.com/users/ghisvail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghisvail/subscriptions","organizations_url":"https://api.github.com/users/ghisvail/orgs","repos_url":"https://api.github.com/users/ghisvail/repos","events_url":"https://api.github.com/users/ghisvail/events{/privacy}","received_events_url":"https://api.github.com/users/ghisvail/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-07T09:23:57Z","updated_at":"2015-03-07T15:41:03Z","closed_at":"2015-03-07T12:29:29Z","pull_request":{"url":"https://api.github.com/repos/gadgetron/gadgetron/pulls/96","html_url":"https://github.com/gadgetron/gadgetron/pull/96","diff_url":"https://github.com/gadgetron/gadgetron/pull/96.diff","patch_url":"https://github.com/gadgetron/gadgetron/pull/96.patch"},"body":"If you are in a setup like me where you also have a development environment for Python 3, you can end-up in a situation where FindPythonInterp and FindPythonLibs provides inconsistent python versions, leading to build errors. The solution is to explicitly set the version of Python to be used (here Python 2).\r\n\r\nBefore\r\n--------\r\n\r\nIn CMakeCache.txt\r\n//Details about finding PythonInterp\r\nFIND_PACKAGE_MESSAGE_DETAILS_PythonInterp:INTERNAL=[/usr/bin/python][v2.7.9()]\r\n//Details about finding PythonLibs\r\nFIND_PACKAGE_MESSAGE_DETAILS_PythonLibs:INTERNAL=[/usr/lib/x86_64-linux-gnu/libpython3.4m.so][/usr/include/python3.4m][v3.4.2()]\r\n\r\nBuild log:\r\nLinking CXX executable gadgetron_test_python\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_Size'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyUnicodeUCS4_FromEncodedObject'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyFile_FromString'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_Type'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyInt_Type'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_FromString'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyUnicodeUCS4_AsWideChar'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_FromStringAndSize'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `Py_InitModule4_64'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_FromFormat'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyNumber_Divide'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyNumber_InPlaceDivide'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyInt_AsLong'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_InternFromString'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyClass_Type'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyString_AsString'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyInt_FromLong'\r\n/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `PyFile_AsFile'\r\ncollect2: error: ld returned 1 exit status\r\ntoolboxes/python/example/CMakeFiles/gadgetron_test_python.dir/build.make:97: recipe for target 'toolboxes/python/example/gadgetron_test_python' failed\r\nmake[2]: *** [toolboxes/python/example/gadgetron_test_python] Error 1\r\nCMakeFiles/Makefile2:1105: recipe for target 'toolboxes/python/example/CMakeFiles/gadgetron_test_python.dir/all' failed\r\nmake[1]: *** [toolboxes/python/example/CMakeFiles/gadgetron_test_python.dir/all] Error 2\r\nMakefile:107: recipe for target 'all' failed\r\nmake: *** [all] Error 2\r\n\r\nAfter\r\n------\r\n\r\nIn CMakeCache.txt\r\n\r\n//Details about finding PythonInterp\r\nFIND_PACKAGE_MESSAGE_DETAILS_PythonInterp:INTERNAL=[/usr/bin/python][v2.7.9()]\r\n//Details about finding PythonLibs\r\nFIND_PACKAGE_MESSAGE_DETAILS_PythonLibs:INTERNAL=[/usr/lib/x86_64-linux-gnu/libpython2.7.so][/usr/include/python2.7][v2.7.9()]\r\n\r\nThe build is now successful.\r\n "},"comment":{"url":"https://api.github.com/repos/gadgetron/gadgetron/issues/comments/77694273","html_url":"https://github.com/gadgetron/gadgetron/pull/96#issuecomment-77694273","issue_url":"https://api.github.com/repos/gadgetron/gadgetron/issues/96","id":77694273,"user":{"login":"ghisvail","id":1964655,"avatar_url":"https://avatars.githubusercontent.com/u/1964655?v=3","gravatar_id":"","url":"https://api.github.com/users/ghisvail","html_url":"https://github.com/ghisvail","followers_url":"https://api.github.com/users/ghisvail/followers","following_url":"https://api.github.com/users/ghisvail/following{/other_user}","gists_url":"https://api.github.com/users/ghisvail/gists{/gist_id}","starred_url":"https://api.github.com/users/ghisvail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghisvail/subscriptions","organizations_url":"https://api.github.com/users/ghisvail/orgs","repos_url":"https://api.github.com/users/ghisvail/repos","events_url":"https://api.github.com/users/ghisvail/events{/privacy}","received_events_url":"https://api.github.com/users/ghisvail/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T15:41:02Z","updated_at":"2015-03-07T15:41:02Z","body":"Same for Debian / Ubuntu. Boost python depends on the default Python\ninterpreter which is still Python 2.x.\nLe 7 mars 2015 15:23, \"Joseph Naegele\" <notifications@github.com> a écrit :\n\n> It depends on the Boost Python you have installed. Using homebrew for\n> example, boost-python is compiled against Python 2 by default\n> (--with-python3 is an option). I think this is a safe change until someone\n> complains about not being able to use Python 3 (because they are using\n> Boost-Python compiled against Python 3).\n>\n> On another note: it may be worthwhile to vendor the `FindPythonXXX` cmake\n> scripts in Gadgetron like we do for so many others. This way I could patch\n> them up to actually find the right stuff on every system (Mac OS X\n> especially).\n>\n> --\n> Joe Naegele\n> joseph.naegele@gmail.com\n> josephnaegele.com\n> 301.676.1403\n>\n> On Sat, Mar 7, 2015 at 8:27 AM, Souheil Inati <notifications@github.com>\n> wrote:\n>\n> > Does the code not compile properly with Python3?\n> >\n> > It seems findPython is rather dumb. Did you try helping it by passing the\n> > cmake Python variables at the command line? I have to do this for Mac\n> > homebrew and windows with WinPython and any other non bog-standard\n> > configuration.\n> >\n> > —\n> > Reply to this email directly or view it on GitHub\n> > <https://github.com/gadgetron/gadgetron/pull/96#issuecomment-77689225>.\n> >\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/gadgetron/gadgetron/pull/96#issuecomment-77693617>.\n>\n"}}