tsdconseil / opencv-demonstrator

OpenCV demonstrator (GUI)
http://www.tsdconseil.fr/log/opencv/demo/index-en.html
GNU Lesser General Public License v3.0
141 stars 57 forks source link

What's the deal with -march=i486 compile flag? #2

Closed valera-rozuvan closed 8 years ago

valera-rozuvan commented 8 years ago

When trying to compile under Linux, I get the following error message:

error: CPU you selected does not support x86-64 instruction set

I believe that this is due to the fact that my CPU isn't compatible with the -march=i486 compile flag (see ocvdemo/Makefile). @juliena82 - what was the reasoning behind this compile flag? Did you want to optimize code generation for your computer?

We should generate CPU specific compiler flags based on the current system's specs. Maybe you have a suggestion of how to do this? I found this via Google: GCC optimization | Gentoo Wiki | -march option.

valera-rozuvan commented 8 years ago

@juliena82 Here is some information about my CPU:

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 60
Model name:            Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz
Stepping:              3
CPU MHz:               2200.687
CPU max MHz:           3200.0000
CPU min MHz:           800.0000
BogoMIPS:              4390.27
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-7
juliena82 commented 8 years ago

I think that you can simply remove the i486 flag. I do no remember yet why I used it, yes probably an optimization try...

It’s line 49 in ocvdemo/Makefile

From: Valera Rozuvan Sent: Sunday, January 03, 2016 8:13 PM To: tsdconseil/opencv-demonstrator Cc: juliena82 Subject: Re: [opencv-demonstrator] What's the deal with -march=i486 compile flag? (#2)

@juliena82 Here is some information about my CPU:

$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 60 Model name: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz Stepping: 3 CPU MHz: 2200.687 CPU max MHz: 3200.0000 CPU min MHz: 800.0000 BogoMIPS: 4390.27 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K NUMA node0 CPU(s): 0-7 — Reply to this email directly or view it on GitHub.

valera-rozuvan commented 8 years ago

Resolved in 21c5ddfd4037f49daac9ae10b3c3343822c74a01.