You are not logged in.

#1 2015-10-22 14:35:40

fyloukira
Member
Registered: 2015-10-22
Posts: 10

FLINT + MPIR in PKGBUILD

Hello,

I would like to install FLINT package with an extra package : MPIR. I should edit PKGBUILD to do so during the installation phase. My problem is the following, flint is already installed as a dependency of many packages (some of them are quite big, e.g. sagemath). Have I to uninstall all these packages? It does not seem a good way to do to me. Is there another way to proceed?

When I try to install it with yaourt, it does not propose to edit PKGBUILD file. For this reason, I ask you for some help.

Have a nice day.

Offline

#2 2015-10-22 19:22:05

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

I'm not sure what you're trying to do, but you can just compile mpir with the --enable-gmpcompat flag and replace gmp with it. It's not a good idea to have both gmp and mpir installed simultaneously, since some programs may link to both and crash due to symbol conflicts

Offline

#3 2015-10-22 19:30:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: FLINT + MPIR in PKGBUILD

Not a Pacman issue, moving to Creating Packages...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2015-10-22 20:18:03

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

arojas wrote:

I'm not sure what you're trying to do, but you can just compile mpir with the --enable-gmpcompat flag and replace gmp with it. It's not a good idea to have both gmp and mpir installed simultaneously, since some programs may link to both and crash due to symbol conflicts

I already compiled  mpir with this flag. The problem is the next step. I dont know how to replace gmp with mpir by using yaourt or pacman. I would like to edit PKGBUILD and specify where MPIR is on my system. For AUR package, the system propose to edit PKGBUILD. For FLINT, it is not the case as the package is contained in [Community]. I wonder if it is possible with yaourt/pacman or if I need to install FLINT manually to use it with MPIR.

Last edited by fyloukira (2015-10-22 20:19:04)

Offline

#5 2015-10-22 20:54:29

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

Add conflicts=(gmp) and provides=(gmp) to the mpir PKGBUILD and install it with pacman. You don't have to rebuild flint, the package from community should work fine.

Offline

#6 2015-10-23 06:53:53

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

I can believe you but I dont really understand why it should work.

If we look to FLINT's PKGBUILD, we have:

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr --with-ntl=/usr
  make
}

According to FLINT's doc, I should replace "--with-gmp" by "--with-mpir"

Offline

#7 2015-10-23 22:36:39

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: FLINT + MPIR in PKGBUILD

In that case, create a new package for your flint version, let's call it flint-mpir .

copy flint PKGBUILD to a flint-mpir folder in your home .
edit the pkgbuild :
change the $pkgname to flint-mpir
add lines so your new packge provides & replaces & conflicts  flint .
run makepkg, solve any errors.
once ready , install your flint-mpir pacakge with pacman -U.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2015-10-24 06:34:00

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

OK this is great, thanks.

If I compile MPIR with the right flag (--enable-gmpcompat) and also with  conflicts=(gmp) and provides=(gmp), it proposes to remove gmp.

GMP is a dependancy of several packages (e.g sagemath).

1) Is it mandatory to remove all of them to build MPIR?
2)  I'd like to compare GMP and MPIR.  It's not possible to have them simultnaeously in a clean way?

Offline

#9 2015-10-24 08:00:27

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

fyloukira wrote:

1) Is it mandatory to remove all of them to build MPIR?

No: that's exactly what the "provides" line is for. MPIR is a drop-in replacement for GMP

fyloukira wrote:

2)  I'd like to compare GMP and MPIR.  It's not possible to have them simultnaeously in a clean way?

It is possible if you don't use --enable-gmpcompat, but as I said not a good idea: You may end up with some binaries linking to both, which will break them. For instance, if you compile Flint against MPIR as you seem to want to do, you will break Sagemath unless you recompile it and all its dependencies against MPIR too.

Offline

#10 2015-10-24 08:19:56

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

arojas wrote:
fyloukira wrote:

1) Is it mandatory to remove all of them to build MPIR?

No: that's exactly what the "provides" line is for. MPIR is a drop-in replacement for GMP

OK but in practice, I try to build MPIR with provides and conflict as indicated and the system asks me to remove gmp. And if I say yes, it cant remove because of all the dependencies.

Offline

#11 2015-10-24 08:28:24

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

fyloukira wrote:

OK but in practice, I try to build MPIR with provides and conflict as indicated and the system asks me to remove gmp. And if I say yes, it cant remove because of all the dependencies.

Please post the full output of the command you use to install mpir and the modified PKGBUILD

Offline

#12 2015-10-26 07:36:47

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

# Maintainer: Joe Neeman <joeneeman@gmail.com>
# Contributor: Rémy Oudompheng <oudomphe@clipper.ens.fr>
# Contributor: Alessandro "jakedust" Andrioni <jakedust@gmail.com>
pkgname=mpir
pkgver=2.7.0
pkgrel=1
pkgdesc="Library for multiple precision integers and rationals"
arch=('i686' 'x86_64')
url="http://www.mpir.org/"
license=('LGPL')
depends=('gcc-libs')
source=(http://www.mpir.org/mpir-$pkgver.tar.lz)
md5sums=('b1d6cd2c6ab8693bb71148c638a07bc7')
install=mpir.install
conflicts=(gmp)
provides=(gmp)

build() {
  cd "$srcdir/mpir-$pkgver"
  [[ "$CARCH" == "i686" ]] && export ABI=32
  ./configure --prefix=/usr --enable-cxx --enable-gmpcompat 
  make
}

check() {
  cd "$srcdir/mpir-$pkgver"
  make check
}

package() {
  cd "$srcdir/mpir-$pkgver"
  make DESTDIR="$pkgdir" install
}

MPIR package is built then I get :

==> Création finie : mpir 2.7.0-1 (lun. oct. 26 08:30:52 CET 2015)

==> Installer mpir ? [O/n]
==> [A]fficher le contenu du paquet [V]érifier avec namcap
==> ------------------------------------------------------
==> 

Mot de passe [sudo] de fyloukira :
chargement des paquets...
résolution des dépendances...
recherche des conflits entre paquets...
:: mpir et gmp sont en conflit. Supprimer gmp ? [o/N] o
erreur: la préparation de la transaction a échoué (la satisfaction des dépendances a échoué)
:: mpfr : requiert gmp>=5.0

Offline

#13 2015-10-26 10:42:42

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

Ah, those stupid versioned dependencies. Use provides=('gmp=6')

Offline

#14 2015-10-26 13:08:02

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

Then, I get:

==> Installer mpir ? [O/n]
==> [A]fficher le contenu du paquet [V]érifier avec namcap
==> ------------------------------------------------------
==> 

Mot de passe [sudo] de fyloukira :
chargement des paquets...
résolution des dépendances...
recherche des conflits entre paquets...

Paquets (1) mpir-2.7.0-1

Taille totale installée :  1,54 MiB

:: Procéder à l’installation ? [O/n] 
(1/1) vérification des clés dans le trousseau                               [##########################################] 100%
(1/1) vérification de l’intégrité des paquets                               [##########################################] 100%
(1/1) chargement des fichiers des paquets                                   [##########################################] 100%
(1/1) analyse des conflits entre fichiers                                   [##########################################] 100%
erreur: la validation de la transaction a échoué (conflit de fichiers)
mpir: /usr/include/gmp.h est déjà présent dans le système de fichiers
mpir: /usr/include/gmpxx.h est déjà présent dans le système de fichiers
mpir: /usr/lib/libgmp.so est déjà présent dans le système de fichiers
mpir: /usr/lib/libgmpxx.so est déjà présent dans le système de fichiers
Des erreurs se sont produites, aucun paquet n’a été mis à jour.

Offline

#15 2015-10-26 14:45:21

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

Did you remove the conflicts?

Offline

#16 2015-10-26 14:45:47

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: FLINT + MPIR in PKGBUILD

Forum Etiguette wrote:

For non-English locale users: Please prepend LC_ALL=C to posted commands so that the output will be in English.

Please change the pkgname from mpir to something like mpir-gpm , so we can distinguish between stock mpir and your version.

Also please post the exact command you use to build/install and it's FULL output.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#17 2015-10-26 14:49:12

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

I kept the line conflicts=('gmp=6') in PKGBUILD.

GMP is already installed and the system warns me there are GMP dependencies thus I cant remove directly GMP.

Offline

#18 2015-10-26 14:55:19

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: FLINT + MPIR in PKGBUILD

fyloukira wrote:

I kept the line conflicts=('gmp=6') in PKGBUILD.

Wrong, 'gmp=6' should be only in provides, not in conflicts.

conflicts=(gmp)
provides=('gmp=6')

Offline

#19 2015-10-26 15:03:55

fyloukira
Member
Registered: 2015-10-22
Posts: 10

Re: FLINT + MPIR in PKGBUILD

This works fine. Thanks to everybody and sorry for last misreading. :-)

Offline

Board footer

Powered by FluxBB