# OpenCoarrays in Fedora workstation 35?

**URL:** <https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910>\
**Category:** Help\
**Created:** [March 8, 2022, 1:19am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910 "2022-03-08T01:19:12Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 8, 2022, 1:19am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/1 "2022-03-08T01:19:12Z")

</div>

Hi all,  
I was wondering if anyone here uses OpenCoarrays on Fedora workstation 35 ?  
As it stands there is no package maintainer for the official repos. So if anyone uses it on Fedora I’d like to know how they got started.

Thank you  
[https://src.fedoraproject.org/rpms/OpenCoarrays](https://src.fedoraproject.org/rpms/OpenCoarrays)

---

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [March 8, 2022, 6:11pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/2 "2022-03-08T18:11:06Z")

</div>

I use GFortran on F35 but have never tried the coarray features. I thought GFortran natively supports coarray since it is part of the Fortran standard.

---

<div class="post-metadata">

**Author:** ![wyphan](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/wyphan/32/632_2.png) [@wyphan](https://fortran-lang.discourse.group/u/wyphan)\
**Post date:** [March 8, 2022, 6:23pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/3 "2022-03-08T18:23:16Z")

</div>

Summoning the lead dev for OpenCoarrays @rouson to this thread.

---

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)\
**Post date:** [March 8, 2022, 6:35pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/4 "2022-03-08T18:35:47Z")

</div>

> [@fortran4r](#):
>
> I use GFortran on F35 but have never tried the coarray features. I thought GFortran natively supports coarray since it is part of the Fortran standard.

Gfortran does support coarray syntax on plain Windows and I assume any OS. For the code

```auto
program main
  implicit none
  write (*,*) "Hello from image", this_image(), "of", num_images()
end program main

```

compiling with `gfortran -fcoarray=single xcoarray.f90` and running gives output

` Hello from image 1 of 1`

Compiling with `ifort -Qcoarray -Qcoarray-num-images:4 xcoarray.f90` and running gave

```auto
 Hello from image 2 of 4
 Hello from image 3 of 4
 Hello from image 4 of 4
 Hello from image 1 of 4

```

The image numbers can be printed in any order. Gfortran on WSL does support coarrays with more than one image.

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [March 8, 2022, 7:58pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/5 "2022-03-08T19:58:33Z")

</div>

> [@Beliavsky](#):
>
> Gfortran on WSL does support coarrays with more than one image.

do you mean it supports coarrays w/o OpenCoarrays? I guess not. AFAIK WSL uses Ubuntu by default and Ubuntu has opencoarrays in its repo.  
Unless it has changed (again) recently, RHEL-like OSes abandoned OpenCoarrays quite a while ago. It used to be available in older Fedoras.  
For now, I think the only solution for these OSes is Homebrew for Linux which also has it.

---

<div class="post-metadata">

**Author:** ![nncarlson](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nncarlson/32/1175_2.png) [@nncarlson](https://fortran-lang.discourse.group/u/nncarlson)\
**Post date:** [March 8, 2022, 11:03pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/6 "2022-03-08T23:03:26Z")

</div>

@Aurelius_Nero I’m using it with F33. There is no rpm available that I know of, but they have good instructions for doing a [manual install](https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md#installation-script). It’s quite easy and fast – I don’t recall running into any issues whatsoever, and I doubt you will either. But I did already have MPICH installed.

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [March 8, 2022, 11:11pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/7 "2022-03-08T23:11:33Z")

</div>

Good to know, thank you @nncarlson. If I recall it well, a few years ago, for environments not having the package in their repos, there was only an option to install from source. I then tried it, it started to compile the whole GCC suite as a prerequisite and never completed.

---

<div class="post-metadata">

**Author:** ![nncarlson](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nncarlson/32/1175_2.png) [@nncarlson](https://fortran-lang.discourse.group/u/nncarlson)\
**Post date:** [March 8, 2022, 11:26pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/8 "2022-03-08T23:26:10Z")

</div>

> [@msz59](#):
>
> I then tried it, it started to compile the whole GCC suite as a prerequisite and never completed.

That sounds like spack 😱, and that may indeed still be the case if you use their `install.sh` script. I went back and looked at what I did, and I actually just cloned the repo and built it following the [advanced instructions](https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md#advanced-installation-from-source) in the section following the one I linked to above (my bad). If you’ve already got CMake and MPICH installed on your system it’s dead easy. “Advanced instructions” sounds scary, but in reality I think it’s the easiest thing if your system is already setup for doing code development.

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 1:13am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/9 "2022-03-09T01:13:44Z")

</div>

@nncarlson I tried installing it and had some problems. Just out of curiosity what was your install path ?

---

<div class="post-metadata">

**Author:** ![nncarlson](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nncarlson/32/1175_2.png) [@nncarlson](https://fortran-lang.discourse.group/u/nncarlson)\
**Post date:** [March 9, 2022, 3:56am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/10 "2022-03-09T03:56:06Z")

</div>

Which installation method did you try? Running `install.sh` or the “advanced” method where you build it from source using cmake? It shouldn’t matter where you install it as long as you have write permission on the directory, and add its `bin` directory to your `PATH`. If you give more details you’re doing (e.g., the commands) and what the error messages are we might be able to help better.

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 4:02am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/11 "2022-03-09T04:02:58Z")

</div>

@nncarlson I basically used the install.sh method. I got not error during the whole process. however when i tried to compile a file using `caf file.f90 -o file` i get an error saying “caf command not found”.

---

<div class="post-metadata">

**Author:** ![nncarlson](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nncarlson/32/1175_2.png) [@nncarlson](https://fortran-lang.discourse.group/u/nncarlson)\
**Post date:** [March 9, 2022, 4:14am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/12 "2022-03-09T04:14:49Z")

</div>

That’s probably an easy fix. Do you know where it is installed? Looking at the script, if you didn’t specify a location with the `--install-prefix` option then it put it in down in a subdirectory `prerequisites/installations/.../.../` of where the `install.sh` script is. (You may want to reinstall and specify a more sensible installation location.) But the solution to your error is to add its `bin` directory to your `PATH` variable so that the `caf` program is found: something like

```auto
export PATH=/<your-opencoarray-install-directory>/bin:$PATH

```

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 10:40am UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/13 "2022-03-09T10:40:38Z")

</div>

@nncarlson i reinstalled into a new directory and i put this command into my terminal but nothing happened (along with the proper path)

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 12:24pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/14 "2022-03-09T12:24:06Z")

</div>

@nncarlson  
I managed to get the files to compile however i get an error when trying to run a file compiled by caf  
However I now get this error when trying to use `cafrun`

```auto
[agnelo@fedora fortran experiment]$ cafrun -n 2 xcoarray
[proxy:0:0@fedora] HYDU_create_process (/home/agnelo/Documents/OpenCoarrays/OpenCoarrays-2.9.2/prerequisites/downloads/mpich-3.2/src/pm/hydra/utils/launch/launch.c:74): execvp error on file xcoarray (No such file or directory)
[proxy:0:0@fedora] HYDU_create_process (/home/agnelo/Documents/OpenCoarrays/OpenCoarrays-2.9.2/prerequisites/downloads/mpich-3.2/src/pm/hydra/utils/launch/launch.c:74): execvp error on file xcoarray (No such file or directory)
Error: Command:
   `/home/agnelo/Documents/OpenCoarrays/OpenCoarrays-2.9.2/prerequisites/installations/mpich/3.2/bin/mpiexec -n 2 xcoarray`
failed to run.
[agnelo@fedora fortran experiment]$ 

```

---

<div class="post-metadata">

**Author:** ![nncarlson](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/nncarlson/32/1175_2.png) [@nncarlson](https://fortran-lang.discourse.group/u/nncarlson)\
**Post date:** [March 9, 2022, 2:24pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/15 "2022-03-09T14:24:19Z")

</div>

Try this instead:

```nohighlight
cafrun -n 2 ./xcoarray

```

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 3:54pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/16 "2022-03-09T15:54:18Z")

</div>

@nncarlson

it works !! Thank you so much !!

---

<div class="post-metadata">

**Author:** ![Aurelius\_Nero](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aurelius\_Nero](https://fortran-lang.discourse.group/u/Aurelius_Nero)\
**Post date:** [March 9, 2022, 11:42pm UTC](https://fortran-lang.discourse.group/t/opencoarrays-in-fedora-workstation-35/2910/17 "2022-03-09T23:42:05Z")

</div>

Thanks to @nncarlson for the solution !  
For anyone else who is wondering, here is what I did:  
step 1:  
Download the latest release along with the sha256 checksum and check the validity of the download.

> **[Release Improved error handling and bug fixes · sourceryinstitute/OpenCoarrays](https://github.com/sourceryinstitute/OpenCoarrays/releases/tag/2.9.2)**
>
> New Functionality
> 
> Improved handling of internal runtime errors (commit 7010d60) 🧹
> 
> Bug Fixes
> 
> \#700: Fixed problem with derived-type coarrays that have nested, allocatable derived-type components a...

Step 2:  
Follow the steps here and install the package in a very specific folder:

> <https://github.com/sourceryinstitute/OpenCoarrays/blob/master/INSTALL.md#installation-script>

Step 3:  
After the installation you need to edit the `.bash_profile` hidden file in your home folder. Where it says “user specific environment and startup programs” add,

```auto
export PATH=/<your-opencoarray-install-directory>/bin:$PATH
source <your-opencoarray-install-directory>/setup.sh

```

Note: The source line should be provided to you at the end of your installation process **DO NOT GLOSS OVER IT**  
step 4: Compile with

```auto
caf <your-file>.f90 -o <output-file-name>

```

Step 5: run with

```auto
cafrun -n (number of threads) ./<output-file-name>

```

note: please take care to include the`./` when trying to run your code.

With all that, mods please feel free to edit if any steps have mistakes in them

Happy parallelization with OpenCoarrays everyone !! And thanks for the help !
