Skip to content

Commit

Permalink
Added install instructions for Ubuntu 18.04 apt dependencies to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeaton committed Jul 24, 2020
1 parent 991ec4b commit 7860f77
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/install/install.dox
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Specific instructions for installation are provided in these pages
- \subpage SpackInstall
- \subpage InstallUbuntu2004Apt
- \subpage InstallUbuntu1910Apt
- \subpage InstallUbuntu1804Apt

*/

210 changes: 210 additions & 0 deletions doc/install/install_ubuntu_1804_apt.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
/**
\page InstallUbuntu1804Apt Installation on Ubuntu 18.04 (Bionic)

This page describes how to install libMesh/MAST on Ubuntu 18.04 (Eoan Ermine) using dependencies from the standard package manager. It is written for someone who has limited experience compiling software on Linux and contains details a more advanced user likely won't need.

\section install-ubuntu1804-dependencies Dependencies

Installing libMesh/MAST on Ubuntu 18.04 (Bionic Beaver) is relatively simple if you are able to use Ubuntu's Advanced Packaging Tool (APT) since all of the dependencies are provided in the standard package repositories. To do so we assume you have `sudo` privileges on your system and it is connected to the internet. If you are not a privileged user, ask an administrator to install these dependencies or consider \ref InstallManualDepsLinux "manually compiling/installing the dependencies" in your home directory.

To install all of the dependencies, simply execute the following commands in the terminal/shell. Some of the packages will install a number of required sub-dependencies.

\code{.sh}
sudo apt-get install -y git m4
sudo apt-get install -y gcc gfortran
sudo apt-get install -y libblas-dev
sudo apt-get install -y liblapack-dev liblapack-doc liblapack-doc-man
sudo apt-get install -y mpi-default-dev libopenmpi-dev openmpi-doc
sudo apt-get install -y petsc-dev libpetsc3.7-dev libpetsc3.7.7 libpetsc3.7.7-dbg libpetsc3.7.7-dev petsc3.7.7-doc
sudo apt-get install -y slepc-dev libslepc3.7-dev libslepc3.7.4 libslepc3.7.4-dev slepc3.7.4-doc
sudo apt-get install -y libmetis-dev libmetis5-dbg libmetis-doc
sudo apt-get install -y libparmetis-dev parmetis-doc
sudo apt-get install -y libboost-all-dev libboost-doc
sudo apt-get install -y libeigen3-dev libeigen3-doc
sudo apt-get install -y libglpk-dev glpk-utils glpk-doc
sudo apt-get install -y libnlopt-dev libnlopt0
sudo apt-get install -y libvtk6-dev libvtk6.3 vtk6
\endcode

\section update-cmake-ubuntu1804 CMake
We utilize some newer features in CMake and require a more recent version (3.13) than is included in the default APT repositories (3.10) for Ubuntu 18.04. The following code adds Kitware's (CMake maintainers) APT repository and installs the most recent version of CMake.

\code{.sh}
sudo apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
sudo apt-get -y install cmake
\endcode

\section install-ubuntu1804-libmesh libMesh

When using dependencies from Ubuntu 19.10's standard package repository, only a recent version of libMesh can be built. Any official libMesh "release" up to and include v1.5.1 will fail to build with linking errors related to a conflict between the Ubuntu `apt` provided `metis` (which the provided PETSc package requires) and the `metis` that libMesh builds itself. This issue was [resolved](https://github.com/libMesh/libmesh/pull/2427) in libMesh repository commit `df1e2b7` by adding the ability for libMesh to properly use an external `metis`. The MAST developers currently provide a version of libMesh v1.5.1 that have the fixes for the build patched in.

As a result, we need to build libMesh from the `v1.5.1_with_build_updates` branch of [jdeaton's fork](https://github.com/jdeaton/libmesh) of the official libMesh [repository](https://github.com/libMesh/libmesh). To do this we first clone the forked repository from GitHub, then checkout the appropriate branch of the code. From the directory where you want to build libMesh, execute the following in the terminal/shell, which will clone libMesh into a new directory `libmesh`:

\code{.sh}
git clone https://github.com/jdeaton/libmesh.git
cd libmesh
git checkout v1.5.1_with_build_updates
git submodule init
git submodule update
\endcode

libMesh compilation/installation follows the common Makefile-based `configure`, `make`, `make install` process that is common on Linux/Unix systems. Before beginning, we set a few environment variables by executing the following commands from inside the `libmesh` directory in the terminal/shell. `libMesh_INSTALL_DIR` specifies where the products of the libMesh build process will be installed. By default, text below specifies a directory that will be alongside `libmesh` named `libmesh_install`. You may change this if you wish. `NP` specifies the number of parallel jobs to use during compilation.

\code{.sh}
export libMesh_INSTALL_DIR="$(cd ..; pwd)/libmesh_install"
export NP=4
\endcode

We recommend compiling libMesh in a dedicated build directory to keep from cluttering the main libMesh repository. From inside the `libmesh` directory, create a build directory and navigate into it with:

\code{.sh}
mkdir build
cd build
\endcode

We can now configure the libMesh build by pasting the entire contents of the following snippet into the shell/terminal. By default, libMesh will configure optimized, development, and debug versions of the library.

\code{.sh}
PETSC_DIR=/usr/lib/petsc \
SLEPC_DIR=/usr/lib/slepc \
../configure \
--prefix=${libMesh_INSTALL_DIR} \
--disable-strict-lgpl \
--enable-triangle=yes \
--enable-tetgen=yes \
--with-metis=/usr/lib/x86_64-linux-gnu \
--with-metis-include=/usr/include \
--with-eigen-include=/usr/include \
--with-glpk-include=/usr/include \
--with-glpk-lib=/usr/lib/x86_64-linux-gnu \
--with-nlopt-include=/usr/include \
--with-nlopt-lib=/usr/lib/x86_64-linux-gnu \
--with-vtk-include=/usr/include/vtk-6.3 \
--with-vtk-lib=/usr/lib/x86_64-linux-gnu
\endcode

If the configuration was successful, you should have the following output under `Optional Packages`:

\code{.sh}
Optional Packages:
boost............................ : yes
capnproto........................ : no
cppunit.......................... : no
curl............................. : no
eigen............................ : yes
exodus........................... : yes
version....................... : v5.22
fparser.......................... : yes
build from version............ : release
glpk............................. : yes
gmv.............................. : yes
gzstream......................... : yes
hdf5............................. : no
laspack.......................... : yes
libhilbert....................... : yes
metaphysicl...................... : yes
metis............................ : yes
mpi.............................. : yes
nanoflann........................ : yes
nemesis.......................... : yes
version....................... : v5.22
netcdf........................... : yes
version....................... : 4
nlopt............................ : yes
parmetis......................... : yes
petsc............................ : yes
version....................... : 3.7.7
qhull............................ : yes
sfcurves......................... : yes
slepc............................ : yes
version....................... : 3.7.4
thread model..................... : pthread
c++ rtti ........................ : yes
tecio............................ : yes
tecplot...(vendor binaries)...... : no
tetgen........................... : yes
triangle......................... : yes
trilinos......................... : no
vtk.............................. : yes
version....................... : 6.3.0
\endcode

We can now compile the libMesh binaries by executing in the terminal/shell, which will take some time:

\code{.sh}
make -j ${NP}
\endcode

Optionally, you can now test compiled libraries by executing `make check` in the terminal/shell. This will compile and run a number of example cases provided in the libMesh source. Note that this will take a long time and since you are using standard, well-maintained dependencies it is probably not necessary.

Finally, we will install the products of the libMesh compilation by simply executing the following, which will place all of the necessary libMesh files for MAST into the directory specified above with `libMesh_INSTALL_DIR`. Optionally, after this is complete, you can test the installed binaries using `make checkinstall`. Again, this takes quite a while and is likely not necessary with this standard installation.

\code{.sh}
make install
\endcode

The important directories from the installed contents are:
- `${libMesh_INSTALL_DIR}/bin` - libMesh utility programs
- `${libMesh_INSTALL_DIR}/contrib` - third-party utility programs bundled with libMesh
- `${libMesh_INSTALL_DIR}/examples` - source code for libMesh examples and wrapper scripts to run them
- `${libMesh_INSTALL_DIR}/include` - development headers for libMesh and bundled third-party packages
- `${libMesh_INSTALL_DIR}/lib` - libraries for libMesh and bundled third-party packages
- `${libMesh_INSTALL_DIR}/share` - single element reference meshes

\section install-ubuntu1804-mast MAST

The following instructions describe how to configure and compile the MAST library, some example programs, and the unit tests. In this guide, we don't build support for Cython, the pyNastran interface, interfaces to commercial/licensed optimizers (DOT, SNOPT, GCMMA) or the documentation.

Since MAST is in a state of ongoing development, we will build it from the `master` branch on the [GitHub repository](https://github.com/MASTmultiphysics/mast-multiphysics) so we have the most up-to-date changes. If you have forked MAST, substitute the remote URL for you fork in the `git clone` line.

We begin by cloning the repository from inside the directory of your choice:

\code{.sh}
git clone https://github.com/MASTmultiphysics/mast-multiphysics
cd mast-multiphysics
\endcode

We again recommend building in a dedicated build directory to keep from cluttering the main repository. From inside the `mast-multiphysics` directory, create a build directory and navigate into it with:

\code{.sh}
mkdir build
cd build
\endcode

The build process for MAST differs slightly from libMesh since we utilize CMake to generate Makefiles rather than a `configure` script. This is done by executing the following commands in the terminal/shell from inside the `build` directory. CMake will perform some inspections of your system, locate dependencies, and create the `Makefile`s necessary to build MAST in the `build` directory.

\code{.sh}
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpifort \
-DlibMesh_DIR=${libMesh_INSTALL_DIR} \
-DPETSc_DIR=/usr/lib/petsc \
-DSLEPc_DIR=/usr/lib/slepc \
-DEIGEN3_ROOT=/usr/include/eigen3 \
-DBOOST_ROOT=/usr \
-DBUILD_DOC=OFF \
-DENABLE_DOT=OFF \
-DENABLE_GCMMA=OFF \
-DENABLE_SNOPT=OFF\
-DENABLE_NASTRANIO=OFF \
-DENABLE_CYTHON=OFF
\endcode

Note that the above commands create a `Debug` version of the MAST library (using the `*_dbg` versions of libMesh). This is required if you want to utilize a C++ debugger (such as gdb) and includes a significant amount of diagnostic/debug output. For more performance, an optimized/Release version can be built by changing the `-DCMAKE_BUILD_TYPE` CMake variable to `Release`.

After CMake configuration completes, you can build the MAST library (`libmast`), several example problems, and unit tests by simply executing the following in the terminal/shell.

\code{.sh}
make -j ${NP}
\endcode

\todo Contact libMesh developers to resolve inability of libMesh configuration process to find Ubuntu repository provided HDF5 headers/libraries (openmpi/serial).
\todo Update page with next release of libMesh after v1.5.1 that will incorporate changes to deal with metis conflicts.
\todo Update the guide to include building support for pyNastran, Cython, and generating the documentation locally.

*/
2 changes: 1 addition & 1 deletion doc/install/install_ubuntu_1910_apt.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This page describes how to install libMesh/MAST on Ubuntu 19.10 (Eoan Ermine) using dependencies from the standard package manager. It is written for someone who has limited experience compiling software on Linux and contains details a more advanced user likely won't need.

\note Ubuntu 19.10 goes end-of-life in July 2020 and is no longer officially supported by Canonical. Consider updating to Ubuntu 20.04 LTS.
\note Ubuntu 19.10 went end-of-life in July 2020 and is no longer officially supported by Canonical. Consider updating to Ubuntu 20.04 LTS.

\section install-ubuntu1910-dependencies Dependencies

Expand Down

0 comments on commit 7860f77

Please sign in to comment.