ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

use custom interpreter

asked 2018-04-14 06:02:21 -0600

ashkan_abd gravatar image

Hi I wrote an interpreter for cpp. how can I use it in ros and write my code for this interpreter?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-15 21:49:50 -0600

Geoff gravatar image

I assume you mean that you wrote a compiler for C++, since C++ is not an interpreted language.

ROS uses whatever compiler the environment says is the current one. How to change the compiler for your environment (which can be done on a shell-by-shell basis, or system wide) is not really ROS specific, but it's also easy enough to do. Set the CC environment variable to the compiler's executable to change the C compiler, and the CXX environment variable to change the C++ compiler. If you are using CMake (which you are for ROS) then you can also do it in a CMakeLists.txt file by setting the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER variables to the path to the compiler executable. I'm not sure how much Catkin will like having this variable changed in one package, though. It might take effect for the whole workspace, or it might just be overridden.

edit flag offensive delete link more

Comments

please say more details how can do this?

ashkan_abd gravatar image ashkan_abd  ( 2018-04-16 07:34:39 -0600 )edit

Setting environment variables is a basic Linux question. I suggest you read up on how to use the shell, and if you have any further Linux-related questions, ask them at a Linux help site.

Geoff gravatar image Geoff  ( 2018-04-17 18:35:53 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-04-14 06:02:21 -0600

Seen: 251 times

Last updated: Apr 15 '18