You are not logged in.

#1 2011-04-24 02:42:23

ytj
Member
Registered: 2010-11-14
Posts: 24

[SOLVED]Doesn't openmpi work when called by fakeroot?

I found that I can't use mpicc when I was writing a PKGBUILD.
It seems that the mpicc doesn't work under fakeroot.
Here is a simple PKGBUILD show how it's happened.

pkgname=Testing-openmpi-on-fakeroot
pkgver=1337
pkgrel=42
arch=('i686' 'x86_64')
makedepends=('openmpi')
build() {
    mpicc --help
}

Later, I found that I couldn't even run this simple command on my machine.

fakeroot mpicc --help

Another example shows makepkg was unable to achieve coherence.

pkgbase=More_Testing_mpicc
pkgname=('Testing_mpicc_example')
pkgver=x86
pkgrel=64
arch=('i686')
makedepends=('openmpi')
build() {
    mpicc --help  # ok: it works.
}
package_Testing_mpicc_example() {
    mpicc --help  # error: called by fakeroot.
}

Won't that fail to run, or am I missing something?

Some information:
pacman 3.5.2-1
openmpi 1.5.3-2
gcc 4.6.0-3
fakeroot 1.15.1-1
Linux 2.6.38.3-1

Last edited by ytj (2011-04-24 07:11:59)

Offline

#2 2011-04-24 07:11:33

ytj
Member
Registered: 2010-11-14
Posts: 24

Re: [SOLVED]Doesn't openmpi work when called by fakeroot?

There is a way to avoid this issue. Don't put everything in build().
Split the install part to package().
Then the makepkg will enter fakeroot after build() finished.

pkgname=Final-test-openmpi-on-fakeroot
pkgver=9527
pkgrel=101010
arch=('i686' 'x86_64')
makedepends=('openmpi')
build() {
    mpicc --help  # ok: now this works.
}
package() {
    mkdir $pkgdir/tmp
    # Install something.
}

Offline

#3 2011-06-15 16:57:10

wizzrobe
Member
Registered: 2007-03-22
Posts: 6

Re: [SOLVED]Doesn't openmpi work when called by fakeroot?

I can confirm this fixes the problem.

Thanks ytj, you just saved me a lot of headache!

Offline

Board footer

Powered by FluxBB