Macaulay2 / Macaulay2/M2

hardcoded paths in M2/cmake/FindReadline.cmake

Open
#2,218 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build issue
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

I attempted to compile Macaulay2 on a Gentoo Prefix, which allows easy installation of packages in a "prefix", i.e. some directory outside the system root.

The compilation failed because readline library ended up being pulled from the base system instead of the prefix. The culprit were the following lines. Note the hardcoded paths.
https://github.com/Macaulay2/M2/blob/3c3e3f7ddbc1a0ff20bd6723e41251557dea2936/M2/cmake/FindReadline.cmake#L24-L28

Letting CMake use its default lookup paths seems to do the trick. See below for a change that worked for me

find_path(READLINE_ROOT_DIR
    NAMES include/readline/readline.h
    PATHS ${HOMEBREW_PREFIX}/opt/readline
)

My experience with CMake is very limited, so I'm not sure if this breaks builds on different systems. @mahrud ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect M2/cmake/FindReadline.cmake, especially lines 24–28, and compare the hardcoded paths with the proposed find_path change. Build Macaulay2 in a Gentoo Prefix environment to verify that readline is found from the prefix rather than the base system, while checking that other systems still build successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.