Skip to content

Commit f5817f1

Browse files
committed
libMesh v1.3.1 .deb package for Ubuntu 16.04.
1 parent 9659d98 commit f5817f1

File tree

5 files changed

+104
-1
lines changed

5 files changed

+104
-1
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
.DS_Store
1+
.DS_Store
2+
3+
libmesh/ubuntu16.04/libmesh/
4+
libmesh/ubuntu16.04/libmesh-1.3.1-1/
5+
libmesh/ubuntu16.04/libmesh-1.3.1-1.deb

libmesh/ubuntu16.04/DEBIAN/control

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Package: libmesh-1.3.1
2+
Version: 1.3.1-1
3+
Section: base
4+
Priority: optional
5+
Architecture: amd64
6+
Depends: gfortran (>= 4.5),
7+
openmpi-bin (>= 1.10), libopenmpi-dev (>= 1.10),
8+
libpetsc3.6 (>= 3.6), libpetsc3.6.2-dev (>= 3.6),
9+
libslepc3.6 (>= 3.6), libslepc3.6.1-dev (>= 3.6),
10+
libparpack2-dev (>= 3.3),
11+
libboost-all-dev (>= 1.58),
12+
libeigen3-dev (>= 3.2)
13+
Maintainer: Joshua Deaton <jdeaton@users.noreply.github.com>
14+
Description: libMesh
15+
The libMesh library provides a framework for the numerical simulation
16+
of partial differential equations using arbitrary unstructured discretizations
17+
on serial and parallel platforms. A major goal of the library is to provide
18+
while allowing a research scientist to focus on the physics they are modeling.

libmesh/ubuntu16.04/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# libMesh - Ubuntu 16.04 (Travis CI)
2+
This directory contains a script for creating a `.deb` package that can be installed on Ubuntu 16.04 (Xenial) (or possibly another Debian-based Linux distribution). The resulting package will work on the default **Travis CI** *xenial* runner. At this point, all dependencies are installed using Ubuntu's standard package manager.
3+
4+
## Building on Ubuntu 16.04
5+
On a Ubuntu 16.04 system, simply run the script `build_libmesh_deb.sh`. This script will:
6+
7+
1. Install required dependencies with the standard package manager and Ubuntu repositories.
8+
2. Fetch the libMesh v1.3.1 release from GitHub.
9+
3. Unpack, compile, and install libMesh libraries and headers to `/usr/local`.
10+
4. Create the package `libmesh-1.3.1-1.deb`.
11+
12+
## Building with Ubuntu 16.04 Docker image
13+
The `libmesh-1.3.1-1.deb` package can also be generated using a Ubuntu 16.04 Docker image. From within the current directory call `run_with_docker.sh`, which will drop you inside an interactive Docker container. Note that the current directory (containing this file) is mapped to `/package` inside the container.
14+
15+
Next, run
16+
17+
```
18+
apt-get update
19+
apt-get install sudo
20+
cd /package
21+
```
22+
23+
The build script can then be run as `build_libmesh_deb.sh` and the resulting `libmesh-1.3.1-1.deb` will be available outside the Docker container in the current directory.
24+
25+
## References
26+
The following links contain references related to making binary packages on Ubuntu.
27+
- https://ubuntuforums.org/showthread.php?t=910717
28+
- https://askubuntu.com/questions/1345/what-is-the-simplest-debian-packaging-guide
29+
- https://www.debian.org/doc/debian-policy/ch-controlfields.html
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
# Get # of processors in environment variables.
4+
export NP=$(nproc)
5+
# Store current location as working directory.
6+
export WORK_DIR=${PWD}
7+
8+
# Update packages fromt apt repos.
9+
sudo apt-get update
10+
sudo apt-get -y install build-essential gfortran wget less m4 git cmake
11+
sudo apt-get -y install openmpi-bin libopenmpi-dev
12+
sudo apt-get -y install libpetsc3.6 libpetsc3.6.2-dbg libpetsc3.6.2-dev
13+
sudo apt-get -y install libslepc3.6 libslepc3.6.1-dbg libslepc3.6.1-dev
14+
sudo apt-get -y install libparpack2-dev
15+
sudo apt-get -y install libboost-all-dev
16+
sudo apt-get -y install libeigen3-dev
17+
18+
# Fetch/build libMesh.
19+
mkdir libmesh
20+
cd libmesh
21+
wget https://github.com/libMesh/libmesh/releases/download/v1.3.1/libmesh-1.3.1.tar.gz
22+
tar -xvf libmesh-1.3.1.tar.gz
23+
cd libmesh-1.3.1
24+
mkdir build
25+
cd build
26+
export PETSC_DIR=/usr/lib/petscdir/3.6.2/x86_64-linux-gnu-real
27+
export SLEPC_DIR=/usr/lib/slepcdir/3.6.1/x86_64-linux-gnu-real
28+
export HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/openmpi
29+
../configure --prefix=/usr/local --with-methods="opt dbg" --disable-metaphysicl --disable-examples
30+
make -j ${NP}
31+
sudo make install
32+
33+
# Organize libMesh include/ and lib/ for packaging.
34+
cd ${WORK_DIR}
35+
export PKG_DIR=libmesh-1.3.1-1
36+
export INST_DIR=${PKG_DIR}/usr/local
37+
mkdir ${PKG_DIR}
38+
mkdir ${PKG_DIR}/usr
39+
mkdir ${PKG_DIR}/usr/local
40+
mkdir ${PKG_DIR}/usr/local/include
41+
mkdir ${PKG_DIR}/usr/local/lib
42+
cp -r /usr/local/include/* ${INST_DIR}/include
43+
cp -r /usr/local/lib/libmesh* ${INST_DIR}/lib
44+
cp -r /usr/local/lib/libnetcdf* ${INST_DIR}/lib
45+
46+
# Copy in DEBIAN/control package configuration file.
47+
cp -r ${WORK_DIR}/DEBIAN ${PKG_DIR}
48+
49+
# Create libMesh .deb package.
50+
dpkg-deb --build libmesh-1.3.1-1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docker rm libmesh-pkg-build-ubuntu-16.04
2+
docker run -it --entrypoint /bin/bash --name libmesh-pkg-build-ubuntu-16.04 -v ${PWD}:/package ubuntu:16.04

0 commit comments

Comments
 (0)