Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile C++ code for AIX on Ubuntu?

Tags:

c++

linux

aix

g++

Question in one sentence: How can I compile code for AIX using G++ on Ubuntu? (Assuming it is possible)

I hope that it is as simple as adding an option to the make file to specify target processor. I am a novice when it comes to most things compiler related.

Thank you in advance.

like image 303
CoryC Avatar asked Aug 27 '10 16:08

CoryC


2 Answers

What you are looking for is a cross-compiling toolchain.

A toolchain includes a cross-compiler (a compiler that runs on the current platform but builds the binary code to run on another, on your case, AIX), the C or C++ library, and some other interesting tools.

I have successfully used buildroot in the past, which is a tool that automates the process of creating a cross-compiling toolchain. I know they support several target platforms, maybe AIX is among them.

If you want to compile your toolchain by hand, take a look at the Roll-your-own section on this page.

Another approach, probably easier on your case, would be to install a AIX system inside a virtual machine on Ubuntu. This way you would have access to a complete AIX system running inside your machine, giving the opportunity to develop and test your application under real conditions (or whatever reasons you may find interesting for doing such a thing).

like image 166
karlphillip Avatar answered Oct 13 '22 10:10

karlphillip


You'll want to download the right version of g++ (i.e., one that generates code for POWER, or whatever you're running AIX on), and compile that to run under Ubuntu.

like image 1
Jerry Coffin Avatar answered Oct 13 '22 09:10

Jerry Coffin