Skip to content

Commit

Permalink
open-mpi: avoid conflict with putty
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Dec 28, 2024
1 parent aa2d07c commit b68d071
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Formula/o/open-mpi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,19 @@ def install

# Avoid references to cellar paths.
inreplace (lib/"pkgconfig").glob("*.pc"), prefix, opt_prefix, audit_result: false

# Avoid conflict with PuTTY similar to Arch Linux[^1]. May be able to remove with PRRTE v4[^2]
#
# [^1]: https://gitlab.archlinux.org/archlinux/packaging/packages/prrte/-/blob/main/PKGBUILD?ref_type=heads#L98
# [^2]: https://github.com/openpmix/prrte/issues/1836
(libexec/"bin").install bin/"pterm"
(libexec/"man/man1").install man1/"pterm.1"
bin.install_symlink libexec/"bin/pterm" => "prrte-pterm"
man1.install_symlink libexec/"man/man1/pterm.1" => "prrte-pterm.1"
end

test do
(testpath/"hello.c").write <<~C
(testpath/"hello.c").write <<~'C'
#include <mpi.h>
#include <stdio.h>
Expand All @@ -97,7 +106,7 @@ def install
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(name, &nameLen);
printf("[%d/%d] Hello, world! My name is %s.\\n", rank, size, name);
printf("[%d/%d] Hello, world! My name is %s.\n", rank, size, name);
MPI_Finalize();
return 0;
}
Expand Down

0 comments on commit b68d071

Please sign in to comment.