INSTALL.md 4.2 KB
Newer Older
Axel Loewe's avatar
Axel Loewe committed
1
# Installation of meshalyzer
2 3 4

Meshalyzer is regularly used on Linux and Mac machines. It has worked under Windows as well.

Axel Loewe's avatar
Axel Loewe committed
5
## Prerequisities
6

Edward Vigmond's avatar
Edward Vigmond committed
7
1. [libpng](http://libpng.org)
Edward Vigmond's avatar
Edward Vigmond committed
8
2. [OpenMP](http://openmp.org) is recommended too improve certain operations. For all compilers, except *clang* supplied by Apple, it is standard. A simple way to include it on Apple machines is with homebrew:
9
    `brew install libomp`
10 11 12
2. [FLTK 1.3.x](http://www.fltk.org/) or higher. Manually downloadad and installed is better since the prepackaged versions often have issues with fltk-config.
3. [glew](http://glew.sourceforge.net) for Linux and Windows only.
2. [glut](https://www.opengl.org/resources/libraries/glut/) for Linux and Windows only.
Edward Vigmond's avatar
Edward Vigmond committed
13 14
3. [cmake](https://cmake.org) if you want to make compiling easier.
3. <strike>To make the "windowless" rendering version, [OSMesa](https://www.mesa3d.org/osmesa.html)</strike>
15
4. To read in VTK/VTU format meshes, install [VTK](https://www.vtk.org/) development files
Edward Vigmond's avatar
Edward Vigmond committed
16

Edward Vigmond's avatar
Edward Vigmond committed
17
Except for fltk, using your package manager is recommended for installing these packages if possible. On *MacOS*, [homebrew](https://brew.sh/) works for us.
18

Axel Loewe's avatar
Axel Loewe committed
19
## Compiling
20

Yung-Lin Huang's avatar
Yung-Lin Huang committed
21 22 23 24 25 26
Clone the repository and enter the codebase folder `meshalyzer`.
```
git clone https://git.opencarp.org/openCARP/meshalyzer.git
cd meshalyzer
```

Edward Vigmond's avatar
Edward Vigmond committed
27
We provide Makefiles and CMake files for compiling the code, choose the one that fits your workflow.
Yung-Lin Huang's avatar
Yung-Lin Huang committed
28 29 30

### Makefile

Edward Vigmond's avatar
Edward Vigmond committed
31
1. If VTK is installed, edit the **make.conf** to set the `VTK_INC` and `VTK_DIR` variables to point to the directories containing the VTK header files and libraries, respectively. Comment them out otherwise.
Edward Vigmond's avatar
Edward Vigmond committed
32

Yung-Lin Huang's avatar
Yung-Lin Huang committed
33
2. If you have an Apple machine, edit **make.conf** to make sure that
Edward Vigmond's avatar
Edward Vigmond committed
34 35
   *HAVE_RETINA* is correct.
   
Yung-Lin Huang's avatar
Yung-Lin Huang committed
36
3. Type `make -j`
37

Edward Vigmond's avatar
Edward Vigmond committed
38
4. <strike>For the windowless version, type `make mesalyzer`</strike>
39

Yung-Lin Huang's avatar
Yung-Lin Huang committed
40 41 42 43 44 45 46 47 48 49 50 51 52
5. The compiled executables will be found in the directory.

6. Copy the binaries to a suitable location

### CMake

1. We suggest to run CMake by out-of-source builds, which means all the compiled code goes into a `_build` directory separate to the source code.

2. If VTK is installed, type `cmake -S. -B_build`. Otherwise type `cmake -S. -B_build -DUSE_VTK=OFF`

3. Compile the code via `cmake --build _build`

4. In the main meshalyzer directory, you will find a link to the compiled executalbe.
Edward Vigmond's avatar
Edward Vigmond committed
53

Edward Vigmond's avatar
Edward Vigmond committed
54 55
### ccmake

Edward Vigmond's avatar
Edward Vigmond committed
56
For those who are familiar with [ccmake](https://cmake.org/cmake/help/v3.0/manual/ccmake.1.html):
Edward Vigmond's avatar
Edward Vigmond committed
57 58 59 60 61 62

1. `ccmake .`
 
2. configure, edit and generate

3. make -j
63

Axel Loewe's avatar
Axel Loewe committed
64
## Documentation
65

Edward Vigmond's avatar
Edward Vigmond committed
66
To compile the manual (LaTeX required)
Edward Vigmond's avatar
Edward Vigmond committed
67

Axel Loewe's avatar
Axel Loewe committed
68 69 70
1. `cd manual`
2. `pdflatex manual`
3. `pdflatex manual`
71

Yung-Lin Huang's avatar
Yung-Lin Huang committed
72
## MacOS
73

Edward Vigmond's avatar
Edward Vigmond committed
74 75
First of all, the [command line tools](https://developer.apple.com/download/more/?=command%20line%20tools) or [Xcode](https://developer.apple.com/xcode/) must be installed.
Next, install the [prerequisities](#prerequisities) using your package manager. We use [homebrew](https://brew.sh/) as an example.
Yung-Lin Huang's avatar
Yung-Lin Huang committed
76 77 78 79 80

```
brew install libpng
brew install fltk
brew install git
Edward Vigmond's avatar
Edward Vigmond committed
81
brew install cmake
Yung-Lin Huang's avatar
Yung-Lin Huang committed
82 83
```

Yung-Lin Huang's avatar
Yung-Lin Huang committed
84
Follow the steps in the [Compiling](#compiling) to build the code.
85 86 87

## Ubuntu/Debian:

88 89 90 91 92 93 94 95 96 97 98 99 100 101
For installing meshalyzer first you need to install the ["Prerequisites"](#prerequisities). In Ubuntu you can use:

```
apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    fluid \
    freeglut3-dev \
    g++ \
    git \
    libfltk1.3-dev \
    libglew-dev \
    libglu1-mesa-dev \
    libpng-dev \
    make
102 103
```

Edward Vigmond's avatar
Edward Vigmond committed
104
Follow the steps in [Compiling](#compiling) to build the code.
105

Edward Vigmond's avatar
Edward Vigmond committed
106 107
## Post-compilation

108
You can execute meshalyzer by typing `./meshalyzer`
109

Edward Vigmond's avatar
Edward Vigmond committed
110 111 112 113 114
See README.md for an example.

To make meshalyzer available from anywhere on your machine, you need to copy it to your *bin* directory, or
add the meshalyzer directory to **PATH** by editing your *.bashrc* (or *.bash_profile*). 
Using the nano editor as an example, type the following command into the terminal:
115

116 117
```
nano ~/.bashrc
118 119 120 121
```

This will open an editor, scroll all the way down and add the following line, replacing '/home/somefolder/anotherfolder/meshalyzer' with the path of your meshalyzer folder:

122 123
```
export PATH=$PATH:/home/somefolder/anotherfolder/meshalyzer
124 125
```

126
press Control+X, then type Y and Enter to save the changes. Close all terminal instances!
127

128
open a terminal and type `meshalyzer`