开发者

Compile C++ code for AIX on Ubuntu?

开发者 https://www.devze.com 2023-01-14 10:13 出处:网络
Question in one sentence: How can I compile code for AIX using G++ on Ubuntu? (Assuming it is possible)

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开发者_StackOverflow社区 in advance.


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).


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.


Try to compile with -maix32 or -maux64 (like g++ -m32 file.cxx), it it doesn't work it means that it's not supported by your compiller.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号