What C/C++ compilers are available for VxWorks? - c++

I'm new to the VxWorks environment, I'm wondering what C and C++ compilers are available for use with VxWorks?

There are two: gcc and diab. They will be provided with your WindRiver platform (such as "General Purpose Platform 3.6"). The gcc is modified by WindRiver (and/or CodeSourcery) to work with VxWorks.
Now with VxWorks 6.9 there is a third option: Intel C++ compiler (for Intel target architectures only, 32 and 64 bit) -- diab will not target 64-bit

Greenhills development tools also supported the VXWorks environment in the past.

In addition to the customary Diab ("Wind River Compiler") and GNU, VxWorks 6.9 added Intel C Compiler (ICC), but ICC seems to have been dropped from version 7.
VxWorks version 7 adds LLVM/Clang.

As far as i know Tornado VxWorks IDE using gcc toolchain.
Any way i suggest to use the compiler provided by WindRiver (which i believe their version
of gcc) to avoid compatibility problems.
It's probably worth to menation the VxWorks version you having in mind.
I guess gcc version will be depend on VxWorks version and probably on target platform.

Related

How to install a simple Intel C/C++ compiler on a 64-bit Ubuntu system?

I need to compile c/c++ code, by running a build.sh file.
The instruction on the program (that i want to run) says it needs to be compiled by a Intel's compiler1.
After searching on the net I came across information on what to do.
Some people said that we must install first a 32-bit libraries:
https://help.ubuntu.com/community/InstallingCompilers
Others said that we must, first of any installation, change some things:
http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu
In the other hand, Intel's page show many suites:
http://software.intel.com/en-us/c-compilers
while the only thing that I want is simply Intel's C/C++ compiler.
Can somebody be so gentle to give me the directions on how to install a Intel's compiler on a 64-bit Ubuntu system?
Footnote 1 / Editor's note: other x86 compilers including GCC and clang (and MSVC on Windows), support Intel's SSE/AVX intrinsic functions, but Intel's compiler comes with some libraries such as SVML (e.g. SIMD sin and exp) and MKL which some code might need. Other compilers can be used with SVML if you have it installed separately.
In short, it's worth trying with other compilers, especially if you understand why something says it needs to be compiled by ICC, if getting ICC would be inconvenient. But you might (or might not) be missing out on performance for packages that detect what's available instead of just erroring.
for non commercial use you can download it from Intel
EDIT:
the IntelĀ® System Studio 2016 includes a c++ compiler.
I've tried the 32-bit version of it, the non-commecial one. I don't think it differ from the 32-bit on basic stuff related to installation. Open this and go to compilers and libraries section and you will see the C/C++ compiler. After download it read the files in doc folder; it includes how to install/use/get a key to compiler etc.
You need to install gcc compiler through apt-get install gcc
Look on example here: Install GCC

MinGW as a reliable 64-bit GCC compiler

I am worried about the reliability of the MinGW compiler for 64-bit, as an alternative to the Visual C++ compiler.
For example, assuming C++ code builds and runs perfectly under Linux using GCC 4.6.2, will the corresponding MinGW produce similarly reliable executables/libraries under 64-bit Windows?
Is Cygwin a better option in terms of reliablity? Is neither to the Visual C++ compiler?
First, some misconceptions:
MinGW(.org) does not provide a 64-bit version of its runtime. MinGW-w64 does, in addition to their 32-bit CRT. They are also working on ARM support. And support various additional APIs (Win32 and others).
Cygwin <-> MinGW-w64: Cygwin does not use the MS CRT (msvcrt.dll). It instead inserts a POSIX compatibility layer in between your Cygwin app and the system's OS libraries (kernel32.dll, ntdll.dll, etc.), namely cygwin1.dll.
On to the question then...
I have found the MinGW-w64 compilers very good, and GCC 4.6 and above (actually, 4.5.1 and above) are very capable of producing good 64-bit code for Windows. Please remember that MinGW provides essentially the same C API as msvcrt.dll, so go to msdn.com for documentation (and be sure to look at the "MSVC++ 2003" version of documentation, some functions differ with the newer runtimes), do not think that because it's GCC, glibc documentation suddenly applies to Windows. Your code will have to be cross-platform. Also note that sizeof(long)!=sizeof(T*) on x64 Windows. A commonly encountered error when porting *nix or x86 Windows code to x64 Windows.

How to use Intel C++ Compiler with NetBeans (Windows)

In order to use ICC with NetBeans, a new toolchain has to be created.
Does anyone has already created a toolchain for ICC and NetBeans ?
If not, is there another way to use ICC with NetBeans ?
VCC4N is a Netbeans plugin for supporting Visual C++. Since Intel's compiler is pretty similar to VC++ (similar command-line options, debugger compatibility, etc.), it is likely this plugin can be modified to support ICC. I know, it's not a real solution (I haven't found one), but it could be a start.

Running/compiling executable Linux vs Solaris

if i have code compiled under Solaris 8 and 10 and now have a vendor that wants to use my bin/exe under Linux. Could there be compatibility issues?
I am pretty sure i would need to compile/link under Linux OS for it to work 100% but i just wanted to know if someone can give me the breakdown as to why it would not work on Linux even though the exe has everything and there is nothing dynamic about it, as in it should not need anything further to run it. Unless we talking runtime libs, that if there is a mismatch might cause the exe to fail.
You have to recompile your application on Linux.
Linux is a completely different run-time compared to Solaris. Even if you have compiled your application statically, there's the interface/system calls to the kernel that is different among these two operating systems. The processor architecture might be different too, e.g. SPARC vs X86.
Both Solaris and Linux support most of the standard C and Posix APIs, so if you've not used any APIs exclusive to Solaris, recompiling on Linux is often not that big a deal - but you surly should test everything throughly, and be aware of any endianess, and potential 64 bit vs 32 bit issues.
Other things that I think will not allow your Solaris binary to run on Linux out of the box are:
the hardware architecture:
1.1 Solaris usually runs on Sun's own SPARC machines, especially 8 - 10 can run on Intel architectures as well;
1.2 Linux usually runs on Intel machines (although it can run on Sparc machines).
the compilers:
2.1 Solaris 8 uses Sun's own compilers (Sun WorkShop 6+) & standard library implementation (so you'll have different library names, ABI incompatibilities and so on). Solaris 10 actually comes with gcc but you're probably not using it (I gather you're building on Solaris 8 only);
2.2 Linux uses g++, same as above for library names, ABI incompatibilities & so on.

c++ compiler that creates object code for two different machines

Are there c++ compilers that I can run on a brand x system that will create machine code that will run on a brand y system? Would this be considered a cross compiler?
Yes, that's exactly what a cross compiler is.
The GNU Compiler Collection (which includes gcc and g++) are a prime example of a portable cross compiler with hundreds of supported CPU types.
There are many ways to configure GCC to be a cross compiler. Most of it depends on the target machine and what's available from it - mostly because of the C runtime environment. For example, compiling GCC for an ARM Linux target requires an ARM Linux glibc pre-compiled to build the cross compiler libstdc++.
This is quite common using gcc.
There are a number of tutorials around that describe building your own cross-compiler environment.
This is one, but a quick google will probably provide a link to someone doing exactly the mix of environments that you're after.
edit:
This is a more thorough tutorial, using crosstool
Yes there are such compilers; yes, they are called cross compilers. For example, GCC can be configured in this manner, so that I can run the compiler on a 32-bit x86 system, but produce 64-bit code for an x64 system, and that's just the tip of the iceberg.
Crosstool is a really handy tool suite for creating a cross-compiling GCC.
HTH,
Eric Melski
Electric Cloud, Inc.
Yes this is what cross-compilation is about (although I would say "brand X" isn't appropriate classification term).