LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2024, 06:59 AM   #1
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 166

Rep: Reputation: Disabled
Question about custom packages on repo and sources


Hi all,

I was working to compile most needed parts of AMD ROCm 6.1.0 for Slackware 15 / current x86_64
and I now trying to prepare the repository but I have a questions about the process and good practices.

As a Slackware user from version 3.6 I know the packages is named: name-version-arch-build.txz

I compile the sources but I don't want my initials to be on package like name-version-arch-build_initials.txz

My first question is: Do I can name them like name-version-arch-build.txz for example: hipSOLVER-6.1.0-x86_64-1.txz

Second question: Because we don't have a package manager like Ubuntu or Arch to support requirements, I named my files like their compilation order and file: 16.composable-kernel.sh

and inside the file is the whole build script + slack-desc:

Code:
#!/bin/bash

export ROCM_INSTALL_DIR=/opt/rocm
export ROCM_MAJOR_VERSION=6
export ROCM_MINOR_VERSION=1
export ROCM_PATCH_VERSION=0
export PKGVER=6.1.0
export ROCM_REL_DIR=/usr/local/src/rocm/release
export ROCM_BUILD_DIR=/usr/local/src/rocm/rocm-build/build
export PATH=$ROCM_INSTALL_DIR/bin:$ROCM_INSTALL_DIR/llvm/bin:$ROCM_INSTALL_DIR/hip/bin:$CMAKE_DIR/bin:$PATH
export ARCH=${ARCH:-x86_64}
export OUTPUT=${OUTPUT:-/usr/local/src/roc}
export LDIR=${LDIR:-rocm-6.1.0}

echo "|Taking 2 days for compilation|"

cd $ROCM_REL_DIR
wget https://github.com/ROCm/composable_kernel/archive/rocm-$PKGVER.tar.gz
tar xf composable_kernel-$LDIR.tar.gz
rm -rf $ROCM_BUILD_DIR/composable_kernel
mkdir -p $ROCM_BUILD_DIR/composable_kernel
cd $ROCM_BUILD_DIR/composable_kernel

DEST=$OUTPUT/package-composable_kernel
PRGNAM=composable_kernel
#4 job for this package is maximum, otherwise on 16 threads take 300+GB RAM memory and took 2 days
NUMJOBS=4
BUILD=1


#export HIPCC_COMPILE_FLAGS_APPEND="-parallel-jobs=$(nproc)"
#export HIPCC_LINK_FLAGS_APPEND="-parallel-jobs=$(nproc)"

cmake \
    -Wno-dev \
    -G Ninja \
    -D CMAKE_CXX_COMPILER=$ROCM_INSTALL_DIR/bin/hipcc \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=$ROCM_INSTALL_DIR \
    -D BUILD_DEV=OFF \
    -D INSTANCES_ONLY=ON \
    $ROCM_REL_DIR/composable_kernel-$LDIR

"${NINJA:=ninja}" $NUMJOBS || exit 1
DESTDIR=$DEST ${NINJA} install || exit 1

mkdir -p $DEST/install
cat >> $DEST/install/slack-desc << 'END'
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

                 |-----handy-ruler------------------------------------------------------|
composable_kernel: composable_kernel (High Performance Composable Kernel for AMD GPUs)
composable_kernel:
composable_kernel: The Composable Kernel (CK) library provides a programming model for
composable_kernel: writing performance-critical kernels for machine learning workloads
composable_kernel: across multiple architectures (GPUs, CPUs, etc.). The CK library
composable_kernel: uses general purpose kernel languages, such as HIP C++.
composable_kernel:
composable_kernel:
composable_kernel:
composable_kernel:
composable_kernel:
END

cd $DEST
makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$ARCH-$BUILD.txz
because I will release also the build scripts if some one want to use them or build future versions.

My question is: Do I need to make a slack-desk file or this way like above is also acceptable ?

Last edited by gildbg; 05-10-2024 at 07:01 AM.
 
Old 05-10-2024, 07:06 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,422

Rep: Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339
I think the form is to add something to distinguish your packages from the official ones, e.g. hipSOLVER-6.1.0-x86_64-1gildbg.txz
 
Old 05-10-2024, 09:11 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,916

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
If you're planning to submit your slackbuilds to slackbuilds.org then they have their own requirements you have to adhere to. If you're just writing them for yourself, or are going to publish them yourself independently of slackbuilds.org then you can pretty much suit yourself.

I use a "here document" for my slack-desc content too in all my builds. No problem doing that.

As for tagging with a unique identifier, its not required, but its a good idea to follow the convention. It doesn't have to be your initials, anything will do.
 
1 members found this post helpful.
Old 05-10-2024, 11:00 PM   #4
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,979

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by gildbg View Post
My question is: Do I need to make a slack-desc file or this way like above is also acceptable ?
I create my own build scripts. As long as the package has a slack-desc file, how you get there is up to you. You method is fine in my opinion. I don't use a slack-desc file, I add it via the SlackBuild.

Last edited by chrisretusn; 05-10-2024 at 11:06 PM.
 
Old 05-10-2024, 11:28 PM   #5
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,979

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
A couple of more things.

Quote:
Originally Posted by gildbg View Post
I compile the sources but I don't want my initials to be on package like name-version-arch-build_initials.txz

My first question is: Do I can name them like name-version-arch-build.txz for example: hipSOLVER-6.1.0-x86_64-1.txz
You can name packages as above. You don't have to use your initials (or whatever you want) in the TAG to the package. This is what I use for packages.
Code:
$PKGNAM-$PKGVER-$ARCH-${BUILD}$TAG.$PKGTYPE
PKGNAM=name
PKGVER=1.2.3
ARCH=x86_64
BUILD=1
TAG=cgs
PKGTYPE=txz
I would recommend you add a tag of some sort. All most all third party packages come with a tag. Slackware official packages do not come with tags (exception patches). Easy way to tell the difference between official and unofficial (third party) packages.

What you do inside a SlackBuild is up to you. You goal should be to create a valid and complete Slackware package.
 
3 members found this post helpful.
Old 05-12-2024, 02:41 AM   #6
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 166

Original Poster
Rep: Reputation: Disabled
Thanks for information.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources LXer Syndicated Linux News 0 03-15-2024 08:32 PM
Building debian packages for all architectures from one package and scanning to repositories to host that packages on apt repo tenet Debian 1 05-23-2022 07:42 PM
[SOLVED] Error: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:22 Commomore Linux - Newbie 12 02-05-2019 12:24 AM
how to use syanptic in fc 5 and how to add repo and which repo to be added.. vikas04522 Fedora 1 08-26-2006 12:41 PM
how to use syanptic in fc 5 and how to add repo in it and which repo is to be added.. vikas04522 Linux - Software 1 08-26-2006 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration