diff --git a/README.md b/README.md index e18b17adda5..1a0582d87c5 100644 --- a/README.md +++ b/README.md @@ -228,16 +228,37 @@ in the Installation Guide. (If the bootstrapping prerequisites are not installed, this command will download a package providing pre-built bootstrap output instead.) -6. [macOS with homebrew] Set required environment variables for the build: +6. Sanitize the build environment. Use the command - $ source ./.homebrew-build-env + $ env - This is to make some of Homebrew's packages (so-called keg-only packages) - available for the build. Run it once to apply the suggestions for the current - terminal session. You may need to repeat this command before you rebuild Sage - from a new terminal session, or after installing additional homebrew packages. - (You can also add it to your shell profile so that it gets run automatically - in all future sessions.) + to inspect the current environment variables, in particular `PATH`, + `PKG_CONFIG_PATH`, `LD_LIBRARY_PATH`, `CFLAGS`, `CPPFLAGS`, `CXXFLAGS`, + and `LDFLAGS` (if set). + + Remove items from these (colon-separated) environment variables + that Sage should not use for its own build. In particular, remove + items if they refer to a previous Sage installation. + + - [WSL] In particular, WSL imports many items from the Windows + `PATH` variable into the Linux environment, which can lead to + confusing build errors. These items typically start with `/mnt/c`. + It is best to remove all of them from the environment variables. + For example, you can set `PATH` using the command: + + $ export PATH=/usr/sbin/:/sbin/:/bin/:/usr/lib/wsl/lib/ + + - [macOS with homebrew] Set required environment variables for the build: + + $ source ./.homebrew-build-env + + This is to make some of Homebrew's packages (so-called keg-only + packages) available for the build. Run it once to apply the + suggestions for the current terminal session. You may need to + repeat this command before you rebuild Sage from a new terminal + session, or after installing additional homebrew packages. (You + can also add it to your shell profile so that it gets run + automatically in all future sessions.) 7. Optionally, decide on the installation prefix (`SAGE_LOCAL`):