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

Defect: Build failure on Fedora 32, using gcc 10.0.1 #704

Closed
jerryd opened this issue May 2, 2020 · 9 comments
Closed

Defect: Build failure on Fedora 32, using gcc 10.0.1 #704

jerryd opened this issue May 2, 2020 · 9 comments

Comments

@jerryd
Copy link

jerryd commented May 2, 2020

  • [ X] I am reporting a bug others will be able to reproduce and not asking a question or requesting a new feature.

System information including:

  • OpenCoarrays Version: Latest from git master
  • Fortran Compiler: gfortran 10.0.1
  • C compiler used for building lib: gcc 10.0.1
  • Installation method: Manual following instructions in install.md
  • All flags & options passed to the installer
  • Output of uname -a: Linux quasar 5.6.8-300.fc32.x86_64 tests dis_transpose: test passed  #1 SMP Wed Apr 29 19:01:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • MPI library being used: mpich-3.3.2-4.fc32.x86_64
  • Machine architecture and number of physical cores: x86_64 6 physical cores
  • Version of CMake: 3.17.2 pre-installed from Fedora package

To help us debug your issue please explain:

What you were trying to do (and why)

Trying to Build OpenCoarrays to test it.
--- snip ---
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jerry/dev/buildcaf/OpenCoarrays/build
[$ make
Scanning dependencies of target caf_mpi_static
[ 1%] Building C object src/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o
gcc: error: unrecognized command-line option ‘-fexceptions -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GLIBCXX_ASSERTIONS’
make[2]: *** [src/mpi/CMakeFiles/caf_mpi_static.dir/build.make:83: src/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:828: src/mpi/CMakeFiles/caf_mpi_static.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

What happened (include command output, screenshots, logs, etc.)

After invoking cmake ....:
[jerry@quasar build]$ rm -rf ./*
[jerry@quasar build]$ export FC=gfortran
[jerry@quasar build]$ export CC=gcc
[jerry@quasar build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/home/jerry/dev/usr
---snip ---
OpenCoarrays
""""""""""""
Build Type: Release
Version: 2.8.0-10-g964360c


-- Build from git repository detected
-- Running with CMake from: /usr/bin/cmake
-- Current source dir (for OpenCoarrays): /home/jerry/dev/buildcaf/OpenCoarrays
-- The C compiler identification is GNU 10.0.1
-- The Fortran compiler identification is GNU 10.0.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran - works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 - yes
-- Building OpenCoarrays version: 2.8.0-10-g964360c
-- Building for target architecture: x86_64
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles
-- Performing Test Check_Simple_Coarray_Fortran_Source_Compiles - Failed
-- Found MPI_C: /usr/lib64/mpich/lib/libmpi.so (found version "3.1")
-- Found MPI_Fortran: /usr/lib64/mpich/lib/libmpifort.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- MPI runtime and compile time environments appear to be consistent
-- Performing Test MPI_C_COMPILES
-- Performing Test MPI_C_COMPILES - Success
-- Performing Test MPI_Fortran_MODULE_COMPILES
-- Performing Test MPI_Fortran_MODULE_COMPILES - Success
-- Performing Test MPI_Fortran_INCLUDE_COMPILES
-- Performing Test MPI_Fortran_INCLUDE_COMPILES - Success
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for SIGKILL
-- Looking for SIGKILL - found
-- Looking for include files mpi.h, mpi-ext.h
-- Looking for include files mpi.h, mpi-ext.h - not found
-- Looking for MPIX_ERR_PROC_FAILED
-- Looking for MPIX_ERR_PROC_FAILED - found
-- Looking for MPIX_ERR_REVOKED
-- Looking for MPIX_ERR_REVOKED - found
-- Looking for MPIX_Comm_failure_ack
-- Looking for MPIX_Comm_failure_ack - found
-- Looking for MPIX_Comm_failure_get_acked
-- Looking for MPIX_Comm_failure_get_acked - found
-- Looking for MPIX_Comm_shrink
-- Looking for MPIX_Comm_shrink - found
-- Looking for MPIX_Comm_agree
-- Looking for MPIX_Comm_agree - found
-- The MPI implementation appears to have the experimental features for ULFM
that will allow you to build OpenCoarrays with failed images support. However,
ULFM support did not make it into the MPI-4 standard, and it is known to
trigger some bugs. Because of this we have disabled it by default. You may
add the -DCAF_ENABLE_FAILED_IMAGES:BOOL=ON CMake flag or edit the value
with ccmake or cmake-gui if you would like to experiment with failed images.
-- Looking for include file mpi.h
-- Looking for include file mpi.h - found
-- Looking for I_MPI_VERSION
-- Looking for I_MPI_VERSION - not found
-- Performing Test HAVE_ERROR_STOP_IN_PURE
-- Performing Test HAVE_ERROR_STOP_IN_PURE - Success
-- Performing Test HAVE_VARIABLE_STOP_CODE
-- Performing Test HAVE_VARIABLE_STOP_CODE - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jerry/dev/buildcaf/OpenCoarrays/build

What you expected to happen

make in build directory should complete with no errors.

Step-by-step reproduction instructions to reproduce the error/bug

See above, followed instructions per install.md at github.

@rouson
Copy link
Member

rouson commented May 4, 2020

@jerryd thanks for reporting this. Could you post the date that shows when you run gfortran --version? Do you know if this issue is specific to Fedora? I'll try to reproduce the problem on Ubuntu using the latest master branch of the GCC repository. I see that you have MPICH 3.1 installed. Most of my experience is with MPICH 3.2, although I think 3.1 should work. Could you try installing MPICH 3.2? In case it helps, the OpenCoarrays installer can build MPICh for your with a command like ./install.sh -p mpich -j 6 -i <desired-instlallation-path>.

@rouson
Copy link
Member

rouson commented May 5, 2020

@jerryd I just noticed that GCC 10.1 released last week so I'll test with the 10.1 release instead of testing with the GCC master branch. I'll be testing on Lubuntu with MPICH 3.2. If the build succeeds for me and the tests pass, then I'll try MPICH 3.1 to see if I can reproduce this issue. If that doesn't reproduce it, then it could be Fedora-specific, in which case I probably can't be of assistance, but maybe someone else can.

@rouson
Copy link
Member

rouson commented May 5, 2020

@jerryd arrrgh... scratch that. Now I see that it hasn't actually released. There is a release candidate. I'll build the release candidate if it's easy to figure out the appropriate git tag. Otherwise, I'll build the master branch.

@rouson
Copy link
Member

rouson commented May 5, 2020

@jerryd my installation succeeded on Lubuntu 19.10 with the following commands:

./install.sh -p gcc -b master -j 2 -i /usr/local/Cellar/gnu/10.0.1 
export PATH=/usr/local/Cellar/gnu/10.0.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/Cellar/gnu/10.0.1/bin:$LD_LIBRARY_PATH
time ./install.sh -j 6 -r /usr/local/Cellar/

Please try the above for me. Feel free to change the installation paths. If the above doesn't work for you, then the issue is most likely related to the issue is most likely Fedora-specific. Note that the last step above will install MPICH 3.2 if it doesn't find an MPICH 3.2 or later in your PATH. After installing MPICH, it will install OpenCoarrays.

@t-bltg
Copy link
Contributor

t-bltg commented May 8, 2020

FYI, gcc 10.1.0 was released today, and caf 2.8.0 compiles & runs fine with mpich 3.3.2.
Note that mpich was compiled with gcc-10 and FFLAGS=-fallow-argument-mismatch, see https://gcc.gnu.org/gcc-10/porting_to.html.

No regression either on https://github.com/uhhpctools/caf-testsuite.

GitHub
Test Suite for Fortran 2008 Coarrays. Contribute to uhhpctools/caf-testsuite development by creating an account on GitHub.

@rouson
Copy link
Member

rouson commented May 8, 2020

Thanks, @neok-m4700. Also, just FYI, the OpenCoarrays installer is able to build MPICH (./install.sh -p mpich) and it applies the FFLAGS=-fallow-argument-mismatch flag when it detects GCC versions >= 10 in the block of code at line 41 in prerequisites/build-functions/build_and_intall.sh.

@jerryd I'll close this. If you're still encountering difficulties, feel free to reopen it.

@rouson rouson closed this as completed May 8, 2020
@jerryd
Copy link
Author

jerryd commented May 13, 2020

This bug is very real. Let me explain. If someone follows the instructions here:
https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md
the instructions fail. I have duplicated the failure on Fedora 31 on a completely different machine. The steps given are:
mkdir opencoarrays-build
cd opencoarrays-build
export FC=/path/to/gfortran
export CC=/path/to/gcc
cmake /path/to/OpenCoarrays/source
-DCMAKE_INSTALL_PREFIX=/path/to/desired/installation/location
make
make test # optional; verify build works
make install

The result is identical to what I have decribed previously:
$ make
Scanning dependencies of target caf_mpi_static
[ 1%] Building C object src/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o
gcc: error: unrecognized command line option ‘-fexceptions -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GLIBCXX_ASSERTIONS’
make[2]: *** [src/mpi/CMakeFiles/caf_mpi_static.dir/build.make:83: src/mpi/CMakeFiles/caf_mpi_static.dir/mpi_caf.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:826: src/mpi/CMakeFiles/caf_mpi_static.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

gcc version is 9.3.1
gfortran version 9.3.1
cmake version 3.17.2

So either the instructions should be changed or the associated cmake configuration files fixed. (suggest this issue be reopened)

GitHub
A parallel application binary interface for Fortran 2018 compilers. - sourceryinstitute/OpenCoarrays

@t-bltg
Copy link
Contributor

t-bltg commented May 13, 2020

@jerryd Hi, can you please post the build output with -DCMAKE_VERBOSE_MAKEFILE=ON added to the cmake command ?

BTW, the options reported as unrecognized command line option in your bug report are very valid gcc options, try it yourself:

echo 'int main() {}' | gcc -xc - -fexceptions -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GLIBCXX_ASSERTIONS
./a.out

lettleli added a commit to lettleli/OpenCoarrays that referenced this issue May 13, 2020
The function target_compile_options in combination with
generator expressions does not handle strings with space
separated compiler flags and inserts quotes.

Also MPI_<lang>_COMPILE_FLAGS is deprecated since cmake 3.10
and should be replaced by MPI_<lang>_COMPILE_OPRIONS and
MPI_<lang>_COMPILE_DEFINITIONS.
Those variables are already lists of compiler flags and thus well
suited to solve the bug.

This fixes the build error described in issue sourceryinstitute#676 when using MPICH,
which is the same error as described in issue sourceryinstitute#704.

Signed-off-by: Elias Lettl <elias.lettl@physik.uni-augsburg.de>
lettleli added a commit to lettleli/OpenCoarrays that referenced this issue May 13, 2020
The function target_compile_options in combination with
generator expressions does not handle strings with space
separated compiler flags and inserts quotes.

Also MPI_<lang>_COMPILE_FLAGS is deprecated since cmake 3.10
and should be replaced by MPI_<lang>_COMPILE_OPRIONS and
MPI_<lang>_COMPILE_DEFINITIONS.
Those variables are already lists of compiler flags and thus well
suited to solve the bug.

This fixes the build error described in issue sourceryinstitute#676 when using MPICH,
which is the same error as described in issue sourceryinstitute#704.

Signed-off-by: Elias Lettl <elias.lettl@physik.uni-augsburg.de>
@jerryd
Copy link
Author

jerryd commented May 13, 2020

Confirmed the fix for #706 also fixed my issues here. Thanks much!

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

No branches or pull requests

3 participants