I am building an rpm using rpmbuild command as:rpmbuild -bb --root <DIRECTORY> --target i386 --define _topdir <DIRECTORY> <specfile>.specWhen I use my SLED 10 SP3 x86 machine, it runs successfully. But on my SLES 10 SP3 x64 Virtual Machine, it gives following error:error: No compatible architectures found for buildInitially I was not using --target option, still it was running on x86 machine, but same error was there in x64 machine.Please help me to resolve this error
How can I build a rpm for i386 target on a x86-64 machine?
rpm;suse;architecture
From the Fedora documentation for rpm, spec files, and rpmbuild:The --target option sets the target architecture at build time. Chapter 3,Using RPM covers how you can use the --ignoreos and --ignorearch options when installing RPMs to ignore the operating system and architecture that is flagged within the RPM. Of course, this works only if you are installing on a compatible architecture.On the surface level, the --target option overrides some of the macros in the spec file, %_target, %_target_arch, and %_target_os. This flags the RPM for the new target platform.Under the covers, setting the architecture macros is not enough. You really cannot create a PowerPC executable, for example, on an Intel-architecture machine, unless you have a PowerPC cross compiler, a compiler that can make PowerPC executables.http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-rpmbuild.htmlSo, as it says, make sure you have the additional compilers installed (for example gcc.i686 & gcc.x86_64).