Skip to content

Fix MPFR build failure due to aclocal-1.17 not found#2834

Merged
mgehre-amd merged 1 commit intomainfrom
users/mgehre-amd/mpfr_aclocal
Jan 9, 2026
Merged

Fix MPFR build failure due to aclocal-1.17 not found#2834
mgehre-amd merged 1 commit intomainfrom
users/mgehre-amd/mpfr_aclocal

Conversation

@mgehre-amd
Copy link
Copy Markdown
Contributor

When building therock-mpfr, the build fails with:
[therock-mpfr] aclocal-1.17: command not found
when automake 1.17 is not installed. In our README.md's Setup - Ubuntu (24.04) section, we don't require to install it.

This occurs because cmake -E copy_directory does not preserve file timestamps. When the MPFR source is copied to the build directory, autoconf-generated files (aclocal.m4, Makefile.in) end up with newer timestamps than their source files (configure.ac, etc.), causing the autotools build system to attempt regeneration. This regeneration requires the exact automake version (1.17) that was used to generate the original files.

Fix:
Touch the critical autoconf-generated files after copying to ensure their timestamps are newer than the source files. This prevents the autotools build system from trying to regenerate them. This approach matches the existing workaround used in the GMP build (third-party/sysdeps/common/gmp/CMakeLists.txt).

Test Plan

No aclocal-1.17 installed locally

rm -rf build/third-party/sysdeps/linux/mpfr
ninja -C build therock-mpfr

Test Result

Succesful

Submission Checklist

Issue:
When building therock-mpfr, the build fails with:
  [therock-mpfr] aclocal-1.17: command not found

This occurs because cmake -E copy_directory does not preserve file
timestamps. When the MPFR source is copied to the build directory,
autoconf-generated files (configure, aclocal.m4, Makefile.in) end up
with newer timestamps than their source files (configure.ac, etc.),
causing the autotools build system to attempt regeneration. This
regeneration requires the exact automake version (1.17) that was used
to generate the original files.

How to reproduce:
1. Build TheRock with MPFR enabled on a system without automake 1.17
2. The build fails at the MPFR configure step with:
   /path/to/missing: line 85: aclocal-1.17: command not found

Fix:
Touch the critical autoconf-generated files after copying to ensure
their timestamps are newer than the source files. This prevents the
autotools build system from trying to regenerate them. This approach
matches the existing workaround used in the GMP build
(third-party/sysdeps/common/gmp/CMakeLists.txt).

Testing:
After applying this fix, clean the MPFR build directory and rebuild:
  rm -rf build/third-party/sysdeps/linux/mpfr
  ninja -C build therock-mpfr
The MPFR build should complete successfully without requiring
automake to be installed.

Alternative fix:
Instead of this patch, we could alternatively require developers to
have automake 1.17 installed on their system.
@lumachad
Copy link
Copy Markdown
Contributor

lumachad commented Jan 9, 2026

Thanks for the PR. I think this is OK as a workaround. But ultimately I think we'll need to switch to building straight from the extracted source directory since that has preserved timestamps.

Edit: I have a plan to do that for gmp/mpfr/expat/ncurses.

Copy link
Copy Markdown
Contributor

@lumachad lumachad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lumachad
Copy link
Copy Markdown
Contributor

lumachad commented Jan 9, 2026

CI looks OK. The failures seem unrelated to the changes in this PR.

@mgehre-amd mgehre-amd merged commit 3f474fc into main Jan 9, 2026
63 of 68 checks passed
@mgehre-amd mgehre-amd deleted the users/mgehre-amd/mpfr_aclocal branch January 9, 2026 14:14
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants