open-mpi.org (#2306)

* open-mpi.org

* test

* autoconf for darwin & MACOSX_DEPLOYMENT_TARGET env

* sed

* CXX & CC

* without sed

* modified:   projects/open-mpi.org/package.yml

* replace hardcoded paths

* wip

* wip

* wip

* OPAL_PREFIX

* make check fails due to unfixed @rpaths

* env

* more env

* try letting it find stuff

* let's see what we can give it

* more flags

* hmmmm

* suggested possibility

* compiler and linker flags

* this shouldn't be linux-only

* gha runs as root

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Andrew 2023-09-07 19:32:16 +03:00 committed by GitHub
parent 3390af6615
commit 8ded6b7ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 148 additions and 0 deletions

View file

@ -0,0 +1,14 @@
#include <mpi.h>
#include <stdio.h>
int main() {
int size, rank, nameLen;
char name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(NULL, NULL);
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);
MPI_Finalize();
return 0;
}

View file

@ -0,0 +1,9 @@
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello Fortran world'
call MPI_FINALIZE(ierror)
end

View file

@ -0,0 +1,9 @@
program hello
use mpi
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello Fortran world'
call MPI_FINALIZE(ierror)
end

View file

@ -0,0 +1,9 @@
program hello
use mpi_f08
integer rank, size, tag, status(MPI_STATUS_SIZE)
call MPI_INIT()
call MPI_COMM_SIZE(MPI_COMM_WORLD, size)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank)
print*, 'node', rank, ': Hello Fortran world'
call MPI_FINALIZE()
end

View file

@ -0,0 +1,107 @@
distributable:
url: https://download.open-mpi.org/release/open-mpi/v{{version.marketing}}/openmpi-{{version}}.tar.bz2
strip-components: 1
versions:
github: open-mpi/ompi/tags
dependencies:
open-mpi.org/hwloc: '*'
libevent.org: '*'
gnu.org/gcc: '*' # for gfortran
gnu.org/inetutils: '*' # for rsh
runtime:
env:
OPAL_PREFIX: "{{prefix}}"
OMPI_CC: gcc
OMPI_CXX: g++
OMPI_FC: gfortran
OMPI_CFLAGS: $CFLAGS
OMPI_CXXFLAGS: $CXXFLAGS
OMPI_FCFLAGS: $FCFLAGS -I{{prefix}}/include
OMPI_CPPFLAGS: $CPPFLAGS
OMPI_LDFLAGS: $LDFLAGS
# OMPI_LIBS: $LIBRARY_PATH
OMPI_F77FLAGS: $FCFLAGS -I{{prefix}}/include
OMPI_F90FLAGS: $FCFLAGS -I{{prefix}}/include
# OMPI_FFLAGS: $OMPI_CFLAGS
# ORTE_CFLAGS: $OMPI_CFLAGS
# ORTE_CXXFLAGS: $OMPI_CFLAGS
# OPAL_CFLAGS: $OMPI_CFLAGS
# OPAL_CXXFLAGS: $OMPI_CFLAGS
# OMPI_LDFLAGS: "-L{{prefix}}/lib"
build:
dependencies:
tea.xyz/gx/make: '*'
script:
- ./configure $CONFIGURE_ARGS
- make --jobs {{ hw.concurrency }} all
- make --jobs {{ hw.concurrency }} install
- run: |
sed -i.bak "s|$TEA_PREFIX|\${pcfiledir}/../../../..|g" ompi-c.pc ompi-cxx.pc ompi-fort.pc ompi.pc orte.pc pmix.pc
rm ./*.bak
working-directory: "{{prefix}}/lib/pkgconfig"
- run: |
sed -i.bak "s|linker_flags=.*|linker_flags=|g" mpic++-wrapper-data.txt mpicc-wrapper-data.txt mpifort-wrapper-data.txt ortecc-wrapper-data.txt
rm ./*.bak
working-directory: "{{prefix}}/share/openmpi"
- install {{prefix}}/lib/*.mod {{prefix}}/include/
env:
CXXFLAGS: -std=c++11
CONFIGURE_ARGS:
- --disable-debug
- --disable-dependency-tracking
- --prefix="{{prefix}}"
- --libdir="{{prefix}}/lib"
- --disable-silent-rules
- --enable-ipv6
- --enable-mca-no-build=reachable-netlink
- --sysconfdir="{{prefix}}/etc"
- --with-libevent="{{deps.libevent.org.prefix}}"
- --with-sge
- --disable-dlopen
provides:
- bin/mpic++
- bin/mpiCC
- bin/mpicc
- bin/mpicxx
- bin/mpiexec
- bin/mpif77
- bin/mpif90
- bin/mpifort
- bin/mpirun
- bin/ompi-clean
- bin/ompi_info
- bin/ompi-server
- bin/opal_wrapper
- bin/ortecc
- bin/orte-clean
- bin/orted
- bin/orte-info
- bin/orterun
- bin/orte-server
test:
dependencies:
freedesktop.org/pkg-config: '*'
script:
- mpicc hello.c -o hello
- ./hello
- mpirun ./hello
- mpifort hellof.f90 -o hellof
- ./hellof
- mpirun ./hellof
- mpifort hellousempi.f90 -o hellousempi
- ./hellousempi
- mpirun ./hellousempi
- mpifort hellousempif08.f90 -o hellousempif08
- ./hellousempif08
- mpirun ./hellousempif08
- pkg-config --modversion ompi
env:
linux/x86-64: # GHA hosts run as root
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1