[mpich2-dev] shared-lib builds, MPE, and SELinux en ENFORCING mode
Dave Goodell
goodell at mcs.anl.gov
Thu May 21 10:07:51 CDT 2009
Solution (2) that you outlined below is planned, we just haven't
implemented it yet. I believe that this is being tracked by ticket
#573 [1]. In the mean time, does putting "-fPIC" in your CFLAGS serve
as solution (1)?
-Dave
[1] https://trac.mcs.anl.gov/projects/mpich2/ticket/573
On May 21, 2009, at 9:45 AM, Lisandro Dalcin wrote:
> Just built 1.1rc1 with shared libraries, and then tried to build
> mpi4py's Python extension module (a dlpen()'able shared lib) with MPE
> (by passing -mpi=mpilog to mpicc). When I try to import my extension
> module, I get:
>
> $ python
>>>> from mpi4py import MPI
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: /u/dalcinl/lib/python/mpi4py/MPI.so: cannot restore
> segment prot after reloc: Permission denied
>>>>
>
> This happens because I have SELinux enabled in ENFORCING and because
> the MPE sources were not compiled with -fPIC
>
> $ eu-findtextrel /u/dalcinl/lib/python/mpi4py/MPI.so
> /u/dalcinl/BUILD/MPI/mpich2-1.1rc1/src/mpe2/src/wrappers/src/
> log_mpi_core.c
> not compiled with -fpic/-fPIC
> <...more-output...>
>
> and then my "MPI.so" extension module requires relocation on loading
> (and this is prohibited by SELinux in ENFORCING mode).
>
> This could be solved (apart from asking me to use "chcon -t
> texrel_shlib_t ...") by two ways:
>
> 1) Use -fPIC for compiling the MPE sources, but continue building the
> MPE libs as static ones.
> 2) Also build shared libs for MPE.
>
> (1) is easy and definitely works on Linux, though I do not know if
> this is valid on other systems.
> (2) is the definitive solution, but perhaps a bit harder to implement
> because of the required modifications to MPICH2's buildsystem.
>
>
>
> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
More information about the mpich2-dev
mailing list