Skip to content

Commit

Permalink
Update for 2023 (#48)
Browse files Browse the repository at this point in the history
Lots of changes for 2023, mostly to make things work with a new version of Spack, but also for now to detach from using tcl environment-modules, to just using spack load.

* Update to match current versions
* pre-commit fix
* Fix container section to actually work

Changes to the spack.yaml meant it didn't build right.  Also, the inner MPI
doesn't match the outer MPI, so running across multiple nodes won't work with
that example.  I've tidied it so it at least works on a single node.
  • Loading branch information
jhodrien authored Sep 22, 2023
1 parent 691c0be commit e4a4304
Show file tree
Hide file tree
Showing 21 changed files with 1,075 additions and 920 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
run: |
conda activate arcdocs-jb
jupyter-book build ./book/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
**/_build/*

# vagrant stuff
**/.vagrant/*
**/.vagrant/*
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch, main]
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ If you have any questions that aren't discussed below, please let us know throug
You can get in touch with the Research Computing Team at Leeds via the following channels:
- Open an [issue](https://github.com/ARCTraining/template-jb-docs/issues)
- Email the Research Computing Team via [[email protected]](mailto:[email protected])

2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/bionic64"

config.vm.hostname = "arcdocsSite"
config.vm.hostname = "arcdocsSite"

config.vm.provision :shell, path: "vagrant/bootstrap.sh"
end
2 changes: 1 addition & 1 deletion book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ sections:
sections:
- file: course/spack/installing
- file: course/spack/testinstall
- file: course/spack/modules
- file: course/spack/existing
- file: course/spack/advanced
- file: course/spack/containers
- file: course/spack/environments
- file: course/spack/recipes
- file: course/spack/modules
- url: https://arc.leeds.ac.uk
title: Research Computing Website
2 changes: 1 addition & 1 deletion book/course/autotools.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
Expand Down
16 changes: 8 additions & 8 deletions book/course/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CMake was loaded with the command:

## Introduction

CMake is a collection of tools for building, testing and packaging software.
CMake is a collection of tools for building, testing and packaging software.
It is open source and cross platform and supports a variety of different build tools including Make, Microsoft Visual Studio, Apple's Xcode and others.

CMake works by generating build files from a series of CMake configuration files which the relevant build tool can be used to build the software from.
Expand All @@ -27,7 +27,7 @@ If you don't have CMake installed you can download the latest version for your o

## Building software with CMake

In the following section we'll explore a small example of building the command line tool [cURL](https://curl.se/) using CMake.
In the following section we'll explore a small example of building the command line tool [cURL](https://curl.se/) using CMake.
cURL is a tool for transferring data using various network protocols and is commonly used for downloading data from the internet.

```{note}
Expand All @@ -48,12 +48,12 @@ This will download the cURL source code with the history of the associated relea

Now we've downloaded the cURL source code we need to configure it before building using CMake.
To do this we need to create a `build` directory that will contain all of the autogenerated build file.
Once we've created a `build` directory we run `cmake` to perform the configuration steps.
Once we've created a `build` directory we run `cmake` to perform the configuration steps.
You can do this directly in the command line by running `cmake` and specifying additional options or you can use `ccmake` to do configuration interactives through a GUI-like interface.

#### Using cmake directly

Running CMake directly runs all the configuration steps and provides some output to the screen.
Running CMake directly runs all the configuration steps and provides some output to the screen.
We can modify CMake default behaviour by passing additional arguments to `cmake` at this stage.

```bash
Expand All @@ -69,7 +69,7 @@ $ cmake ..
For modern installations of CMake it is preferable to specify the source and build directories directly when running `cmake`.

```bash
$ cd curl
$ cd curl

$ mkdir build

Expand All @@ -92,7 +92,7 @@ Running this line on ARC4 will provide output similar to this:
-- Build files have been written to: /home/home01/arcuser/curl
```

As we're doing this on ARC4 where a version of cURL is already installed we should probably make some tweaks.
As we're doing this on ARC4 where a version of cURL is already installed we should probably make some tweaks.
We can do this directly by passing specific arguments to `cmake`, in this example we want to specify a specific local build directory and set the name of the associated library `libcurl` that gets built to avoid conflicts with the system-installed `libcurl`.

```bash
Expand Down Expand Up @@ -661,7 +661,7 @@ Once the make step completes successfully we can install the cURL executable to
$ make install
```

If you've set everything up as I have on ARC4 and run this in your /home directory your new cURL executable will be at `~/curl/install/bin`.
If you've set everything up as I have on ARC4 and run this in your /home directory your new cURL executable will be at `~/curl/install/bin`.
However, because we already have a system-installed cURL version we need to do an extra step before testing out our newly built version of cURL.
Crucially, we need to make the `libcurl2` library that was also built with cURL available for our new cURL executable to use.
If we try and run our new cURL without doing this step we get the following error:
Expand All @@ -673,7 +673,7 @@ $ ~/curl/build/bin/curl --version
/home/home01/arcuser/curl/install/bin/curl: error while loading shared libraries: libcurl2.so: cannot open shared object file: No such file or directory
```

This is because `libcurl2` is not available to use via the associated environment variable.
This is because `libcurl2` is not available to use via the associated environment variable.
To solve this we need to update the `LD_LIBRARY_PATH` variable to include the directory containing `libcurl2.so`.
We do this by appending a directory path to the colon-separated `LD_LIBRARY_PATH` variable.

Expand Down
Loading

0 comments on commit e4a4304

Please sign in to comment.