Python Problems during build on Ubuntu 12.10

Known Issues and Problems with BCI2000
Locked
MaxG
Posts: 3
Joined: 22 Apr 2013, 17:27

Python Problems during build on Ubuntu 12.10

Post by MaxG » 22 Apr 2013, 17:52

Hi all,
I try to build BCI2000 on Ubuntu 12.10.
Despite a missing include I was able to build BCI2000 up to 99%. Then there happen to be some python related problems.

Code: Select all

make all
...
[ 99%] Built target BCI2000PythonBindings
[ 99%] Building CXX object contrib/ExternalLinks/PyffApplication/CMakeFiles/PyffApplication.dir/home/max/Studium/Quellcode/BCI2000/src/shared/modules/CoreMain.cpp.o
[ 99%] Building CXX object contrib/ExternalLinks/PyffApplication/CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from /home/max/Studium/Quellcode/BCI2000/src/contrib/ExternalLinks/PyffApplication/PyffFilter.h:44,
                 from /home/max/Studium/Quellcode/BCI2000/src/contrib/ExternalLinks/PyffApplication/PyffFilter.cpp:30:
/usr/include/python2.7/pyconfig.h:1161:0: Warnung: »_POSIX_C_SOURCE« redefiniert [standardmäßig aktiviert]
In file included from /usr/include/strings.h:28:0,
                 from /home/max/Studium/Quellcode/BCI2000/build/../src/shared/config/gccprefix.h:54,
                 from <Kommandozeile>:0:
/usr/include/features.h:164:0: Anmerkung: dies ist die Stelle der vorherigen Definition
In file included from /usr/include/python2.7/Python.h:8:0,
                 from /home/max/Studium/Quellcode/BCI2000/src/contrib/ExternalLinks/PyffApplication/PyffFilter.h:44,
                 from /home/max/Studium/Quellcode/BCI2000/src/contrib/ExternalLinks/PyffApplication/PyffFilter.cpp:30:
/usr/include/python2.7/pyconfig.h:1183:0: Warnung: »_XOPEN_SOURCE« redefiniert [standardmäßig aktiviert]
In file included from /usr/include/strings.h:28:0,
                 from /home/max/Studium/Quellcode/BCI2000/build/../src/shared/config/gccprefix.h:54,
                 from <Kommandozeile>:0:
/usr/include/features.h:166:0: Anmerkung: dies ist die Stelle der vorherigen Definition
[ 99%] Building CXX object contrib/ExternalLinks/PyffApplication/CMakeFiles/PyffApplication.dir/home/max/Studium/Quellcode/BCI2000/src/core/Operator/BCI2000Remote/BCI2000Connection.cpp.o
Linking CXX executable /home/max/Studium/Quellcode/BCI2000/prog/PyffApplication
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertLabelIndexToPyList(LabelIndex) const':
PyffFilter.cpp:(.text+0x46f): undefined reference to `PyString_FromString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertPyListToLabelIndex(_object*, LabelIndex&) const':
PyffFilter.cpp:(.text+0x507): undefined reference to `PyString_AsString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertPhysicalUnitToPyDict(PhysicalUnit) const':
PyffFilter.cpp:(.text+0x604): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x62b): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x642): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x651): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x678): undefined reference to `PyString_FromString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o:PyffFilter.cpp:(.text+0x69f): more undefined references to `PyString_FromString' follow
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertPyDictToPhysicalUnit(_object*, PhysicalUnit&) const':
PyffFilter.cpp:(.text+0x719): undefined reference to `PyString_AsString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertPyObjectToProperties(_object*, SignalProperties&) const':
PyffFilter.cpp:(.text+0x7fb): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x86c): undefined reference to `PyString_AsString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::HandlePythonError(std::string, bool) const':
PyffFilter.cpp:(.text+0x1554): undefined reference to `PyInt_AsLong'
PyffFilter.cpp:(.text+0x15a9): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x15dc): undefined reference to `PyInt_AsLong'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::CallHook(char const*, _object*, _object*) const':
PyffFilter.cpp:(.text+0x1983): undefined reference to `PyString_FromString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::CallMethod(char const*, _object*, _object*, _object*) const':
PyffFilter.cpp:(.text+0x1ee0): undefined reference to `PyString_FromString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::SendStatePrecisionsToPython() const':
PyffFilter.cpp:(.text+0x2064): undefined reference to `PyInt_FromLong'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::SendStatesToPython() const':
PyffFilter.cpp:(.text+0x21dc): undefined reference to `PyInt_FromLong'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ReceiveParametersFromPython()':
PyffFilter.cpp:(.text+0x2eea): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x3019): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x33e5): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x3484): undefined reference to `PyString_Size'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ConvertPropertiesToPyObject(SignalProperties const&) const':
PyffFilter.cpp:(.text+0x3e74): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x3e83): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x3ea5): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x3eb4): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x3f72): undefined reference to `PyString_FromString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o:PyffFilter.cpp:(.text+0x408d): more undefined references to `PyString_FromString' follow
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::Preflight(SignalProperties const&, SignalProperties&) const':
PyffFilter.cpp:(.text+0x552f): undefined reference to `PyString_AsString'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::ReceiveStatesFromPython() const':
PyffFilter.cpp:(.text+0x57c9): undefined reference to `PyInt_AsLong'
CMakeFiles/PyffApplication.dir/PyffFilter.cpp.o: In function `PyffFilter::PyffFilter()':
PyffFilter.cpp:(.text+0x7291): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x72cd): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x730e): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x731e): undefined reference to `PyString_FromString'
PyffFilter.cpp:(.text+0x7453): undefined reference to `PyString_AsString'
PyffFilter.cpp:(.text+0x756d): undefined reference to `PyString_AsString'
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [/home/max/Studium/Quellcode/BCI2000/prog/PyffApplication] Fehler 1
make[1]: *** [contrib/ExternalLinks/PyffApplication/CMakeFiles/PyffApplication.dir/all] Fehler 2
make: *** [all] Fehler 2
I've got python2.7-dev, python3-dev and python3.2-dev installed.
When compiling a second time the warnings/errors concerning redefinitions disappear.

I wonder, whether this error is relevant for a BCI2000 starter and how to fix it.

sincerely,
Max

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: Python Problems during build on Ubuntu 12.10

Post by mellinger » 29 Apr 2013, 09:40

Hi Max,

thank you for reporting these issues.

The redefinition warnings are actually not a problem at all, and will be fixed by the time the 3.0.6 binary release comes out.

The PyffApplication linker errors are probably due to the fact that it assumes to be linked against Python 2.7 rather than 3.x. If you actually want to use the BCI2000-to-Pyff interface (i.e. use the Pyff BCI library with BCI2000), then I guess you can solve the issue by specifying 2 as a version number for the python library in the Pyff Application's CMakeLists.txt file.

If you are not going to use Pyff, you may simply put a '#' comment mark before the PyffApplication subdirectory line in src/contrib/ExternalLinks/CMakeLists.txt.

Regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 0 guests