Skip to content

Commit

Permalink
Improved installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoGiane committed Oct 11, 2023
1 parent e74eaba commit a9dd8a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 19 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Installation

Compiling and building `bayesmix` requires a modern C++ compiler, `git`, the GNU `make` utility, `cmake` (version >= 3.20) and `pkg-config`. Make these packages available varies between operating systems.
Compiling and building `bayesmix` requires a modern C++ compiler, `git`, the GNU `make` utility, `cmake` (version >= 3.16) and `pkg-config`. Make these packages available varies between operating systems.

**Warning**: Check the version of `cmake` available in your package manager default repository. You may need to install a more recent version in another way. If this is your case, please go to the [official CMake GitHub repository](https://github.com/Kitware/CMake) and follow the installation instructions.
**Warning**: Check the version of `cmake` available in your package manager default repository. This requirement is already satisfied in Ubuntu 20.04 LTS, so in fairly updated distros this requirement will already be satisfied. If your system is too old and the binary `cmake` package does not satisfy the minimum requiremens, please go to the [official CMake GitHub repository](https://github.com/Kitware/CMake) and follow the installation instructions.

## Requirements - Linux

Expand All @@ -12,6 +12,8 @@ On Linux systems, the required packages can be installed via the system's defaul
sudo apt install git g++ make cmake pkg-config
```

For other Linux distributions, you need to adapt the above instruction to the syntax of your package manager. [This table](https://wiki.archlinux.org/title/Pacman/Rosetta) shows the correspondence of package management commands among some of the most popular Linux distributions.

## Requirements - MacOS

On MacOS, the required packages can be installed via [Homebrew](https://brew.sh/). Once installed, it is sufficient to run
Expand All @@ -24,9 +26,7 @@ brew install git g++ make cmake pkg-config

First of all, install `git` via the [Git for Windows](https://gitforwindows.org/) project. Download the [installer](https://github.com/git-for-windows/git/releases/latest) and complete the prompts leaving default choices to install.

<!-- The Git BASH that comes with this program is the shell we suggest to compile and run `bayesmix`. -->

On Windows, we also need the installation of a proper C++ toolchain to install the other required packages. `bayesmix` can be successfully compiled and installed with RTools40, RTools42 and RTools43 toolchains. This choice simplified the development on a lightweight `R` interface working on all platforms.
On Windows, we also need the installation of a proper C++ toolchain and install the other required packages. `bayesmix` can be successfully compiled and installed with RTools40, RTools42 and RTools43 toolchains. This choice simplified the development on a lightweight `R` interface working on all platforms.

[Rtools](https://cran.r-project.org/bin/windows/Rtools/) is a toolchain bundle used for building `R` packages from source (those that need compilation of C/C++ or Fortran code) and for building `R` itself. Rtools usually consists of Msys2 build tools, GCC/MinGW-w64 compiler toolchain and libraries. These require slightly different steps to configure, so please follow the appropriate steps below.

Expand All @@ -42,7 +42,9 @@ C:\rtools40\usr\bin
C:\rtools40\mingw64\bin
```

The C++ compiler is now available on your system. All the other dependencies can be installed by typing the following commands into one of the shells installed with RTools (e.g. launch the `C:\rtools40\msys.exe` file)
The C++ compiler is now available on your system. All the other dependencies can be installed by typing the following commands into Windows Command Prompt or Windows PowerShell:

<!-- one of the shells installed with RTools (e.g. launch the `C:\rtools40\msys.exe` file) -->

```shell
pacman -Sy mingw-w64-x86_64-make
Expand All @@ -56,19 +58,23 @@ These two versions of RTools toolchain are quite similar. Of course, RTools43 of
Download either the [RTools42 installer](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5355-5357.exe) or the [RTools43 installer](https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5550-5548.exe) and complete the prompts to install.
Next, add the following lines to your `PATH`:

#### RTools42

```shell
# RTools42
C:\rtools42\x86_64-w64-mingw32.static.posix\bin
C:\rtools42\ucrt64\bin
C:\rtools42\usr\bin
```

# RTools43
#### RTools43
```shell
C:\rtools43\x86_64-w64-mingw32.static.posix\bin
C:\rtools43\ucrt64\bin
C:\rtools43\usr\bin
```

The C++ compiler is now available on your system. All the other dependencies can be installed by typing the following commands into one of the shells installed with RTools (e.g. lauch the `C:\rtools42\msys.exe` or `C:\rtools43\msys.exe` file)
The C++ compiler is now available on your system. All the other dependencies can be installed by typing the following commands into into Windows Command Prompt or Windows PowerShell:
<!--one of the shells installed with RTools (e.g. lauch the `C:\rtools42\msys.exe` or `C:\rtools43\msys.exe` file) -->

```shell
pacman -Sy mingw-w64-ucrt-x86_64-make
Expand All @@ -78,8 +84,8 @@ pacman -Sy mingw-w64-ucrt-x86_64-pkgconf

### Important remarks :

- Use the native windows Command Prompt (or PowerShell) to execute these commands. If `PATH` environment variable has been configured correctly, all requirements will be satisfied.
- In order for `bayesmix` to be properly linked to Intel's TBB library, the absolute path to `tbb` must be added to the User `PATH` variable. This is done automatically during build but to make this change effective user need to close and open a new Git BASH shell.
- Use the native Windows Command Prompt (or Windows PowerShell) to execute these commands. If `PATH` environment variable has been configured correctly, all requirements will be satisfied.
- In order for `bayesmix` to be properly linked to Intel's TBB library, the absolute path to `tbb` must be added to the User `PATH` variable. This is done automatically during build but to make this change effective user need to close and open a new <!-- Git BASH --> shell.

## Build `bayesmix`

Expand All @@ -101,6 +107,8 @@ make run_mcmc
cd ..
```

**Remark**: Configuring and compiling `bayesmix` for the first time will require several minutes, since `cmake` needs to provide and compile all the libraries on which `bayesmix` depends.

Finally, to compile unit tests, please use the following commands:

```shell
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ make run_mcmc
cd ..
```

**Remark**: Configuring and compiling `bayesmix` for the first time will require several minutes, since `cmake` needs to provide and compile all the libraries on which `bayesmix` depends.

# Tutorial

The `build/run_mcmc` executable can be used to perform all the necessary analysis, but it needs some command-line arguments to be passed.
Expand Down

0 comments on commit a9dd8a4

Please sign in to comment.