MBDyn is distributed as source code. You can find the source code in the form of a tarball on MBDyn's website, http://www.mbdyn.org/, in the "Software Download" page, or download/clone it from the project's git repository, https://gitlab.polimi.it/Pub/mbdyn.
The favourite installation method is by compiling it yourself. You can compile MBDyn
natively in Linux, or
in Windows, for
Windows 10: using Linux in the Windows Subsystem for Linux
most Windows versions: using specific build environments (Cygwin, MSYS/MinGW)
MBDyn compilation and installation is based on GNU’s autotools. You need:
a C compiler and
a C++ compiler;
(Until MBDyn 1.7.3 you also needed a Fortran compiler, which is now optional.)
Note: in command examples below, a `$' prefix means you can run the command as a regular user; a `#' prefix means you need to run the command as the superuser (i.e. as the user "root" or using the command "sudo" in front of the actual command). You need special permissions to do that.
required tools: make sure GNU make, gcc, g++ and gfortran are installed
# apt update
# apt install make gcc g++ gfortran
recommended optional packages: optionally install libltdl, lapack, suitesparse, netcdf (>= 4 is preferred)
# apt update
# apt install libltdl-dev liblapack-dev libsuitesparse-dev libnetcdf-dev libnetcdf-cxx-dev
get MBDyn's source code: you can use tarballs of official releases, or snapshots from the git repository
official release: tarball from the website:
$ wget https://www.mbdyn.org/userfiles/downloads/mbdyn-1.7.3.tar.gz
(replace “1.7.3” with the desired version)
untar and change directory into the source tree:
$ tar xzvf mbdyn-1.7.3.tar.gz
$ cd mbdyn-1.7.3/
a snapshot from the git repository:
visit the website https://gitlab.polimi.it/Pub/mbdyn
select the develop branch from the menu, download a tarball, and change directory into the source tree
$ tar xzvf mbdyn-develop.tar.gz
$ cd mbdyn-develop
copy the URL required to clone it with git, then change directory into the source tree and checkout the develop branch
$ git clone https://public.gitlab.polimi.it/DAER/mbdyn.git
$ cd mbdyn
$ git checkout develop
generate the required build scripts:
$ sh bootstrap.sh
from within the source tree, configure the package:
(optionally) install it:
# make install
Note: the software will be installed in /usr/local/mbdyn/*; to install elsewhere, configure with --prefix=/path; e.g. --prefix=/usr/local.
If you don't install the software, the main executable, "mbdyn", will be in subfolder mbdyn/. You can safely copy it wherever you want, e.g. somewhere in your path.
Note: if you plan to do some serious development, e.g. if you download the source code from the git repository, you can build it outside the source tree (recommended); in that case
create a build tree:
$ cd ..
$ mkdir mbdyn-build
(instead of "mbdyn-build", use your preferred name)
$ cd mbdyn-build
configure the package:
(use the correct path to the source tree)
From this point on, build and install continues as above. You can have multiple build trees pointing to the same source tree, for example if you need to build with different configure options.
The recommended approach is to install the Windows Subsystem for Linux. You can find instructions in Windows 10 official documentation; for example, see here: https://docs.microsoft.com/en-us/windows/wsl/about
After your Windows Subsystem for Linux is installed, follow instructions here (for Ubuntu; for other distros, package names may vary): https://github.com/zanoni-mbdyn/blendyn/wiki/Installing-Blendyn#windows
When you get to downloading MBDyn, you can jump to the previous general instructions about building MBDyn in Linux.
MBDyn has been successfully built using
Those systems are relatively outdated. The user is referred to the specific instructions to set-up the system and the build environment.
At that point, building MBDyn follows the same rules as for Linux.
As an alternative, one can find unofficial (i.e. unsupported!) binaries compiled with MSYS/MinGW here: http://home.aero.polimi.it/masarati/Download/mbdyn/mbdyn-1.7.3-win32.zip (YMMV! Replace 1.7.3 with the desired version; beware: binaries are not available for all versions).