Running non-g++ compiled code against ARGoS

Requests regarding how to set up experiments in ARGoS.
jharwell
Posts: 67
Joined: Thu Jan 25, 2018 4:12 am

Running non-g++ compiled code against ARGoS

Postby jharwell » Thu Feb 01, 2018 3:30 am

Hello,

I've been trying to compile my code into a .so (based on the foraging example originally) using icpc, as I have found that compiler to give much better performance for many workloads on intel chips However, whenever I try to run it with the version of ARGoS that is in the .deb for ubuntu distributed on the site, I always get a "library not found" error. This error does not happen if I compile my library with g++, so I *think* it is a compiler compatibility problem, as I get the same error if I try to use clang++.

My understanding was that if I specify -std=c++11, that the compilers would produce binary compatible object files when run on the same system, as they would all have the same stdlibs/headers available, but I think I'm missing something. Has anyone had success linking code compiled with something other than g++ with ARGoS and running it? If not, my guess is that I need to compile ARGoS from source with whatever compiler I want to use?

Thanks for your help,

- John

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Running non-g++ compiled code against ARGoS

Postby pincy » Thu Feb 01, 2018 6:30 am

I don't think you can use ARGoS with non-compatible compilers. I guess your best option is to set the variables CC and CXX to be the path of the compiler you want to use, and then compile ARGoS with those. Make sure to have no ARGoS installed anywhere, and then execute these commands:

Code: Select all

$ git clone https://github.com/ilpincy/argos3.git $ cd argos3 $ mkdir build $ cd build $ export CC=/path/to/c_compiler $ export CXX=/path/to/c++_compiler $ cmake -DCMAKE_BUILD_TYPE=Release ../src $ make $ make doc $ sudo make install
If you want to install this special binary version somewhere, then the cmake command becomes:

Code: Select all

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/install ../src
The rest stays the same.
I made ARGoS.


Return to “How to... ?”