My system:
CentOS 6.2, x86_64
Python 2.6.6
Cmake version 2.6-patch 4
gnuradio 3.7.0
I created a “build” folder in the gnuradio soure directory and attempted
to compile using “cmake …/”. The error I keep getting is this:
--------------------------------------------START
LOG-------------------------------------------------------------
– Build type not specified: defaulting to release.
– NO PERF COUNTERS
– Minimum SWIG version required is 1.3.31
– The build system will automatically enable all components.
– Use -DENABLE_DEFAULT=OFF to disable components by default.
– Configuring python-support support…
– Dependency PYTHONLIBS_FOUND = TRUE
– Dependency SWIG_FOUND = 1
– Dependency SWIG_VERSION_CHECK = TRUE
– Enabling python-support support.
– Override with -DENABLE_PYTHON=ON/OFF
– Configuring testing-support support…
– Dependency CPPUNIT_FOUND = TRUE
– Enabling testing-support support.
– Override with -DENABLE_TESTING=ON/OFF
– Configuring volk support…
– Enabling volk support.
– Override with -DENABLE_VOLK=ON/OFF
File “”, line 1
^
SyntaxError: invalid syntax
CMake Error at volk/cmake/GrPython.cmake:105 (file):
file FILE(SYSTEM_PATH ENV result) must be called with only three
arguments.
Call Stack (most recent call first):
volk/CMakeLists.txt:53 (include)
–
– Python checking for python >= 2.5
File “”, line 1
^
SyntaxError: invalid syntax
– Python checking for python >= 2.5 - not found
-------------------------------------------END
LOG-------------------------------------------------------------
It seems as if cmake is inserting a “CR” character at the beginning of
each string that is passed to python.
I found that I was able to resolve the problem by editing
volk/cmake/GrPython.cmake to put all the python code on one line as
follows:
----------------------ORIGINAL CODE----------------------------------
########################################################################
Sets the python installation directory GR_PYTHON_DIR
########################################################################
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig
print sysconfig.get_python_lib(plat_specific=True, prefix=’’)
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
----------------------------EDITED
CODE----------------------------------
########################################################################
Sets the python installation directory GR_PYTHON_DIR
########################################################################
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c “from distutils import
sysconfig; print sysconfig.get_python_lib(plat_specific=True,
prefix=’’);” OUTPUT_VARIABLE GR_PYTHON_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
--------------------------END
CODE-----------------------------------------------
Note that trying to put “from distutils import sysconfig” on the same
line as the open quotemark does not resolve the problem either (it also
seems to append a CR to the end of the line and python barks at me).
However, this process is very tedious, and it seems like there should be
a better way of fixing it, and it does not work for the sections of
python code in the cmake files where there are if/else blocks. Is there
a better way of resolving this problem, or has anyone else had this
problem?