-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First pass adding basic prerequisites #296
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e7e7adc
First pass adding basic prerequisites
samcunliffe f34f406
Add OS logos
samcunliffe 26553c7
Merge branch 'main' into 292-pedagogical-prerequisites
samcunliffe 1ca2391
Merge branch 'main' into 292-pedagogical-prerequisites
samcunliffe 3dcd814
Merge remote-tracking branch 'origin/main' into 292-pedagogical-prere…
samcunliffe 67da4b7
Merge remote-tracking branch 'origin/main' into 292-pedagogical-prere…
samcunliffe 705d2da
Working Windows instructions.
samcunliffe 7971068
Boldify the C++ kit thing.
samcunliffe 1a3c694
Update README.md
samcunliffe 388f7ac
Merge remote-tracking branch 'origin/main' into 292-pedagogical-prere…
samcunliffe a35fcc0
Final (?) README polishing.
samcunliffe a5ef852
Solves #313.
samcunliffe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,52 +17,111 @@ For further details about the method, please refer to the [PDF documentation](ht | |||||
|
||||||
## Getting started | ||||||
|
||||||
To use TDMS, it needs to be built against [FFTW](https://www.fftw.org/) and [MATLAB](https://www.mathworks.com/products/matlab.html), which must be downloaded and installed first. | ||||||
To install, follow these steps: | ||||||
|
||||||
```bash | ||||||
$ git clone [email protected]:UCL/TDMS.git | ||||||
$ cd TDMS | ||||||
$ git checkout v1.0.0 # the stable version | ||||||
$ mkdir build; cd build | ||||||
$ cmake ../tdms \ | ||||||
# -DMatlab_ROOT_DIR=/usr/local/MATLAB/R2019b/ \ | ||||||
# -DFFTW_ROOT=/usr/local/fftw3/ \ | ||||||
# -DCMAKE_INSTALL_PREFIX=$HOME/.local/ | ||||||
$ make install | ||||||
``` | ||||||
|
||||||
If CMake cannot find MATLAB, FFTW, or install to the default installation prefix, uncomment the relevant line(s) and modify the path(s) accordingly. | ||||||
We don't ship binaries at the moment, so to use TDMS, it has to be compiled. | ||||||
It needs to be built against [FFTW](https://www.fftw.org/) and [MATLAB](https://www.mathworks.com/products/matlab.html), which must be downloaded and installed first. | ||||||
|
||||||
<details> | ||||||
<summary>Mac-specific instructions</summary> | ||||||
<summary><img src="https://github.com/EgoistDeveloper/operating-system-logos/blob/master/src/24x24/UBT.png"/> Linux prerequisite setup</summary> | ||||||
|
||||||
To compile TDMS on a Mac, you will need an x86 compiler with libraries for OpenMP. | ||||||
You can install these using [Homebrew](https://brew.sh) with the command: | ||||||
Assuming you don't already have them, you'll need a C++ compiler, CMake, OpenMP and FFTW. | ||||||
|
||||||
For Debian-based distributions this should be as simple as | ||||||
```{sh} | ||||||
$ brew install llvm | ||||||
$ sudo apt install git gcc cmake libfftw3-dev libgomp1 | ||||||
``` | ||||||
|
||||||
After installing with Homebrew, you may need to set the following CMake arguments: | ||||||
</details> | ||||||
|
||||||
<details> | ||||||
<summary><img src="https://github.com/EgoistDeveloper/operating-system-logos/blob/master/src/24x24/MAC.png"/> MacOS prerequisite setup</summary> | ||||||
|
||||||
On MacOS you will need an x86 compiler with libraries for OpenMP. | ||||||
You'll need to download the latest [Xcode tools](https://apps.apple.com/app/xcode). | ||||||
|
||||||
Everything else can be installed using [Homebrew](https://brew.sh): | ||||||
|
||||||
```{sh} | ||||||
-DCMAKE_CXX_COMPILER=/Users/username/.local/homebrew/opt/llvm/bin/clang++ | ||||||
-DOMP_ROOT=/Users/username/.local/homebrew/opt/llvm/ | ||||||
-DCXX_ROOT=/Users/username/.local/homebrew/opt/llvm | ||||||
-DHDF5_ROOT=/Users/username/.local/homebrew/opt/hdf5 | ||||||
$ brew install cmake fftw llvm | ||||||
``` | ||||||
|
||||||
On an ARM Mac, you will need to install the x86 version of Homebrew. | ||||||
To do so, use the following commands: | ||||||
On an ARM Mac, you will need to install the x86 version of Homebrew: | ||||||
|
||||||
```{sh} | ||||||
$ arch -x86_64 zsh | ||||||
$ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||||||
$ arch -x86_64 /usr/local/bin/brew install llvm hdf5 | ||||||
$ arch -x86_64 /usr/local/bin/brew install cmake fftw llvm | ||||||
``` | ||||||
|
||||||
</details> | ||||||
|
||||||
<details> | ||||||
<summary><img src="https://github.com/EgoistDeveloper/operating-system-logos/blob/master/src/24x24/WIN.png"/> Windows prerequisite setup</summary> | ||||||
|
||||||
TDMS was developed on, and has been extensively tested on linux. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Support for Windows is quite new and experimental (please [report](https://github.com/UCL/TDMS/issues/new/choose) any issues you encounter!). | ||||||
|
||||||
It might be more straightforward to use the [Windows subsystem for Linux (WSL2)](https://learn.microsoft.com/en-gb/windows/wsl/install), or set up an linux virtual machine. | ||||||
|
||||||
However, TDMS _can_ be compiled natively on Windows. | ||||||
This has been tested Windows 10 with PowerShell. | ||||||
|
||||||
Assuming you don't already have them, you'll need to download and install: | ||||||
|
||||||
* [MATLAB](https://www.mathworks.com/products/matlab.html), | ||||||
* [Visual Studio](https://visualstudio.microsoft.com/vs/community/) and **be sure to select the C++ kit**, | ||||||
* [CMake](https://cmake.org/download/), | ||||||
* and [FFTW](https://www.fftw.org/install/windows.html). | ||||||
|
||||||
Potentially the simplest way to get FFTW is via [conda](https://anaconda.org/conda-forge/fftw): | ||||||
|
||||||
```{pwsh} | ||||||
PS> conda install -c conda-forge fftw --yes | ||||||
``` | ||||||
|
||||||
You'll need to ensure the paths to FFTW and MATLAB (the locations of `fftw3.dll` and `libmex.dll` respectively) are in the `env:Path`. | ||||||
|
||||||
These can be found, e.g. by | ||||||
```{pwsh} | ||||||
PS> conda list fftw # assuming you installed via conda | ||||||
PS> which.exe MATLAB | ||||||
``` | ||||||
Which should return something like `C:\Program Files (x86)\MATLAB\R20XXx\bin\matlab` and maybe `C:\ProgramData\envs\base\bin`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
If you downloaded FFTW and created `fftw3.dll` with `lib.exe`, you just need to know where you saved it. | ||||||
|
||||||
You can append the paths: | ||||||
|
||||||
```{pwsh} | ||||||
PS> $env:Path += ";C:\Program Files (x86)\MATLAB\R20XXx\bin\;C:\ < wherever fftw3.dll is >" | ||||||
``` | ||||||
|
||||||
Which will help Windows locate `.dll` files later. | ||||||
For all following instructions, you'll have to substitute our mentions of `tdms` with `tdms.exe` and `$` is used to denote a command prompt which, in PowerShell would look like `PS>` | ||||||
|
||||||
</details> | ||||||
|
||||||
------ | ||||||
|
||||||
You'll need to download and install [MATLAB](https://www.mathworks.com/products/matlab.html), and take note where the headers are installed. | ||||||
willGraham01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
</details> | ||||||
|
||||||
## Installation | ||||||
|
||||||
To compile and install, follow these steps: | ||||||
|
||||||
```{sh} | ||||||
$ git clone [email protected]:UCL/TDMS.git | ||||||
$ cd TDMS | ||||||
$ git checkout v1.0.0 # the stable version | ||||||
$ mkdir build; cd build | ||||||
$ cmake ../tdms \ | ||||||
# -DMatlab_ROOT_DIR=/usr/local/MATLAB/R20XXx/ \ | ||||||
# -DFFTW_ROOT=/usr/local/fftw3/ \ | ||||||
# -DCMAKE_INSTALL_PREFIX=$HOME/.local/ | ||||||
$ cmake --build . --target install --config Release | ||||||
``` | ||||||
|
||||||
If CMake cannot find MATLAB, FFTW, or install to the default installation prefix, uncomment the relevant line(s) and modify the path(s) accordingly. | ||||||
|
||||||
You can check that `tdms` was installed correctly and is in your `PATH` by running: | ||||||
```{sh} | ||||||
$ tdms --help | ||||||
|
@@ -102,7 +161,7 @@ In a terminal run | |||||
$ which tdms | ||||||
``` | ||||||
|
||||||
Copy the full path (something like `/usr/local/bin/tdms`) into [`run_pstd_bscan.m`](https://github.com/UCL/TDMS/blob/main/examples/arc_01/run_pstd_bscan.m), replacing the `'tdms'` text in the calls to the `system()` function. | ||||||
Copy the full path (something like `/usr/local/bin/tdms`) into [`run_pstd_bscan.m`](https://github.com/UCL/TDMS/blob/main/examples/arc_01/run_pstd_bscan.m), replacing the ` 'tdms' ` text in the calls to the ``system()`` function. | ||||||
samcunliffe marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
</details> | ||||||
|
||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging @edggjames FYI... 👇