Opened 5 years ago

Closed 5 years ago

#25001 closed defect (fixed)

gfortran breaks parallel build

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

Status badges

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 5 years ago by Jeroen Demeyer

Why is gfortran installing gcc in the first place?

comment:2 Changed 5 years ago by François Bissey

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 ; Changed 5 years ago by Jeroen Demeyer

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 ; Changed 5 years ago by François Bissey

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 5 years ago by François Bissey

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 5 years ago by Volker Braun

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

comment:7 in reply to:  4 Changed 5 years ago by Jeroen Demeyer

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 5 years ago by Jeroen Demeyer

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

comment:9 Changed 5 years ago by Jeroen Demeyer

Branch: u/jdemeyer/gfortran_breaks_parallel_build

comment:10 Changed 5 years ago by git

Commit: 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 5 years ago by git

Commit: 04f992c9e176f4645d5c6b72624587dfa6357a9b9d149723f008af6eed4a7182da88678bf9fb898d

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 5 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer
Cc: Erik Bray added; Jeroen Demeyer removed
Status: newneeds_review

comment:13 Changed 5 years ago by François Bissey

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

comment:14 Changed 5 years ago by Erik Bray

Reviewers: Erik Bray
Status: needs_reviewpositive_review

comment:15 Changed 5 years ago by Volker Braun

Branch: u/jdemeyer/gfortran_breaks_parallel_build9d149723f008af6eed4a7182da88678bf9fb898d
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.