Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gfortran breaks parallel build #25001

Closed
vbraun opened this issue Mar 18, 2018 · 17 comments
Closed

gfortran breaks parallel build #25001

vbraun opened this issue Mar 18, 2018 · 17 comments

Comments

@vbraun
Copy link
Member

vbraun commented Mar 18, 2018

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"

CC: @embray

Component: build

Keywords: random_fail

Author: Jeroen Demeyer

Branch/Commit: 9d14972

Reviewer: Erik Bray

Issue created by migration from https://trac.sagemath.org/ticket/25001

@vbraun vbraun added this to the sage-8.2 milestone Mar 18, 2018
@jdemeyer
Copy link

comment:1

Why is gfortran installing gcc in the first place?

@kiwifb
Copy link
Member

kiwifb commented Mar 18, 2018

comment:2

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.

@jdemeyer
Copy link

comment:3

Replying to @kiwifb:

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

Building, I understand. But installing?

@kiwifb
Copy link
Member

kiwifb commented Mar 18, 2018

comment:4

Replying to @jdemeyer:

Replying to @kiwifb:

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.

@kiwifb
Copy link
Member

kiwifb commented Mar 18, 2018

comment:5

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.

@vbraun
Copy link
Member Author

vbraun commented Mar 19, 2018

comment:6

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

@jdemeyer
Copy link

comment:7

Replying to @kiwifb:

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

+1

@jdemeyer
Copy link

comment:8

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

@jdemeyer
Copy link

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2018

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2018

Commit: 04f992c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2018

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

9d14972Don't install gcc as part of gfortran

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 19, 2018

Changed commit from 04f992c to 9d14972

@jdemeyer
Copy link

Author: Jeroen Demeyer

@kiwifb
Copy link
Member

kiwifb commented Mar 19, 2018

comment:13

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

@embray
Copy link
Contributor

embray commented Mar 19, 2018

Reviewer: Erik Bray

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2018

Changed branch from u/jdemeyer/gfortran_breaks_parallel_build to 9d14972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants