nakatamaho/mplapack

how do I add a -march=generic flag to build?

Opened this issue · 7 comments

Hi,
I tried to build on 22.04 with my laptop with x86_64 11th generation intel cpu, but the library won't work on older machiens (Illegal Instruction error).
After some research, I found that I need to add -march=x86-64 to the compiler options (is this correct?)
I'm wondering how do I do that for MPLAPACK?

I've tried to add ARG CFLAGS=-march=x86-64 and ARG CXXFLAGS=-march=x86-64 and ARG FFLAGS=-march=x86-64, but it seems that not all the rules are using these.

You're right. Unfortunately, you have to patch by hand. see l.833-l.851 of https://github.com/nakatamaho/mplapack/blob/master/configure.ac . You may remove "-xHost" and "-march=native" from configure file (not configure.ac). However, I don't know if the binaries still work on other platforms. Since GMP also detects CPU architecture and sets appropriate flags independent from MPLAPACK configure.

BTW: on which architecture do you want to install MPLAPACK?

BTW: on which architecture do you want to install MPLAPACK?

I just hope that it will work on all x86-64 systems. Do you think I can just compile it on a really old machine and it will work on all the newer machines?

This is a difficult question. It would be greatly appreciated if you could provide me with a report.

Hi, I just compiled with Intel Celeron-1007U for Ubuntu18.04, then statically linked to my program.
And it works on all of the servers with Intel Xeon (the oldest one purchased on 2010).

Great and appreciated!