- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
I built a "hello world" c++ program using icpc in Linux, but it crashes with "illegal instruction" when running in a CentOS VM. If built with g++, it is OK.
see below the simple hello world source code and CPU information of the CentOS.
rickyswang@gmail.com
Thanks,
Ricky
//!--icpc -o alpha.icpc alpha.cpp
//!--g++ -o alpha.g++ alpha.cpp
//alpha.cpp source code
#include
int main()
{
char x[] = "hello world!\\n";
printf(x);
return 0;
}
and below is the cpu info of the CentOS:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : mobile AMD Athlon XP-M 2200+
stepping : 0
cpu MHz : 1666.740
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up nonstop_tsc ts fid vid
bogomips : 3333.48
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel compiler uses "-msse2" compiler option by default. More information can be found at http://software.intel.com/en-us/articles/performance-tools-for-software-developers-intel-compiler-options-for-sse-generation-and-processor-specific-optimizations/?wapkw=%28SSe%29
To run the resulting binary the processor has to support SSE2 instructions. Looks like the the CPU in your system only supports SSE not SSE2. Does the binary run when you compile with g++ using the "-msse2" option?
--mark
To run the resulting binary the processor has to support SSE2 instructions. Looks like the the CPU in your system only supports SSE not SSE2. Does the binary run when you compile with g++ using the "-msse2" option?
--mark
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page