Skip to content
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

Update develop branch with main #284

Merged
merged 67 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c5786dc
add pyproject.toml to download packages prior to build
ACea15 May 30, 2023
fb40764
minimal env (only for people without low level libraries in system)
ACea15 May 30, 2023
70b8b18
less restricted cmake in the setup (>= added)
ACea15 May 30, 2023
330ef4e
add functions to setup to build submodules
ACea15 May 30, 2023
216bd5b
add required packages to pip install
ACea15 May 30, 2023
a9c3194
remove unnecessary environments (leaving newer for reference)
ACea15 May 31, 2023
85a4475
add option, via environment variable, to not build submodules
ACea15 May 30, 2023
d0ee119
fix to env for Ubuntu
ACea15 May 31, 2023
780714b
fix wrong location of variable this_directory in merging conflicts
ACea15 May 31, 2023
a8d5884
simple compilation from run() method
ACea15 Jun 21, 2023
1b0f8af
minor environment compatibility for macos
ACea15 Jun 28, 2023
4c4fb48
fix [savedata] save of linear system related hdf5 file saves
sduess Oct 20, 2023
4937efe
Merge branch 'develop' into dev_pip2
ben-l-p Nov 2, 2023
3bdabed
fix [gust] type and handling of gust component definitions
sduess Nov 7, 2023
bf3e295
Revert "fix [gust] type and handling of gust component definitions"
sduess Nov 7, 2023
db36db5
fix [modalutils] number of modes to be exported as vtk
sduess Dec 6, 2023
5aa25e3
Merge pull request #271 from ImperialCollegeLondon/fix_xbeam_optimise
sduess Dec 18, 2023
ecf6d60
fix [udp tutorial] jupyter notebook meta data
sduess Oct 20, 2023
261204a
remove [postproc] left over prints from debugging
sduess Dec 18, 2023
501f73e
remove [postproc] unused columns from exported force and moment matrices
sduess Dec 18, 2023
c86e23d
Merge branch 'main' into gla_system
sduess Dec 27, 2023
f6a01ac
Merge branch 'main' into gla_system
sduess Dec 27, 2023
029fe56
Merge pull request #273 from ImperialCollegeLondon/gla_system
sduess Dec 27, 2023
d03a99b
Update noaero.py for consistency in function input
kccwing Jan 19, 2024
9cdb599
Fix in NoAero Solver
sduess Jan 22, 2024
fe0c5d7
Add scipy version info to env yml
Jan 25, 2024
6529a26
Added documentation for pip install
ben-l-p Jan 26, 2024
f390ea0
Remove conda/mambda from Github workflow
ben-l-p Jan 26, 2024
4514dea
Update dockerfile to remove mamba/conda dependency
ben-l-p Jan 26, 2024
52a282e
Added CMake install to Dockerfile
ben-l-p Jan 26, 2024
fccaf87
Update Dockerfile
ben-l-p Jan 26, 2024
de8c9ec
Update Dockerfile
ben-l-p Jan 26, 2024
4b853cf
Update Dockerfile
ben-l-p Jan 26, 2024
fa2814a
Update Dockerfile
ben-l-p Jan 26, 2024
75e3060
Update Dockerfile
ben-l-p Jan 26, 2024
64e1e68
Update Dockerfile
ben-l-p Jan 30, 2024
c986f46
Update Dockerfile
ben-l-p Jan 30, 2024
b32b3a4
Update Dockerfile
ben-l-p Jan 30, 2024
c1bbc79
Update Dockerfile
ben-l-p Jan 30, 2024
00ceec2
Update Dockerfile
ben-l-p Jan 30, 2024
3f922bc
Update Dockerfile
ben-l-p Jan 30, 2024
47cd979
Update Dockerfile
ben-l-p Jan 30, 2024
da725ce
Update Dockerfile
ben-l-p Jan 30, 2024
03a4d0f
Update Dockerfile
ben-l-p Jan 30, 2024
226a6b7
Return Dockerfile to using conda/mamba
ben-l-p Feb 8, 2024
eb32df5
Update installation.md
ben-l-p Feb 8, 2024
04294e0
Merge branch 'ImperialCollegeLondon:main' into dev_pip2
ben-l-p Feb 8, 2024
ce51ac7
Added note about different pip install options
ben-l-p Feb 11, 2024
e33d2cc
Use latest mayavi from Github
ben-l-p Feb 20, 2024
6540174
Changed docs to include auto built, added ARM64 Conda environment
ben-l-p Feb 20, 2024
03928aa
Small documentation update
ben-l-p Feb 21, 2024
4e1e22a
Changed docs to use --user flag as default for installation
ben-l-p Feb 26, 2024
2441ee1
Added a few more install dependencies to the docs
ben-l-p Feb 26, 2024
719dcfa
Update installation.md
rafapalacios Feb 26, 2024
4be153b
Merge pull request #277 from SJ-Innovation/fix_env_version_info
kccwing Feb 26, 2024
85b0392
Merge branch 'ImperialCollegeLondon:main' into dev_pip2
ben-l-p Feb 26, 2024
646e5f0
Removed SciPy FFT fix - will add to another pull request
ben-l-p Feb 26, 2024
57dcbab
Merge branch 'dev_pip2' of https://github.com/ben-l-p/sharpy into dev…
ben-l-p Feb 26, 2024
906a566
Readded SciPy FFT changes
ben-l-p Feb 26, 2024
da05729
Merge pull request #280 from ben-l-p/dev_pip2
ben-l-p Feb 26, 2024
6f43046
Merge branch 'develop' into dev_main_conflict
ben-l-p Apr 1, 2024
8bd0eba
Fix conflict in environment.yml
ben-l-p Apr 1, 2024
282cb31
fixes for initialisation
kccwing Apr 8, 2024
017583b
Revert "fixes for initialisation"
kccwing Apr 8, 2024
2c01874
Fix Dockerfile to prevent Mamba install failing
ben-l-p Apr 10, 2024
8d70685
Merge pull request #285 from ImperialCollegeLondon/fix_docker_build
kccwing Apr 18, 2024
8afb27d
Merge pull request #286 from ImperialCollegeLondon/main
ben-l-p Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/sharpy_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,11 @@ jobs:
with:
version: 10
platform: x64
#Swapped from Conda to Mamba due to Github runner memory constraint
- name: Setup Mamba
uses: mamba-org/setup-micromamba@v1
- name: Pre-Install dependencies
run: |
gfortran --version
wget --no-check-certificate https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh -O mamba.sh
bash mamba.sh -b -p $HOME/mamba
export PATH="$HOME/mamba/bin:$PATH"
hash -r
mamba config --set always_yes yes --set changeps1 no
mamba update --name base mamba
mamba list --name base mamba
mamba init bash
hash -r
export QT_QPA_PLATFORM='offscreen'
sudo apt install libeigen3-dev
mamba env create -f utils/environment.yml
mamba init bash
source activate sharpy
git submodule init
git submodule update
git fetch --tags -f
Expand Down
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,32 @@ RUN yum groupinstall "Development Tools" -y --nogpgcheck && \
yum install -y --nogpgcheck mesa-libGL libXt libXt-devel wget gcc-gfortran lapack vim tmux && \
yum clean all

# Install Mamba
# Swapped from Conda to Mamba due to Github runner memory constraint
# Install Mamba - swapped from Conda to Mamba due to Github runner memory constraint
RUN wget --no-check-certificate https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh -O /mamba.sh && \
chmod +x /mamba.sh && \
/mamba.sh -b -p /mamba/ && \
rm /mamba.sh && hash -r

ADD / /sharpy_dir/

# Update mamba and make it run with no user interaction
# Cleanup mamba installation
RUN mamba init bash
RUN mamba config --set always_yes yes --set changeps1 no
RUN mamba update -q conda
RUN mamba config --set auto_activate_base false
RUN mamba env create -f /sharpy_dir/utils/environment.yml
#RUN mamba clean -afy
RUN find /mamba/ -follow -type f -name '*.a' -delete
RUN find /mamba/ -follow -type f -name '*.pyc' -delete
RUN find /mamba/ -follow -type f -name '*.js.map' -delete

#COPY /utils/docker/* /root/
# Initialise mamba installation
RUN mamba init bash && \
mamba update -q conda && \
mamba env create -f /sharpy_dir/utils/environment.yml && \
find /mamba/ -follow -type f -name '*.a' -delete && \
find /mamba/ -follow -type f -name '*.pyc' -delete && \
find /mamba/ -follow -type f -name '*.js.map' -delete

RUN ln -s /sharpy_dir/utils/docker/* /root/

RUN cd sharpy_dir && \
mamba activate sharpy && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
CXX=g++ FC=gfortran cmake .. && make install -j 2 && \
CXX=g++ FC=gfortran cmake .. && make install -j 4 && \
cd .. && \
pip install . && \
rm -rf build

ENTRYPOINT ["/bin/bash", "--init-file", "/root/bashrc"]

Original file line number Diff line number Diff line change
Expand Up @@ -2368,9 +2368,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run SHARPy Simulation"
"execution_count": 22,
]
"### Run SHARPy Simulation"]
},
{
"cell_type": "code",
Expand Down
143 changes: 71 additions & 72 deletions docs/source/content/installation.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# SHARPy v2.0 Installation Guide
__Last revision 9 October 2023__
# SHARPy v2.2 Installation Guide
__Last revision 26 February 2024__

The following step by step tutorial will guide you through the installation process of SHARPy. This is the updated process valid from v2.0.
The following step by step tutorial will guide you through the installation process of SHARPy. This is the updated process valid from v2.2.

## Requirements

__Operating System Requirements__

SHARPy is being developed and tested on the following operating systems:
* CentOS 7 and CentOS 8
* Ubuntu 18.04 LTS
* Debian 10
* Ubuntu 22.04 LTS
* Debian 12
* MacOS Mojave and Catalina (Intel)
* MacOS Sonoma (Apple Silicon M2)

Windows users can also run it by first installing the Windows Subsystem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install) and a XServer such as GWSL, which can be installed through the Microsoft Store. SHARPy is also available to the vast majority of operating systems that are supported by Docker

__Required Distributions__

* Anaconda Python 3.10
* GCC 6.0 or higher (recommended). C++ and Fortran.
* Python 3.10 or higher
* CMake
* GCC 6.0 or higher, G++, GFortran (all included in Anaconda)
* Eigen3, BLAS, MKL/LAPACK (all included in Anaconda)

If the prerequisite packages are not installed and you are not using Anaconda, they can be installed as following on Linux (with a Homebrew equivelent available for Mac installs):
```bash
sudo apt install -y cmake g++ gfortran libblas-dev liblapack-dev libeigen3-dev
```

__Recommended Software__

Expand All @@ -45,28 +52,55 @@ once you initialise SHARPy you will also automatically clone the relevant versio

### Set up the folder structure

1. Clone `sharpy` in your desired location, if you agree with the license in `license.txt`.
Clone `sharpy` in your desired location, if you agree with the license in `license.txt`.
```bash
git clone --recursive http://github.com/ImperialCollegeLondon/sharpy
```
The `--recursive` flag will also initialise and update the submodules SHARPy depends on,
[xbeam](http://github.com/imperialcollegelondon/xbeam) and [UVLM](http://github.com/imperialcollegelondon/UVLM).


### Quick install (Standalone)

SHARPy can be installed as a standalone package, without the use of a package manager. If you wish to install using the Anaconda package manager, please use the following tutorial [HERE](#setting-up-the-python-environment-anaconda), or make a custom installation with a develop build or modified compilation settings [HERE](#custom-installation). The quick install is geared towards getting the release build of SHARPy running as quickly and simply as possible.

1. Check that your Python version is 3.10 or higher. Other versions may be incompatible with the required modules.
```bash
python --version
```

2. Move into the cloned repository:
```bash
cd sharpy
```

3. Install SHARPy. This will install any required Python packages as well as building the xbeam and UVLM libraries, and may take a few minutes.
```bash
git clone --recursive http://github.com/ImperialCollegeLondon/sharpy
pip install --user .
```
The `--recursive` flag will also initialise and update the submodules SHARPy depends on,
[xbeam](http://github.com/imperialcollegelondon/xbeam) and [UVLM](http://github.com/imperialcollegelondon/UVLM).
The ```--user``` flag is included for systems without root access (often Linux) as the install will fail otherwise. This flag can be removed when a global install is required, and your machine allows it (works on Mac).

There are options for what to install if required. For instance, to install the basic package with documentation, just do ```bash pip install --user .[docs]```. For the whole lot, ```bash pip install --user .[all]```.

2. We will now set up the SHARPy environment that will install other required distributions.
4. You can check the version of SHARPy you are running with:
```bash
sharpy --version
```

### Setting up the Python Environment
__You are ready to run SHARPy__. Continue reading the [Running SHARPy](#running-sharpy) section.

### Setting up the Python Environment (Anaconda)

SHARPy uses the Anaconda package manager to provide the necessary Python packages.
These are specified in an Anaconda environment that shall be activated prior to compiling the xbeam and UVLM libraries
or running any SHARPy cases.
SHARPy can use the Anaconda package manager to provide the necessary Python packages.
These are specified in an Anaconda environment that shall be activated prior to compiling the xbeam and UVLM libraries or running any SHARPy cases.

1. If you still do not have it in your system, install the [Anaconda](https://conda.io/docs/) Python 3 distribution.

2. Check that your Python version is at least 3.10:
```bash
python --version
```
3. If python 3.10 is needed, use:
3. If a specific python version is required, for example 3.10, use:

```bash
conda install python=3.10
Expand All @@ -75,23 +109,19 @@ or running any SHARPy cases.
4. Create the conda environment that SHARPy will use:

```bash
cd sharpy/utils
conda env create -f environment.yml
cd ../..
```
This should take approximately 15 minutes to complete (Tested on Ubuntu 22.04.1).
This should take approximately 5 minutes to complete (Tested on Ubuntu 22.04.1). For installation on Apple Silicon, use ```environment_arm64.yml```; this requires GCC and GFortran to be installed prior.

5. Activate the `sharpy` conda environment:
```bash
conda activate sharpy
```
you need to do this before you compile the `xbeam` and `uvlm` libraries, as
some dependencies are included in the conda environment. You should now see ```(sharpy)``` on your command line.
You should now see ```(sharpy)``` on your command line.


### Quick install
The quick install is geared towards getting the release build of SHARPy running as quickly and simply as possible. If
you would like to install a develop build or modify the compilation settings of the libraries skip to the next section.
### Quick install (Anaconda)
The quick install is geared towards getting the release build of SHARPy running as quickly and simply as possible.
1. Move into the cloned repository:
```bash
cd sharpy
Expand All @@ -102,48 +132,30 @@ you would like to install a develop build or modify the compilation settings of
(sharpy) [usr@host] $
```

If this is not the case, activate the environment otherwise xbeam and UVLM will not compile.
3. Install SHARPy. This will install any required Python packages as well as building the xbeam and UVLM libraries, and may take a few minutes.
```bash
conda activate sharpy
```

3. Create a directory `build` that will be used during CMake's building process and `cd` into it.
Ensure it is located in the main ./sharpy folder otherwise the following steps won't work:
```bash
mkdir build
cd build
```

4. Prepare UVLM and xbeam for compilation using `gfortran` and `g++` in their release builds running. If you'd like to
change compilers see the Custom Installation.
```bash
cmake ..
```

5. Compile the libraries.
```bash
make install -j 4
```
where the number after the `-j` flag will specify how many cores to use during installation.
This should take approximately 5 minutes (Tested on Ubuntu 22.04.1).

7. Finally, leave the build directory and install SHARPy:
```bash
cd ..
pip install .
pip install --user .
```
The ```--user``` flag is included for systems without root access (often Linux) as the install will fail otherwise. This flag can be removed when a global install is required, and your machine allows it (works on Mac).

There are options for what to install if required. For instance, to install the basic package with documentation, just do ```bash pip install --user .[docs]```. For the whole lot, ```bash pip install --user .[all]```.

8. You can check the version of SHARPy you are running with:
4. You can check the version of SHARPy you are running with:
```bash
sharpy --version
```

If running SHARPy from Anaconda, you need to load the conda environment. Therefore, __before you run any SHARPy case or test__, activate the SHARPy conda environment:
```bash
conda activate sharpy
```

__You are ready to run SHARPy__. Continue reading the [Running SHARPy](#running-sharpy) section.

### Custom installation

These steps will show you how to compile the xbeam and UVLM libraries such that you can modify the compilation settings
to your taste.
to your taste. This is compatible with both standalone and Anaconda installations.

1. If you want to use SHARPy's latest release, skip this step. If you would like to use the latest development work,
you will need to checkout the `develop` branch. For more info on how we structure our development and what branches
Expand All @@ -154,14 +166,11 @@ to your taste.
```
This command will check out the `develop` branch and set it to track the remote origin. It will also set the submodules (xbeam and UVLM) to the right commit.

2. Create the conda environment that SHARPy will use:
2. If using Anaconda, create the conda environment that SHARPy will use and activate the environment:
```bash
cd sharpy/utils
conda env create -f environment.yml
cd ../..
```

3. Activate the `sharpy` conda environment:
```bash
conda activate sharpy
```
Expand Down Expand Up @@ -282,18 +291,10 @@ cd sharpy_dir
python -m unittest
```

**Enjoy!**

## Running SHARPy

In order to run SHARPy, you need to load the conda environment. Therefore, __before you run any SHARPy case__:

1. Activate the SHARPy conda environment
```bash
conda activate sharpy
```

You are now ready to run SHARPy cases from the terminal.

### Automated tests

SHARPy uses unittests to verify the integrity of the code.
Expand Down Expand Up @@ -347,12 +348,12 @@ SHARPy cases are therefore usually ran in the following way:

2. Run it to produce the `.h5` files and the `.sharpy` files.
```bash
(sharpy_env) python generate_case.py
python generate_case.py
```

3. Run SHARPy (ensure the environment is activated).
```bash
(sharpy_env) sharpy case.sharpy
sharpy case.sharpy
```

#### Output
Expand Down Expand Up @@ -387,7 +388,6 @@ is stored in [HDF5](https://support.hdfgroup.org/HDF5/) format, which is compres

The `sharpy` call is:
```bash
# Make sure that the sharpy_env conda environment is active
sharpy <path to solver file>
```

Expand Down Expand Up @@ -415,7 +415,6 @@ is stored in [HDF5](https://support.hdfgroup.org/HDF5/) format, which is compres

You are now ready to run the case again:
```bash
# Make sure that the sharpy_env conda environment is active
sharpy <path to solver file>
```

Expand Down
14 changes: 14 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: sharpy
channels:
- conda-forge
- defaults
dependencies:
- eigen
- libopenblas
- libblas
- libcblas
- liblapack
- libgfortran
- libgcc
- libgfortran-ng
- python=3.10
12 changes: 12 additions & 0 deletions environment_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: sharpy
channels:
- conda-forge
- defaults
dependencies:
- eigen
- libopenblas
- libblas
- libcblas
- liblapack
- libgfortran
- python=3.10
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools",
#"scikit-build>=0.13",
"cmake>=3.14.3"
]