[Bug 1897433] Re: gfortran coarray library not compiling with Ubuntu 20.04

Brian Murray 1897433 at bugs.launchpad.net
Thu Oct 8 14:55:55 UTC 2020


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

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1897433

Title:
  gfortran coarray library not compiling with Ubuntu 20.04

Status in gcc-defaults package in Ubuntu:
  Invalid

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1897433/+subscriptions



More information about the foundations-bugs mailing list