Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
please-install
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atlas
please-install
Commits
27c94fd9
Commit
27c94fd9
authored
Sep 22, 2017
by
Guillaume DOLLÉ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cling install script
parent
23d0ea4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
159 additions
and
0 deletions
+159
-0
cling/install.sh
cling/install.sh
+127
-0
cling/module.tmpl
cling/module.tmpl
+32
-0
No files found.
cling/install.sh
0 → 100755
View file @
27c94fd9
#!/bin/bash
set
-x
################################################################################
# GENERIC: Base directory for source, install, build.
SOURCE_BASE_DIR
=
/data/software/sources
BUILD_BASE_DIR
=
/data/software/sources
INSTALL_BASE_DIR
=
/data/software/install
MODULE_BASE_DIR
=
/data/software/modules
################################################################################
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
LIB_NAME
=
"cling"
LIB_VERSION
=
0.4.0
GCC_VERSION
=
6.4.0
CMAKE_VERSION
=
3.9.2
# Use cern repository! (patched version)
LLVM_REPOSITORY
=
http://root.cern.ch/git/llvm.git
CLING_REPOSITORY
=
http://root.cern.ch/git/cling.git
CLANG_REPOSITORY
=
http://root.cern.ch/git/clang.git
LIB_VERSION_MAJOR
=
`
echo
"
${
LIB_VERSION
}
"
|
sed
's/\([0-9]\)[.][0-9][.][0-9]/\1/g'
`
LIB_VERSION_MINOR
=
`
echo
"
${
LIB_VERSION
}
"
|
sed
's/[0-9][.]\([0-9]\)[.][0-9]/\1/g'
`
LIB_VERSION_PATCH
=
`
echo
"
${
LIB_VERSION
}
"
|
sed
's/[0-9][.][0-9][.]\([0-9]\)/\1/g'
`
GCC_VERSION_MAJOR
=
`
echo
"
${
GCC_VERSION
}
"
|
sed
's/\([0-9]\)[.][0-9][.][0-9]/\1/g'
`
GCC_VERSION_MINOR
=
`
echo
"
${
GCC_VERSION
}
"
|
sed
's/[0-9][.]\([0-9]\)[.][0-9]/\1/g'
`
GCC_VERSION_PATCH
=
`
echo
"
${
GCC_VERSION
}
"
|
sed
's/[0-9][.][0-9][.]\([0-9]\)/\1/g'
`
DEPEND_GCC
=
gcc-
${
GCC_VERSION_MAJOR
}${
GCC_VERSION_MINOR
}${
GCC_VERSION_PATCH
}
DEPEND_MODULE_GCC
=
gcc
${
GCC_VERSION_MAJOR
}${
GCC_VERSION_MINOR
}${
GCC_VERSION_PATCH
}
SOURCE_DIR
=
${
SOURCE_BASE_DIR
}
/
${
LIB_NAME
}
/
${
LIB_VERSION
}
/
${
DEPEND_GCC
}
BUILD_DIR
=
${
BUILD_BASE_DIR
}
/
${
LIB_NAME
}
/
${
LIB_VERSION
}
/
${
DEPEND_GCC
}
/build
INSTALL_DIR
=
${
INSTALL_BASE_DIR
}
/
${
LIB_NAME
}
/
${
LIB_VERSION
}
/
${
DEPEND_GCC
}
MODULE_DIR
=
${
MODULE_BASE_DIR
}
/compilers/
${
LIB_NAME
}
MODULE_PATH
=
${
MODULE_DIR
}
/
${
LIB_VERSION
}
_
${
DEPEND_MODULE_GCC
}
prepare_lib
()
{
# Prepare directories.
mkdir
-p
${
SOURCE_DIR
}
cd
${
SOURCE_DIR
}
if
[[
!
-d
${
SOURCE_DIR
}
/llvm
]]
;
then
echo
"-- Cloning repositories in
${
SOURCE_DIR
}
/"
#--------------------------------------------------
# Get LLVM
git clone
${
LLVM_REPOSITORY
}
cd
llvm
#git checkout cling-patches
git checkout tags/cling-v
${
LIB_VERSION_MAJOR
}
.
${
LIB_VERSION_MINOR
}
cd
tools
#--------------------------------------------------
# Get cling
git clone
${
CLING_REPOSITORY
}
cd
cling
git checkout tags/v
${
LIB_VERSION_MAJOR
}
.
${
LIB_VERSION_MINOR
}
cd
..
#--------------------------------------------------
# Get clang
git clone
${
CLANG_REPOSITORY
}
#git clone https://github.com/llvm-mirror/lld.git
cd
clang
git checkout tags/cling-v
${
LIB_VERSION_MAJOR
}
.
${
LIB_VERSION_MINOR
}
cd
..
else
echo
"[WARNING] Repo exist ignore clone! (
${
SOURCE_DIR
}
/llvm)"
fi
}
build_lib
()
{
echo
"-- Building
${
LIB_NAME
}
-
${
LIB_VERSION
}
"
if
[[
!
-d
${
BUILD_DIR
}
]]
;
then
mkdir
-p
${
BUILD_DIR
}
else
echo
"[WARNING] Build directory exist! Remove it first !
${
BUILD_DIR
}
"
exit
1
fi
module purge
module load gcc/
${
GCC_VERSION
}
module load cmake/
${
CMAKE_VERSION
}
_
${
GCC_VERSION_MAJOR
}${
GCC_VERSION_MINOR
}${
GCC_VERSION_PATCH
}
module list
# Check gcc version here
gcc
--version
|head
-n
1
sleep
2
cmake
-DCMAKE_C_COMPILER
=
`
which gcc
`
\
-DCMAKE_CXX_COMPILER
=
`
which g++
`
\
-DCMAKE_INSTALL_PREFIX
=
${
INSTALL_DIR
}
/
\
-DPYTHON_EXECUTABLE
=
`
which python
`
\
-DCMAKE_BUILD_TYPE
=
Release
\
-DBUILD_SHARED_LIBS
=
ON
\
-LLVM_TOOL_LLD_BUILD
=
ON
\
${
SOURCE_DIR
}
/llvm
cmake
--build
.
--
-j
}
install_lib
()
{
cmake
--build
.
--target
install
}
install_module
()
{
cd
$SCRIPT_DIR
mkdir
-p
${
MODULE_DIR
}
export
LIB_NAME
export
LIB_VERSION
export
INSTALL_DIR
envtpl
--keep-template
-o
$MODULE_PATH
module.tmpl
}
if
[[
$1
==
"module"
]]
then
install_module
else
prepare_lib
build_lib
install_lib
install_module
fi
cling/module.tmpl
0 → 100644
View file @
27c94fd9
#%Module1.0#####################################################################
###
### {{ LIB_NAME }} {{ LIB_VERSION }} module
###
proc ModulesHelp { } {
global version prefix
puts stderr "\tcompilers/{{ LIB_NAME }}/{{ LIB_VERSION }} - loads {{ LIB_NAME }} {{ LIB_VERSION }} and its environment"
}
module-whatis "Loads {{ LIB_NAME }} {{ LIB_VERSION }} and its environment"
# for Tcl script use only
set version {{ LIB_VERSION }}
set prefix {{ INSTALL_DIR }}
prepend-path CMAKE_PREFIX_PATH $prefix
prepend-path PATH $prefix/bin
prepend-path LD_LIBRARY_PATH $prefix/lib
prepend-path MANPATH $prefix/share/man
unsetenv LANGUAGE
unsetenv LANG
unsetenv LC
setenv CC $prefix/bin/clang
setenv CXX $prefix/bin/clang++
if { [ module-info mode load ] } {
puts stderr "INFO: {{ LIB_NAME }}/{{ LIB_VERSION }}: llvm clang changed!"
puts stderr [exec clang --version 2>&1 | grep "clang" | sed "s/(.*)//g" ]
}
Write
Preview
Markdown
is supported
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