Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Goran Jelic-Cizmek
coffe
Commits
01159118
Commit
01159118
authored
Apr 22, 2022
by
Goran Jelic-Cizmek
Browse files
Added script for installing CLASS
parent
ddce9791
Changes
1
Hide whitespace changes
Inline
Side-by-side
install_class.sh
0 → 100755
View file @
01159118
#!/usr/bin/env sh
set
-e
# installer for CLASS when using a conda environment
CLASS_DIR
=
"class_public"
CLASS_REMOTE_URL
=
"https://github.com/JCGoran/class_public"
CLASS_BRANCH
=
"feature/conda"
install_class
(){
if
[
-z
"
${
CONDA_PREFIX
}
"
]
then
printf
'You need to activate a conda environment using `conda activate [ENVIRONMENT]` before running this script\n'
return
1
fi
if
[
!
-d
"
${
CLASS_DIR
}
"
]
then
printf
'Attempting to install CLASS in the current environment (%s)...\n'
"
${
CONDA_DEFAULT_ENV
}
"
printf
'Cloning to directory %s...\n'
"
${
CLASS_DIR
}
"
git clone
--branch
"
${
CLASS_BRANCH
}
"
"
${
CLASS_REMOTE_URL
}
"
"
${
CLASS_DIR
}
"
fi
make
-C
"
${
CLASS_DIR
}
"
libclass.a
&&
cp
-a
"
${
CLASS_DIR
}
/libclass.a"
"
${
CONDA_PREFIX
}
/lib/"
&&
cp
-a
"
${
CLASS_DIR
}
/include/"
*
.h
"
${
CONDA_PREFIX
}
/include/"
printf
'CLASS successfully installed\n'
}
install_class
set
+e
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment