Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
README.md: Add step to sanitize the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jan 4, 2023
1 parent 2114066 commit 80a84d4
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):

Expand Down

0 comments on commit 80a84d4

Please sign in to comment.