Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 730314

Summary: sys-cluster/openmpi-4.1.2 - checking size of Fortran CHARACTER... configure: WARNING: Could not determine size of CHARACTER // configure: error: Cannot continue
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Gentoo Cluster Team <cluster>
Status: CONFIRMED ---    
Severity: normal CC: cluster, srcshelton
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502, 408963    
Attachments: build.log
other.tar.bz2

Description Agostino Sarubbo gentoo-dev 2020-07-01 09:12:49 UTC
@@This is an auto-filed bug@@
Feel free to change the summary at your convenience.

Issue: sys-cluster/openmpi fails to compile.
Discovered on: amd64

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please mention it in the summary and block bug 408963. If you need further logs, feel free to ask.
Comment 1 Agostino Sarubbo gentoo-dev 2020-07-01 09:12:57 UTC
Created attachment 647272 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-07-01 09:13:00 UTC
Created attachment 647274 [details]
other.tar.bz2

other logs
Comment 3 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-07-02 07:59:20 UTC
surely gfortran is not about clang, I do not know why it was not double checked before being filled.
Comment 4 Agostino Sarubbo gentoo-dev 2020-07-02 08:26:20 UTC
(In reply to Mikle Kolyada from comment #3)
> surely gfortran is not about clang, I do not know why it was not double
> checked before being filled.

I really do not understand what you mean but this is the exact error:

configure:45160: x86_64-pc-linux-gnu-gfortran -O2 -pipe -march=native -frecord-gcc-switches -fno-diagnostics-color  conftestf.f90 conftest.o -o conftest -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--defsym=__gentoo_check_ldflags__=0  -lz
ld.lld: error: can't create dynamic relocation R_X86_64_32 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in conftest.o
>>> referenced by conftest.c
>>>               conftest.o:(size_)

ld.lld: error: can't create dynamic relocation R_X86_64_32 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in conftest.o
>>> referenced by conftest.c
>>>               conftest.o:(size_)

ld.lld: error: can't create dynamic relocation R_X86_64_32 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in conftest.o
>>> referenced by conftest.c
>>>               conftest.o:(size_)
collect2: error: ld returned 1 exit status
configure:45167: $? = 1
configure:45188: here is the Fortran program:
program fsize

   external size
   CHARACTER :: x(2)
   call size(x(1),x(2))
end program
Comment 5 Arfrever Frehtes Taifersar Arahesis 2020-07-03 23:29:05 UTC
Another problem seen in build log:

checking for C ident string support... /var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure: line 20477: strings: command not found
/var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure: line 20520: strings: command not found
/var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure: line 20563: strings: command not found

${STRINGS} should be respected.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2020-07-03 23:40:54 UTC
Error "checking size of Fortran CHARACTER... configure: WARNING: Could not determine size of CHARACTER" can be reproduced by using Clang as C compiler and GFortran as Fortran compiler:
  CC="x86_64-pc-linux-gnu-clang"
  FC="x86_64-pc-linux-gnu-gfortran"

Value of CXX is not relevant here.
Linker (BFD, GOLD, LLD) is not relevant here.


Result with linker BFD:

configure:45036: checking size of Fortran CHARACTER
configure:45143: x86_64-pc-linux-gnu-clang -DNDEBUG -march=native -O2 -pipe -finline-functions -fno-strict-aliasing -I. -c conftest.c
configure:45150: $? = 0
configure:45160: x86_64-pc-linux-gnu-gfortran -march=westmere -O2 -fno-ident -frecord-gcc-switches -fstack-clash-protection -fstack-protector-all -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register -pipe -Wall  conftestf.f90 conftest.o -o conftest -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--gc-sections -Wl,--sort-common -Wl,-z,now  -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: conftest.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
configure:45167: $? = 1
configure:45188: here is the Fortran program:
program fsize

   external size
   CHARACTER :: x(2)
   call size(x(1),x(2))
end program
configure:45158: WARNING: Could not determine size of CHARACTER
configure:45160: WARNING: See config.log for details
configure:45162: error: Cannot continue


It is probably some incompatibility between GCC (GFortran) and Clang.
I think that it may be acceptable for ebuild to check C compiler and Fortran compiler and call die() in case of mismatch.


Version 11.0 of LLVM group of packages will include Fortran compiler called Flang.
Maybe Clang as C compiler + Flang as Fortran compiler will work...
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-07-06 15:18:23 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #5)
> Another problem seen in build log:
> 
> checking for C ident string support...
> /var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure:
> line 20477: strings: command not found
> /var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure:
> line 20520: strings: command not found
> /var/tmp/portage/sys-cluster/openmpi-4.0.3/work/openmpi-4.0.3/configure:
> line 20563: strings: command not found
> 
> ${STRINGS} should be respected.

As long as there is no qa agreement about what should be repsepcted and what should not I simply refuse and ignore strings, I have already explained why before (in 99% of cases it does not affect cross compilation).
Comment 8 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-07-06 15:21:54 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #6)
> Error "checking size of Fortran CHARACTER... configure: WARNING: Could not
> determine size of CHARACTER" can be reproduced by using Clang as C compiler
> and GFortran as Fortran compiler:
>   CC="x86_64-pc-linux-gnu-clang"
>   FC="x86_64-pc-linux-gnu-gfortran"
> 
> Value of CXX is not relevant here.
> Linker (BFD, GOLD, LLD) is not relevant here.
> 
> 
> Result with linker BFD:
> 
> configure:45036: checking size of Fortran CHARACTER
> configure:45143: x86_64-pc-linux-gnu-clang -DNDEBUG -march=native -O2 -pipe
> -finline-functions -fno-strict-aliasing -I. -c conftest.c
> configure:45150: $? = 0
> configure:45160: x86_64-pc-linux-gnu-gfortran -march=westmere -O2 -fno-ident
> -frecord-gcc-switches -fstack-clash-protection -fstack-protector-all
> -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register
> -pipe -Wall  conftestf.f90 conftest.o -o conftest -Wl,-O1 -Wl,--as-needed
> -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,--gc-sections -Wl,--sort-common
> -Wl,-z,now  -lz
> /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: conftest.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be
> used when making a PIE object; recompile with -fPIE
> collect2: error: ld returned 1 exit status
> configure:45167: $? = 1
> configure:45188: here is the Fortran program:
> program fsize
> 
>    external size
>    CHARACTER :: x(2)
>    call size(x(1),x(2))
> end program
> configure:45158: WARNING: Could not determine size of CHARACTER
> configure:45160: WARNING: See config.log for details
> configure:45162: error: Cannot continue
> 
> 
> It is probably some incompatibility between GCC (GFortran) and Clang.
> I think that it may be acceptable for ebuild to check C compiler and Fortran
> compiler and call die() in case of mismatch.
> 
> 
> Version 11.0 of LLVM group of packages will include Fortran compiler called
> Flang.
> Maybe Clang as C compiler + Flang as Fortran compiler will work...


That is the point, I do not know why this bug was filed at all, I mean it was filled blindly.

So far I only have 3 options:

1.) close it as invalid (as it is invalid per se)
2.) wait for flang^W llvm11 and try again
3.) simply die on tc-is-clang && firtran

Also I am afraid proper flang support will never be added into old (3.x) and legacy (1.x and 2.x) openmpi mainline, so the bug is goint to be invalid at some point.
Comment 9 Agostino Sarubbo gentoo-dev 2022-01-25 08:43:04 UTC
tinderbox has reproduced this issue with version 4.1.2 - Updating summary.