Re: How to cross compile fio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, 26 Jan 2020 at 01:36, Sarvani Reddy Kolli
<sarvanireddykolli@xxxxxxxxx> wrote:
>
> Hi,
> I am trying to compile and build fio 3.15 binary on a development
> machine with Centos and Intel CPU E5-1620 v3 and use it across
> different machines of which few are running with OS's like CentOs ,
> Arch and different CPU architecture like sandybridge, broadwell,
> haswell, skylake but the fio binary fails either
>
> 1. with " illegal hardware instruction (core dumped)"  - on
> sandybridge and Ivybridge CPUs or

Make sure you pass --disable-native to ./configure otherwise it will
assume your compilation machine's microarchitecture is the one to
target (you will see it configure saying something about "Build
march=native") and the binary will fail to work if moved to a lesser
CPU even if the Linux distro the binary is moved to is identical...

> 2.  "--write_hist_log=" requires zlib to run in client/server mode.

I fairly sure configure suggests the package that would have to be installed:

"Consider installing zlib-dev (zlib-devel, some fio features depend on it. "

I think of RPM distros the package that lets you build against zlib is
called zlib-devel but I don't know what it is on distros like Arch...

> Can you  provide steps to compile and build the binary that runs
> across different CPU architectures and different OS.

Building a single binary that works across multiple different Linux
distros is rather out of the scope of this list and is a more general
"building for Linux" question. If you choose to go that route (hint:
it may not be easy) you generally have to look towards bundling
libraries and messing with environment variables/rpath or more likely
switching to static linking (see ./configure --help) but then ALL your
libraries must be present in static form on the build machine). Even
with static linking there are other caveats (you may find you have to
build the binary on the oldest OS, you may find trouble static linking
glibc and start looking to use musl which will bring different
challenges)...

Good luck!

-- 
Sitsofe | http://sucs.org/~sits/



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux