-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from willfurnass/ENH_sharc_cmake
ShARC: cmake 3.7.1 (built with gcc 4.9.4)
- Loading branch information
Showing
4 changed files
with
144 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. _cmake_sharc: | ||
|
||
CMake | ||
===== | ||
|
||
CMake is a build tool commonly used when compiling other libraries. | ||
|
||
Usage | ||
----- | ||
|
||
CMake can be loaded with: :: | ||
|
||
module load dev/cmake/3.7.1/gcc-4.9.4 | ||
|
||
NB CMake has a run-time dependency on `libstdc++` so the above also needs to | ||
(and does) load the :ref:`GCC compiler <gcc_sharc>` version 4.9.4. | ||
|
||
Usage often involves: | ||
|
||
1. Creating and ``cd``-ing into a dedicated build directory within a source tree then | ||
2. Running something like ``cmake -DSOME_OPTION -DANOTHER_OPTION ..`` | ||
|
||
Installation | ||
------------ | ||
|
||
Version 3.7.1 | ||
^^^^^^^^^^^^^ | ||
|
||
1. Install using :download:`this script </sharc/software/install_scripts/dev/cmake/3.7.1/gcc-4.9.4/install.sh>` | ||
2. Install :download:`this modulefile </sharc/software/modulefiles/dev/cmake/3.7.1/gcc-4.9.4>` as ``/usr/local/modulefiles/dev/cmake/3.7.1/gcc-4.9.4`` |
72 changes: 72 additions & 0 deletions
72
sharc/software/install_scripts/dev/cmake/3.7.1/gcc-4.9.4/install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
# Install script used to install cmake 3.7.1 on ShARC | ||
|
||
################################################################################ | ||
# Error handling | ||
################################################################################ | ||
handle_error () { | ||
errcode=$? | ||
echo "Error code: $errorcode" | ||
echo "Error cmd: " echo "$BASH_COMMAND" | ||
echo "Error line: ${BASH_LINENO[0]}" | ||
exit $errcode | ||
} | ||
trap handle_error ERR | ||
|
||
################################################################################ | ||
# Set variables | ||
################################################################################ | ||
SHORT_VERS=3.7 | ||
VERS="${SHORT_VERS}.1" | ||
COMPILER=gcc | ||
COMPILER_VERS=4.9.4 | ||
|
||
TARBALL_URL="https://cmake.org/files/v${SHORT_VERS}/cmake-${VERS}.tar.gz" | ||
|
||
TMPDIR="${TMPDIR:-/tmp}" | ||
BUILD_DIR="${TMPDIR}/${USER}/cmake/${VERS}/" | ||
|
||
PREFIX="/usr/local/packages/dev/cmake/${VERS}/${COMPILER}-${COMPILER_VERS}" | ||
|
||
export OMP_NUM_THREADS=16 | ||
|
||
################################################################################ | ||
# Load modules | ||
################################################################################ | ||
# Enable a compiler | ||
module load dev/${COMPILER}/${COMPILER_VERS} | ||
|
||
# Enable sphinx (for building cmake's man pages) | ||
module load apps/python/anaconda3-4.2.0 | ||
|
||
################################################################################ | ||
# Create directories and download + unpack tarball | ||
################################################################################ | ||
mkdir -m 700 -p ${BUILD_DIR} | ||
mkdir -m 2775 -p ${PREFIX} | ||
|
||
pushd ${BUILD_DIR} | ||
curl -L ${TARBALL_URL} | tar -zx | ||
pushd cmake-${VERS} | ||
|
||
################################################################################ | ||
# Configure, build and install | ||
################################################################################ | ||
# Ensure that bootstrap does not find Grid Engine's 'qmake' (when hunting for | ||
# Qt's 'qmake') | ||
alias qmake='/no/file/here' | ||
|
||
# Configure, build and install | ||
./bootstrap \ | ||
--prefix=${PREFIX} \ | ||
--parallel=${OMP_NUM_THREADS} \ | ||
--sphinx-man | ||
#--mandir=${PREFIX}/man \ | ||
gmake -j ${OMP_NUM_THREADS} | ||
gmake install | ||
|
||
################################################################################ | ||
# Set permissions | ||
################################################################################ | ||
chown -R ${USER}:app-admins ${PREFIX} | ||
chmod -R g+w ${PREFIX} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#%Module1.0##################################################################### | ||
## | ||
## cmake 3.7.1 module file | ||
## | ||
|
||
## Module file logging | ||
source /usr/local/etc/module_logging.tcl | ||
|
||
set cmakevers 3.7.1 | ||
set compiler gcc | ||
set compilervers 4.9.4 | ||
|
||
proc ModulesHelp { } { | ||
global cmakevers | ||
global compiler | ||
global compilervers | ||
puts stderr "Makes cmake version $cmakevers (plus $compiler $compilervers) available" | ||
} | ||
module-whatis "Makes cmake version $cmakevers (plus $compiler $compilervers) available" | ||
|
||
module load dev/$compiler/$compilervers | ||
|
||
set CMAKE_HOME /usr/local/packages/dev/cmake/$cmakevers/$compiler-$compilervers | ||
|
||
setenv CMAKE_HOME CMAKE_HOME | ||
prepend-path PATH $CMAKE_HOME/bin | ||
prepend-path MANPATH $CMAKE_HOME/man |