Opened 2 years ago

Closed 2 years ago

#25001 closed defect (fixed)

gfortran breaks parallel build

Reported by: vbraun Owned by:
Priority: blocker Milestone: sage-8.2
Component: build Keywords: random_fail
Cc: embray Merged in:
Authors: Jeroen Demeyer Reviewers: Erik Bray
Report Upstream: N/A Work issues:
Branch: 9d14972 (Commits) Commit: 9d149723f008af6eed4a7182da88678bf9fb898d
Dependencies: Stopgaps:

Description

gfortran overwrites compiler parts non-atomically; This breaks parallel compilation:

[gfortran-7.2.0] /bin/sh ../../src/gcc/../mkinstalldirs /Users/buildslave-sage/slave/sage_git/build/local/libexec/gcc/x86_64-apple-darwin17.4.0/7.2.0/plugin
[gfortran-7.2.0] mkdir /Users/buildslave-sage/slave/sage_git/build/local/libexec/gcc/x86_64-apple-darwin17.4.0/7.2.0/plugin
[gfortran-7.2.0] /usr/bin/install -c gengtype /Users/buildslave-sage/slave/sage_git/build/local/libexec/gcc/x86_64-apple-darwin17.4.0/7.2.0/plugin/gengtype
[gfortran-7.2.0] for file in gnat1 brig1 cc1 cc1plus f951 go1  lto1 cc1obj cc1objplus; do \
[gfortran-7.2.0]          if [ -f $file ] ; then \
[gfortran-7.2.0]            rm -f /Users/buildslave-sage/slave/sage_git/build/local/libexec/gcc/x86_64-apple-darwin17.4.0/7.2.0/$file; \
[gfortran-7.2.0]            /usr/bin/install -c $file /Users/buildslave-sage/slave/sage_git/build/local/libexec/gcc/x86_64-apple-darwin17.4.0/7.2.0/$file; \
[gfortran-7.2.0]          else true; \
[gfortran-7.2.0]          fi; \
[gfortran-7.2.0]        done
[flint-2.5.2.p2] gcc: error trying to exec 'cc1': execvp: No such file or directory
[flint-2.5.2.p2] make[4]: *** [../build/fmpq_poly/test/t-scalar_mul_si] Error 1
[flint-2.5.2.p2] gcc -fno-common -ansi -pedantic -Wall -O2 -funroll-loops -g -mpopcnt  -I/Users/buildslave-sage/slave/sage_git/build/local/var/tmp/sage/build/flint-2.5.2.p2/src -I/Users/buildslave-sage/slave/sage_git/build/local/include -I/Users/buildslave-sage/slave/sage_git/build/local/include -I/Users/buildslave-sage/slave/sage_git/build/local/include test/t-scalar_mul_ui.c ../build/fmpq_poly/../../test_helpers.o -o ../build/fmpq_poly/test/t-scalar_mul_ui -L/Users/buildslave-sage/slave/sage_git/build/local/var/tmp/sage/build/flint-2.5.2.p2/src -L/Users/buildslave-sage/slave/sage_git/build/local/lib -L/Users/buildslave-sage/slave/sage_git/build/local/lib -L/Users/buildslave-sage/slave/sage_git/build/local/lib -lflint -lmpfr -lgmp -lm -lntl -lpthread  -MMD -MP -MF ../build/fmpq_poly/test/t-scalar_mul_ui.d -MT "../build/fmpq_poly/test/t-scalar_mul_ui" -MT "../build/fmpq_poly/test/t-scalar_mul_ui.d"

Change History (15)

comment:1 Changed 2 years ago by jdemeyer

Why is gfortran installing gcc in the first place?

comment:2 follow-up: Changed 2 years ago by fbissey

Because you cannot build gfortran without a minimal gcc at this stage. There is a section at the end of spkg-install that renames it so it is not in the way. Patching to avoid install is hard.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 2 years ago by jdemeyer

Replying to fbissey:

Because you cannot build gfortran without a minimal gcc at this stage.

Building, I understand. But installing?

comment:4 in reply to: ↑ 3 ; follow-up: Changed 2 years ago by fbissey

Replying to jdemeyer:

Replying to fbissey:

Because you cannot build gfortran without a minimal gcc at this stage.

Building, I understand. But installing?

I know what you mean but as far as I know you cannot build it without it being an install target. If you know some more configure/install options feel free to enlighten me. Otherwise this is a perfect scenario for Erik's work on staging the install rather than installing directly on the system. You could fix something like that in the staging area before merging the install on the system.

comment:5 Changed 2 years ago by fbissey

There is a hack we could use, configure with one of --program-prefix or --program-suffix and then link the resulting gfortran binary to the expected name. Says we pass --program-prefix=sage and then we will have sage-gcc, sage-gfortran and so on installed. As the last step we create a link gfortran to sage-gfortran and since sage-{gcc,g++} is not an expected name for other configure scripts, we should be safe.

comment:6 Changed 2 years ago by vbraun

Or maybe just not compile other stuff until gfortran is complete, like gcc

comment:7 in reply to: ↑ 4 Changed 2 years ago by jdemeyer

Replying to fbissey:

Otherwise this is a perfect scenario for Erik's work on staging the install rather than installing directly on the system.

+1

comment:8 Changed 2 years ago by jdemeyer

I'll try the staged install, just to see whether it might work.

comment:9 Changed 2 years ago by jdemeyer

  • Branch set to u/jdemeyer/gfortran_breaks_parallel_build

comment:10 Changed 2 years ago by git

  • Commit set to 04f992c9e176f4645d5c6b72624587dfa6357a9b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

330e618Introduce SAGE_DESTDIR_LOCAL variable
04f992cDon't install gcc as part of gfortran

comment:11 Changed 2 years ago by git

  • Commit changed from 04f992c9e176f4645d5c6b72624587dfa6357a9b to 9d149723f008af6eed4a7182da88678bf9fb898d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

9d14972Don't install gcc as part of gfortran

comment:12 Changed 2 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Cc embray added; jdemeyer removed
  • Status changed from new to needs_review

comment:13 Changed 2 years ago by fbissey

If the bits in sage-spkg do their jobs as expected then it looks good to me.

comment:14 Changed 2 years ago by embray

  • Reviewers set to Erik Bray
  • Status changed from needs_review to positive_review

comment:15 Changed 2 years ago by vbraun

  • Branch changed from u/jdemeyer/gfortran_breaks_parallel_build to 9d149723f008af6eed4a7182da88678bf9fb898d
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.