PDA

View Full Version : How to build rpm binary from source rpm under HPC



etzhao
18-Oct-2018, 09:13
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

etzhao
18-Oct-2018, 09:16
I didn't find the guide or any documentation about how to re-build rpms under SLES 15 HPC.

malcolmlewis
18-Oct-2018, 12:58
On Thu 18 Oct 2018 08:14:01 AM CDT, etzhao wrote:


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




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!

etzhao
19-Oct-2018, 02:30
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!

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

malcolmlewis
19-Oct-2018, 02:52
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
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?