Skip to content

Commit

Permalink
Added install numactl from src
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Mar 4, 2024
1 parent 8d22aa3 commit 905edc1
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cm-mlops/script/get-generic-sys-util/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def preprocess(i):
sudo = env.get('CM_SUDO', '')
env['CM_SYS_UTIL_INSTALL_CMD'] = sudo + ' ' +install_cmd + ' ' + package_name


env['+PATH'] = []
if env.get('CM_HOST_OS_FLAVOR', '') == 'rhel':
if env['CM_SYS_UTIL_NAME'] == "g++12":
env['+PATH'] = [ "/opt/rh/gcc-toolset-12/root/usr/bin" ]
Expand Down
93 changes: 93 additions & 0 deletions cm-mlops/script/install-numactl-from-src/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"alias": "install-numactl-from-src",
"automation_alias": "script",
"automation_uid": "5b4e0237da074764",
"cache": true,
"category": "Compiler automation",
"deps": [
{
"tags": "detect,os"
},
{
"tags": "detect,cpu"
},
{
"env": {
"CM_GIT_CHECKOUT_PATH_ENV_NAME": "CM_NUMACTL_SRC_REPO_PATH"
},
"extra_cache_tags": "numactl,src,numactl-src,numactl-src-repo",
"names": [
"numactl-src-repo"
],
"tags": "get,git,repo",
"update_tags_from_env_with_prefix": {
"_branch.": [
"CM_GIT_CHECKOUT"
],
"_repo.": [
"CM_GIT_URL"
],
"_sha.": [
"CM_GIT_CHECKOUT_SHA"
],
"_tag.": [
"CM_GIT_CHECKOUT_TAG"
]
}
}
],
"env": {
"CM_GIT_URL": "https://github.com/numactl/numactl"
},
"name": "Build numactl from sources",
"new_env_keys": [
"CM_NUMACTL_*",
"+PATH"
],
"prehook_deps": [],
"sort": 1000,
"tags": [
"install",
"src",
"from.src",
"numactl",
"src-numactl"
],
"uid": "4f355ae8ca1948b2",
"variations": {
"branch.#": {
"env": {
"CM_GIT_CHECKOUT": "#"
}
},
"repo.#": {
"env": {
"CM_GIT_URL": "#"
},
"group": "repo"
},
"repo.https://github.com/numactl/numactl": {
"default": true,
"env": {
"CM_GIT_URL": "https://github.com/numactl/numactl"
},
"group": "repo"
},
"sha.#": {
"env": {
"CM_GIT_CHECKOUT_SHA": "#"
}
},
"tag.#": {
"ad": {
"pytorch-src-repo": {
"tags": "_no-recurse-submodules,_full-history"
}
},
"env": {
"CM_GIT_CHECKOUT_TAG": "#"
}
}
},
"versions": {}
}
23 changes: 23 additions & 0 deletions cm-mlops/script/install-numactl-from-src/customize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from cmind import utils
import os

def preprocess(i):

os_info = i['os_info']

if os_info['platform'] == 'windows':
return {'return':1, 'error': 'Windows is not supported in this script yet'}

env = i['env']

run_cmd="python setup.py install"

env['CM_RUN_CMD'] = run_cmd

automation = i['automation']

recursion_spaces = i['recursion_spaces']

env['+PATH'] = []

return {'return':0}
19 changes: 19 additions & 0 deletions cm-mlops/script/install-numactl-from-src/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

CUR_DIR=$PWD
echo $PWD
rm -rf numactl
cmd="cp -r ${CM_NUMACTL_SRC_REPO_PATH} numactl"
echo "$cmd"
eval "$cmd"
cd numactl
./autogen.sh
./configure
if [ "${?}" != "0" ]; then exit 1; fi
make
if [ "${?}" != "0" ]; then exit 1; fi
#make install DESTDIR=$CUR_DIR
sudo make install
if [ "${?}" != "0" ]; then exit 1; fi

echo "******************************************************"

0 comments on commit 905edc1

Please sign in to comment.