Replies: 2 comments
-
Worked great! The crucial step for me was selecting the "Desktop development with C++". I didn't do it at first, and despite having Visual Studio, I didn't have the C/C++ compiler. Thank you, Mark 😊 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Note that I went through the steps above again in July 2024 and made some minor updates. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Building Landlab from source on Windows is trickier than on Linux or macOS. Below are some steps, based on recent experience (originally July 2023, updated July 2024), that should work.
Note that this note is a band-aid: we'll use the information below to update the Developer Install instructions in the Landlab documentation.
Install Anaconda
To set up a Python environment to run Landlab, we use Anaconda. Download Anaconda and install it. This will give you the programs Anaconda Navigator and Anaconda Powershell Prompt.
The installer has only a few steps. In one of them, you're given the option to add Anaconda to the Windows PATH environment variable. Do this! It will allow you to call
conda
from the Git Bash prompt.Install Git for Windows
To download, and possibly modify, the Landlab source code, we use Git. Download Git for Windows and install it. This will give you the Git Bash shell.
The installer has many steps. Selecting the defaults are fine for all but one of them: when given the option to add Git for Windows to the Windows path, do it! This will allow you to call
git
from the Anaconda prompt.Install Visual Studio Community Edition
Landlab has many parts that are written in C, and we need a C compiler to build them. Download the latest version of Visual Studio Community Edition and install it. We don't need to use Visual Studio directly, but the compiler and linker included with it are used in the Landlab build process.
In the installation, be sure to check the option "Desktop development with C++", which will install the C/C++ compiler. See this help article for more information.
Clone the Landlab repository
Using the Git Bash shell (or an Anaconda Powershell Prompt if you added Anaconda to the Windows path), clone the Landlab repository:
You may wish to fork Landlab and clone your fork instead.
Also, you'll need an SSH key set up on your machine for communicating with GitHub. See this lesson from CSDMS Ivy for more information.
Create a conda environment
Next, we use
conda
to create a Python environment with all the dependencies that Landlab needs. Change to the Landlab directory:and create an environment with:
Activate the environment:
Next, install into the environment the dependencies needed to run Landlab and its example notebooks:
Last, to communicate with the compiler and linker included with Visual Studio, install the conda compilers:
Build/install Landlab
Build Landlab from source and install it with:
Once this completes, check that it works by opening a Python interpreter and trying to
import landlab
.Beta Was this translation helpful? Give feedback.
All reactions