How to build rpm binary from source rpm under HPC

HI,

I try to rebuild openblas binary RPM from its source rpm, run rpmbuild, but got "
hpc_init not defined in spec file erros,
then I run build script :

#build openblas.spec,

but got following errors:

[ 0s] hp-bdw started “build openblas.spec” at Thu Oct 18 07:34:12 UTC 2018.
[ 0s]
[ 0s]
[ 0s] processing recipe /usr/src/packages/./SPECS/openblas.spec …
[ 0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir /var/cache/build --repository zypp:// /usr/src/packages/./SPECS/openblas.spec …
[ 0s] It seems that there was an incomplete setup of /var/tmp/build-root.
[ 0s] To be sure, we will build it again completely…
[ 0s] Your build system is broken!! Shall I execute
[ 0s]
[ 0s] rm -rf – /var/tmp/build-root/*
[ 0s]
[ 0s] y - yes, cleanup the build root
[ 0s] N - No, abort build (default on enter)
[ 0s] c - Continue anyway with this build root
c
[ 3s] [y/N/c] initializing /var/tmp/build-root/.srcfiles.cache …
[ 3s] /usr/lib/build/createzyppdeps --cachedir=/var/cache/build zypp://Basesystem_Module_15_x86_64:SLE-Module-Basesystem15-Pool
[ 4s] /usr/lib/build/createzyppdeps --cachedir=/var/cache/build zypp://Basesystem_Module_15_x86_64:SLE-Module-Basesystem15-Updates
[ 5s] /usr/lib/build/createzyppdeps --cachedir=/var/cache/build zypp://Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Pool
[ 7s] /usr/lib/build/createzyppdeps --cachedir=/var/cache/build zypp://Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Updates
[ 7s] /usr/lib/build/createzyppdeps --cachedir=/var/cache/build zypp://Development-Tools-Module_15-0
[ 7s] zypp repo zypp://Development-Tools-Module_15-0 is not up to date, please refresh first
[ 7s]
[ 7s] hp-bdw failed “build openblas.spec” at Thu Oct 18 07:34:19 UTC 2018.

So I refresh the repos first,

#zypper ref -fdb

then rerun the build, still got the same errors.

After yast online update all packages and repos,
the same result,

What is the step to build rpm under HPC

Thanks in advance.

Ethan

I didn’t find the guide or any documentation about how to re-build rpms under SLES 15 HPC.

Hi
Use rpmbuild -b not the build command. You should also look at building
as your user not root use. It will create a ~/rpmbuild directory with
sources, spec file etc. Better yet, just download the complete src rpm
(zypper with download only option) and copy this from the zypper cache
diretory to your home directory.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.22-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

[QUOTE=malcolmlewis;54862]Hi
Use rpmbuild -b not the build command. You should also look at building
as your user not root use. It will create a ~/rpmbuild directory with
sources, spec file etc. Better yet, just download the complete src rpm
(zypper with download only option) and copy this from the zypper cache
diretory to your home directory.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.22-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks![/QUOTE]

Yes, firstly, I use the rpmbuild to build the openblas lib with source code from SLES 15 HPC,
But I got

error: line 115: Unknown tag: %{hpc_init -c gnu }

$ grep hpc_init *
openblas.spec:%{hpc_init -c %{compiler_family} %{?c_f_ver:-v %{c_f_ver}} %{?ext:-e %{ext}}}

So it is not feasible to build it with regular rpmbuild command,

Then wen I grep the hpc_init in whole iso,

found it was defined in the “build” script.

So what’s the steps to build hpc binary rpm ?

Thanks,
etzhao

[QUOTE=etzhao;54881]Yes, firstly, I use the rpmbuild to build the openblas lib with source code from SLES 15 HPC,
But I got

error: line 115: Unknown tag: %{hpc_init -c gnu }

$ grep hpc_init *
openblas.spec:%{hpc_init -c %{compiler_family} %{?c_f_ver:-v %{c_f_ver}} %{?ext:-e %{ext}}}

So it is not feasible to build it with regular rpmbuild command,

Then wen I grep the hpc_init in whole iso,

found it was defined in the “build” script.

So what’s the steps to build hpc binary rpm ?

Thanks,
etzhao[/QUOTE]
Hi
It’s part of the build condition (bcond) that’s used with for example the openSUSE Build Service (https://build.opensuse.org/) privided by the over all project config, for example;

It’s really a matter of inspecting the spec file, eg;
https://build.opensuse.org/package/view_file/openSUSE:Factory/openblas/openblas.spec?expand=1

In this case it may be set on the SUSE build system, but not the openSUSE one…

So, why do you need to rebuild? Is there some changes you want?

[{“insert”:"The macro which is missing is provided in package suse-hpc, so this package needs to be installed.
There are tow ways to solve your problem:
1: The most easy and reliable way to build rpm and so hpc is to use the openbuild service. The only caveat is that you need an account on build.opensuse.org, as here all the upstream packages are built. After you obtained an account there you can simply checkout the package with
osc co openSUSE:Factory  openblas
now change to directory ‘openSUSE:Factory\/openblas’ and withing this directoy run
osc build -M gnu-hpc -k .
which will built the hpc flavored (the option -M is for that) bals package and drops the rpm in this directory. Be sure to do this on a proper equipped machine and with a good internet connection as a lot of packages will be downloaded and installed in a virtual root. The packages will be built for Tumbleweed. If you want to build for SLE15SP1 type
osc build -M gnu-hpc -k . --alternative-project SUSE:SLE-15-SP1:GA x86_64
2: You can recompile the package in your local environemt by installing all build decencies with
zypper source-install openblas_0_3_7-gnu-hpc
from then on you should be able to use rpmbuild, but you will have to use the option ‘–with-hpc’ to build the hpc variant.

"}]