Change default CMake version, Ubuntu 14.04 -
as far i've understood, need use @ least cmake 3.1 in order use c++11. ubuntu 14.04 comes 2.8.x.
i followed guide suggesting 1 should install cmake /opt
, have cmake installed /opt/cmake-3.2.1-linux-x86_64
, added /opt/cmake-3.2.1-linux-x86_64/bin
path (as first element) in .bashrc.
if try apt-get remove cmake
process wants remove not cmake ros (so yes, i've stopped ubuntu: upgrading software (cmake) - version disambiguation (local compile), conclude couldn't use answers)
result of cmake --version
:
cmake version 3.2.1
setting minimum required version 3.1 , running catkin_make
in same terminal yields:
cmake 3.1 or higher required. running version 2.8.12.2
how can make catkin
use new (/correct) version of cmake?
two things going on here:
- according catkin_make file, isn't copying shell environment python subprocess 'cmake' invocation.
catkin_make:
... if args.no_color: run_command(cmd, build_path) else: run_command_colorized(cmd, build_path)
builder.py:
def run_command(cmd, cwd, quiet=false, colorize=false, add_env=none): ... env = none if add_env: env = copy.copy(os.environ) env.update(add_env) try: proc = subprocess.popen( cmd, cwd=cwd, shell=false, stdout=stdout_pipe, stderr=stderr_pipe, env=env )
you can modify appropriate lines in catkin_make script pass empty dictionary add_env, , should attempt copy environment spawned sub process:
if args.no_color: run_command(cmd, build_path, add_env={}) else: run_command_colorized(cmd, build_path, add_env={})
this should modify path , let find appropriate cmake version, i'm not sure alone solves original question, leading to...
- if attempting use c++11 when building catkin, add
-std=c++11
compiler flagcmake_cxx_flags
:
catkin_make --cmake-flags "-dcmake_cxx_flags=\${cmake_cxx_flags};-std=c++11"
or modify cmakelists.txt: set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11")
Comments
Post a Comment