gfortran coarray library not compiling with Ubuntu 20.04

Bug #1897433 reported by Adrian Barbuio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-defaults (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I have been trying to install and run coarray libraries for gfortran. Every instruction set I can find on the interwebs gives Ubuntu 18.04 instructions. So far, I have run into a series of errors, using 20.04 and it seems I am not alone. Here is where I am at:

I was looking to run coarrays in gfortran. I was following instructions et al that directed me to download open-coarrays-bin using apt. I get an error message saying that apt is unable to find the package. I found another post mentioning this error in 20.04, at https://github.com/sourceryinstitute/OpenCoarrays/issues/702. So, I was informed of a workaround, with the commands:

```
cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/h/hwloc/libhwloc5_1.11.9-1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openmpi/libopenmpi2_2.1.1-8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/open-coarrays/libcaf-mpi2_2.0.0~rc1-2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/open-coarrays/open-coarrays-bin_2.0.0~rc1-2_amd64.deb

sudo apt-get install ./libhwloc5_1.11.9-1_amd64.deb ./libopenmpi2_2.1.1-8_amd64.deb ./libcaf-mpi2_2.0.0~rc1-2_amd64.deb ./open-coarrays-bin_2.0.0~rc1-2_amd64.deb
```

And so, now, checking, the binary package is installed, but when I go to compile a test script:

```
gfortran -fcoarray=lib test_coarray.f95 -o testcoarray
```

I get the error:

```
/usr/bin/ld: /tmp/cctOU7Q5.o: in function `MAIN__':
test_coarray.f95:(.text+0x67): undefined reference to `_gfortran_caf_this_image'
/usr/bin/ld: test_coarray.f95:(.text+0xaf): undefined reference to `_gfortran_caf_num_images'
/usr/bin/ld: /tmp/cctOU7Q5.o: in function `main':
test_coarray.f95:(.text+0x11c): undefined reference to `_gfortran_caf_init'
/usr/bin/ld: test_coarray.f95:(.text+0x148): undefined reference to `_gfortran_caf_finalize'
collect2: error: ld returned 1 exit status
```

using caf directly:

```
caf test_coarray.f95 -o testcoarray
```

I get the error:

```
gfortran: error: /usr/lib/x86_64-linux-gnu/libcaf_mpi.a: No such file or directory
Error: comand:
   `/usr/bin/mpifort -I/usr/include/OpenCoarrays-2.0.0-rc1_GNU-7.3.0 -fcoarray=lib test_coarray.f95 -o testcoarray /usr/lib/x86_64-linux-gnu/libcaf_mpi.a`
failed to compile.
```

Okay, so I do some digging and it seems that the libcaf_mpi.a file does not exist. Running:

```
ls /usr/lib/x86_64-linux-gnu | grep libcaf
```

I get:

```
libcaf_mpich.a
libcaf_mpich.so
libcaf_mpich.so.3
libcaf_mpi.so.2
libcaf_openmpi.a
libcaf_openmpi.so
libcaf_openmpi.so.3
```

I saw somewhere in my searching that someone modified the /usr/bin/caf file, changing the line:

```
caf_libs=(lib/x86_64-linux-gnu/libcaf_mpi.a) # e.g. "libcaf_mpi" "libcaf_extensions",
```

to:

```
caf_libs=(lib/x86_64-linux-gnu/libcaf_mpi.so.2) # e.g. "libcaf_mpi" "libcaf_extensions",
```

So, now, I try to compile the code, but I get the message:

```
f951: Warning: Nonexistent include directory ‘/usr/include/OpenCoarrays-2.0.0-rc1_GNU-7.3.0’ [-Wmissing-include-dirs]
/usr/bin/ld: warning: libmpi_mpifh.so.20, needed by /usr/lib/x86_64-linux-gnu/libcaf_mpi.so.2, may conflict with libmpi_mpifh.so.40
/usr/bin/ld: warning: libgfortran.so.4, needed by /usr/lib/x86_64-linux-gnu/libcaf_mpi.so.2, may conflict with libgfortran.so.5
```

So, it seems there is some unmet dependencies in the repositories, but I am not sure. I have, here, reached the end of both my expertise and, it seems, the internet trail of this bug. It would seem that this all works in Ubuntu 18.04, but I have not tested it myself, so I cannot be sure. I thank you for reading this far and really do hope that I haven't overloaded you with too much detail. Coarrays really is necessary for my work and your help here will be greatly appreciated. Please let me know if there is any more information needed and it will be provided posthaste.

Regards, Adrian

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gfortran 4:9.3.0-1ubuntu2
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
NonfreeKernelModules: wl nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Sun Sep 27 14:43:52 2020
InstallationDate: Installed on 2020-07-28 (60 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
 LANGUAGE=en_AU:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Adrian Barbuio (oiubrab) wrote :
Revision history for this message
Adrian Barbuio (oiubrab) wrote :

Hello, just wondering if this was ever addressed. It is still important

Revision history for this message
Brian Murray (brian-murray) wrote :

The open-coarrays-bin package you have manually installed with dpkg is for the Ubuntu 18.04 LTS release of Ubuntu and I would not expect it to run successfully on Ubuntu 20.04 LTS.

 $ rmadison open-coarrays-bin
 open-coarrays-bin | 2.0.0~rc1-2 | bionic/universe | amd64, arm64, armhf, i386, ppc64el, s390x

open-coarrays is a source package which is still included in Ubuntu 20.04 LTS, just for some reason there is no longer an open-coarrays-bin package.

 $ rmadison open-coarrays
 open-coarrays | 2.0.0~rc1-2 | bionic/universe | source
 open-coarrays | 2.8.0-1 | focal/universe | source
 open-coarrays | 2.9.0-2 | groovy/universe | source

I'm not familiar with this software so that's about as much help as I can be. Regardless this is not a gcc-defaults bug so I'm setting it to Invalid.

Changed in gcc-defaults (Ubuntu):
status: New → Invalid
Revision history for this message
Adrian Barbuio (oiubrab) wrote :

Thank you @Brian for responding to this bug and, in essence, my email. It seems there is no way to install open-coarrays on Ubuntu 20.04 that is entirely functional. If this is not a gcc-defaults bug, then how should i proceed in terms of addressing the issue and trying to install this package.

Regards, Adrian

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.