Installation
Choose your platform:
Install on Linux
Clone the repository:
git clone --recursive git@github.com:plasmonX/plasmonX.git
Install python:
2.1. If you are on a local system, the suggested option is to install python and all the requirements by:
sudo apt update sudo apt install python3 python3-pip
pip3 install -r python/requirements.txt
2.2. Alternatively, use conda:
conda env create -f python/requirements.yaml conda activate plasmonX-env
If you don’t have conda, you can install Miniconda with [do not run it into plasmonX folder]:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh source ~/.bashrc
Install gfortran [tested versions: 9 - 13]
sudo apt-get install gfortran
Install Lapack and BLAS:
sudo apt-get install libblas-dev liblapack-dev
Suggested for better performance: Install MKL. Follow the instructions at the link.
Install CMake [minumum version required: 3.15]
sudo apt-get install cmake
Run
setup.sh[see Configuration with setup.sh for available options]./setup.sh -omp -b BUILD_DIR
Compile the code
cd BUILD_DIR make -j
Run the tests [Please, avoid the -j option]
ctest
Install on macOS
Clone the repository:
git clone --recursive git@github.com:plasmonX/plasmonX.git
Install python:
2.1. If you are on a local system, the suggested option is to install python and all the requirements by:
brew install python
pip3 install -r python/requirements.txt
If you need to install Homebrew [do not run it into plasmonX folder]:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
On Apple Silicon systems, you may need to add Homebrew to your shell environment:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
2.2. Alternatively, use conda:
conda env create -f python/requirements.yaml conda activate plasmonX-env
If you don’t have conda, you can install Miniconda with [do not run it into plasmonX folder]:
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh bash Miniconda3-latest-MacOSX-x86_64.sh source ~/.bash_profile
Install gfortran [tested versions: 9 - 13]
brew install gcc
Install CMake [minimum version required: 3.15]
brew install cmake
Run
setup.sh[see Configuration with setup.sh for available options]./setup.sh -omp -b BUILD_DIR
Compile the code
cd BUILD_DIR make -j
Run the tests [Please, avoid the -j option]
ctest
Install on Windows
Install Windows Subsystem for Linux (WSL) on Windows and a LTS version of Ubuntu (latest suggested). Follow the instructions here.
Once activated the Ubuntu UNIX terminal, edit the file
/etc/wsl.confby inserting:[automount] options = "metadata"
Follow the instructions Install on Linux using option 2.2.
Configuration with setup.sh
The compilation of plasmonX is configured using the helper script setup.sh.
Basic usage:
PATH_TO_PLASMONX/setup.sh [-h] [-b build_dir] [-bt build_type] [-fc fortran_compiler] [-omp yes|no]
The setup.sh script supports the following options:
Option |
Required |
Description |
|---|---|---|
|
Optional |
Build directory. Default: |
|
Optional |
Build type: |
|
Optional |
Fortran compiler executable (default: |
|
Optional |
Enable OpenMP support: |
|
Optional |
Print the help message |
The selected build type controls the compiler flags passed to CMake
via CMAKE_BUILD_TYPE:
Build type |
Enabled compilation options |
|---|---|
|
High optimization ( |
|
Moderate optimization ( |
|
No optimization ( |
The exact compiler flags depend on the Fortran compiler (GNU or Intel) and are defined internally in the CMake configuration (CMakeLists.txt).