From 0c3626c7497ce7c5292915d24febb585da8e233b Mon Sep 17 00:00:00 2001 From: camillelandri Date: Mon, 7 Apr 2025 16:01:30 +0200 Subject: [PATCH 1/5] Add MacOS compilation instructions --- docs/src/0_getting_started/2_installation.rst | 73 ++++++++++++++++++- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/docs/src/0_getting_started/2_installation.rst b/docs/src/0_getting_started/2_installation.rst index ac006b0d..b817b829 100644 --- a/docs/src/0_getting_started/2_installation.rst +++ b/docs/src/0_getting_started/2_installation.rst @@ -115,7 +115,7 @@ All of these packages can also be found in the `conda environment file `. .. hint:: @@ -133,11 +133,80 @@ Once all dependencies are in place, Magritte can be compiled. See :ref:`advanced compilation ` for further options. +.. _link-macos_compilation: +Compilation on MacOS +******************** -.. _link-advanced_compilation: +By default, MacOS uses Clang and does not have the GNU compiler (gcc) installed. +We do not recommend using Clang to compile Magritte because of compatibility issues with OpenMP. +However, even when gcc is installed, the gcc command may still point to Clang, so a couple of +extra steps are required to ensure that gcc is used when compiling Magritte. + +If you have never installed gcc on your machine, it can be done through Homebrew +(a package manager for MacOS, see `here `_ for details on how to install it). + +Once homebrew is installed, run the following command to install gcc: + +.. code-block:: shell + + brew install gcc + + +Gcc should now be installed, but the default gcc command may still point to Clang. +To check where the gcc command points, run the following command: + +.. code-block:: shell + + gcc --version + +If the output shows that the version is Apple Clang, you need manually to set the gcc command to point to the GNU compiler. +A way to do this is to set the following environment variables: + +.. code-block:: shell + + export CC=/path/to/gcc/gcc- + + export CXX=/path/to/gcc/g++- + +Here, you should use the path to your own gcc binaries, and :literal:`` is the version of gcc installed on your machine (e.g. :literal:`gcc-14` and :literal:`g++-14` for gcc.14.x.x). + +.. hint:: + + If you installed gcc through brew, its version can be found by running the following command: + + .. code-block:: shell + + brew info gcc + + cropping the version to the first number (e.g. :literal:`gcc-14` and :literal:`g++-14` for gcc.14.x.x), use the following command to find the path to your compiler: + + .. code-block:: shell + + which gcc- + + which g++- + This should give you the path to your gcc binaries, which can be used in the :literal:`export` commands above. + The paths should look like similar to this: + - :literal:`/opt/homebrew/Cellar/gcc/14.2.0_1/bin/gcc-14` + - :literal:`/opt/homebrew/Cellar/gcc/14.2.0_1/bin/g++-14` +It is also possible to use Homebrew to install the dependencies needed by Magritte. +You can install CMake and miniconda, which are required to compile Magritte: + +.. code-block:: shell + + brew install CMake miniconda + +You can also use brew to install the required MPI librairies (open-mpi or mpich, and mpi4py): + +.. code-block:: shell + + brew install open-mpi + brew install mpi4py + +.. _link-advanced_compilation: Advanced compilation ******************** From baeb6a96e315960970dc5bd42251aa369acd0e21 Mon Sep 17 00:00:00 2001 From: camillelandri Date: Mon, 7 Apr 2025 16:34:11 +0200 Subject: [PATCH 2/5] Add a subsection on installing python reqs without conda --- dependencies/requirements.txt | 26 +++++++++++++++ docs/src/0_getting_started/2_installation.rst | 33 +++++++++++++++++-- 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 dependencies/requirements.txt diff --git a/dependencies/requirements.txt b/dependencies/requirements.txt new file mode 100644 index 00000000..9c1edce1 --- /dev/null +++ b/dependencies/requirements.txt @@ -0,0 +1,26 @@ + numpy + jupyterlab + yt + scipy + mpi4py + plotly + pyyaml + ipywidgets + tqdm + palettable + h5py + numba + healpy + astroquery + nbdime + jupyterlab-git + pandas + nodejs + twine + sphinx + breathe + sphinx_rtd_theme + sphinx-copybutton + nbsphinx + pytest + plons diff --git a/docs/src/0_getting_started/2_installation.rst b/docs/src/0_getting_started/2_installation.rst index b817b829..9ed34611 100644 --- a/docs/src/0_getting_started/2_installation.rst +++ b/docs/src/0_getting_started/2_installation.rst @@ -104,6 +104,29 @@ All of these packages can also be found in the `conda environment file Here, you should use the path to your own gcc binaries, and :literal:`` is the version of gcc installed on your machine (e.g. :literal:`gcc-14` and :literal:`g++-14` for gcc.14.x.x). +If you recompile the code often, you may want to add these two commands to your .zprofile to make them permanent. .. hint:: @@ -192,6 +215,12 @@ Here, you should use the path to your own gcc binaries, and :literal:`` - :literal:`/opt/homebrew/Cellar/gcc/14.2.0_1/bin/gcc-14` - :literal:`/opt/homebrew/Cellar/gcc/14.2.0_1/bin/g++-14` +Once the exports are done, you can compile Magritte as described before, using: + +.. code-block:: shell + + bash build.sh + It is also possible to use Homebrew to install the dependencies needed by Magritte. You can install CMake and miniconda, which are required to compile Magritte: From 510cb0741cd3d4c4164ea04484fa42f5c13d43da Mon Sep 17 00:00:00 2001 From: camillelandri Date: Tue, 8 Apr 2025 11:34:44 +0200 Subject: [PATCH 3/5] Change hyperlinks to be more explicit + minor text corrections --- docs/src/0_getting_started/2_installation.rst | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/src/0_getting_started/2_installation.rst b/docs/src/0_getting_started/2_installation.rst index 9ed34611..953a3bb8 100644 --- a/docs/src/0_getting_started/2_installation.rst +++ b/docs/src/0_getting_started/2_installation.rst @@ -138,7 +138,7 @@ All of these packages can also be found in the `conda environment file `. +Once all dependencies are in place, Magritte can be compiled. The compilation with MacOS requires extra care, it is detailed in the section :ref:`compilation on MacOS`. .. hint:: @@ -163,11 +163,11 @@ Compilation on MacOS By default, MacOS uses Clang and does not have the GNU compiler (gcc) installed. We do not recommend using Clang to compile Magritte because of compatibility issues with OpenMP. -However, even when gcc is installed, the gcc command may still point to Clang, so a couple of +Additionally, even when gcc is installed, the gcc command may still point to Clang, so a couple of extra steps are required to ensure that gcc is used when compiling Magritte. If you have never installed gcc on your machine, it can be done through Homebrew -(a package manager for MacOS, see `here `_ for details on how to install it). +(a package manager for MacOS, see `their webpage `_ for details on how to install it). Once homebrew is installed, run the following command to install gcc: @@ -221,19 +221,12 @@ Once the exports are done, you can compile Magritte as described before, using: bash build.sh -It is also possible to use Homebrew to install the dependencies needed by Magritte. -You can install CMake and miniconda, which are required to compile Magritte: +We also recommend using Homebrew to install the dependencies needed by Magritte. +You can install CMake and miniconda and MPI librairies (open-mpi or mpich, and mpi4py), which are all required to compile Magritte: .. code-block:: shell - brew install CMake miniconda - -You can also use brew to install the required MPI librairies (open-mpi or mpich, and mpi4py): - -.. code-block:: shell - - brew install open-mpi - brew install mpi4py + brew install CMake miniconda open-mpi mpi4py .. _link-advanced_compilation: From f6018ff019f05559b07b3d22a19f584ef819eef3 Mon Sep 17 00:00:00 2001 From: camillelandri Date: Tue, 8 Apr 2025 11:35:57 +0200 Subject: [PATCH 4/5] Add name to contributors --- README.md | 1 + docs/src/index.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index be0bb9db..53116907 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ examples to facilitate its independent use. Until then, please * Atulit Srivastava * Arnout Coenegrachts * Owen Vermeulen +* Camille Landri ## Acknowledgements FDC was for most of the development supported by the EPSRC iCASE studentship programme, Intel Corporation and Cray Inc, and is currently a Postdoctoral Research Fellow of the Research Foundation - Flanders (FWO). diff --git a/docs/src/index.rst b/docs/src/index.rst index 6ef9dfe5..8f690f5d 100644 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -103,6 +103,7 @@ Developers & Contributors * `Mats Esseldeurs `_ * Arnout Coenegrachts * Owen Vermeulen +* Camille Landri Acknowledgements **************** From e78ae178f1cbe5e02867bf65a255fa75129cf9ab Mon Sep 17 00:00:00 2001 From: camillelandri Date: Tue, 8 Apr 2025 11:40:48 +0200 Subject: [PATCH 5/5] typo correction --- docs/src/0_getting_started/2_installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/0_getting_started/2_installation.rst b/docs/src/0_getting_started/2_installation.rst index 953a3bb8..b9a43fc7 100644 --- a/docs/src/0_getting_started/2_installation.rst +++ b/docs/src/0_getting_started/2_installation.rst @@ -222,7 +222,7 @@ Once the exports are done, you can compile Magritte as described before, using: bash build.sh We also recommend using Homebrew to install the dependencies needed by Magritte. -You can install CMake and miniconda and MPI librairies (open-mpi or mpich, and mpi4py), which are all required to compile Magritte: +You can install CMake, miniconda and MPI librairies (open-mpi or mpich, and mpi4py), which are all required to compile Magritte: .. code-block:: shell