Skip to content

Commit

Permalink
Trac #34889: Installation guide: On WSL, clear /mnt/c stuff from PATH
Browse files Browse the repository at this point in the history
As seen in https://groups.google.com/g/sage-devel/c/1nYw7-6QSkQ, our
`configure` script fails to notice that some stuff in finds in PATH is
not suitable:
{{{
configure:7510: found /mnt/c/Strawberry/perl/bin/pkg-config
configure:7522: result: /mnt/c/Strawberry/perl/bin/pkg-config
configure:7547: checking pkg-config is at least version 0.29
...
configure:33252: checking for xml2-config
configure:33275: found /mnt/c/Strawberry/c/bin/xml2-config
configure:33288: result: /mnt/c/Strawberry/c/bin/xml2-config
configure:33305: will use system package and not install SPKG libxml2
...
configure:42387: checking for PRIMESIEVE
configure:42394: $PKG_CONFIG --exists --print-errors "primesieve >= 8.0"
./configure: /mnt/c/Strawberry/perl/bin/pkg-config: perl: bad
interpreter: No such file or directory
}}}

URL: https://trac.sagemath.org/34889
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Jan 5, 2023
2 parents 3570a9a + 80a84d4 commit bc832cb
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 bc832cb

Please sign in to comment.