diff mbox series

[bug#68682] gnu: maths: arpack-ng: Modify build settings.

Message ID 4284df7d0499bb5b6a46d29d6e7f858fd3baa896.1706085982.git.romain.garbage@inria.fr
State New
Headers show
Series [bug#68682] gnu: maths: arpack-ng: Modify build settings. | expand

Commit Message

Romain GARBAGE Jan. 24, 2024, 8:46 a.m. UTC
* gnu/packages/maths.scm (arpack-ng): Add configure flags for building
  the shared library and the iso C bindings.

Change-Id: Iddfd67094ffafc3cabd88353e3839e5e903b804a
---
 gnu/packages/maths.scm | 2 ++
 1 file changed, 2 insertions(+)


base-commit: e3f4ab49b1b756d3356b142db935b684e6877346

Comments

Andreas Enge Jan. 24, 2024, 2:04 p.m. UTC | #1
Hello Romain,

Am Wed, Jan 24, 2024 at 09:46:22AM +0100 schrieb Romain GARBAGE:
> * gnu/packages/maths.scm (arpack-ng): Add configure flags for building
>   the shared library and the iso C bindings.

thanks for sending the patch!

I see that the ISO C binding flag installs additional headers, but I do not
see why the flag for building shared libraries would be needed. In the current
arpack-ng, there is already a shared library in the lib/ subdirectory.

Could you explain how adding the flag makes a difference?

Andreas

PS: Concerning the commit message, we usually do not mention the module
    and just start by "gnu: arpack-ng:" without "maths:".
Andreas Enge Jan. 24, 2024, 2:07 p.m. UTC | #2
PPS: There is a new minor version 3.9.1, maybe we could take the opportunity
     that the QA build farm will build out all dependencies to update in
     a separate commit with a patchset attached to this bug.
Ludovic Courtès Jan. 24, 2024, 2:51 p.m. UTC | #3
Hi!  :-)

Andreas Enge <andreas@enge.fr> skribis:

> I see that the ISO C binding flag installs additional headers, but I do not
> see why the flag for building shared libraries would be needed. In the current
> arpack-ng, there is already a shared library in the lib/ subdirectory.
>
> Could you explain how adding the flag makes a difference?

The goal should be to build shared libraries only.  If that’s already
happening without passing ‘-DBUILD_SHARED_LIBS=ON’, I agree we can drop
it, in an effort to keep the package definition minimal.

Romain, could you confirm that ‘-DBUILD_SHARED_LIBS=ON’ is indeed
unnecessary and send a new version without it if it is?

Thanks,
Ludo’.
Romain GARBAGE Jan. 24, 2024, 4:04 p.m. UTC | #4
Hello :)

----- Mail original -----
> De: "Ludovic Courtes" <ludovic.courtes@inria.fr>
> À: "Andreas Enge" <andreas@enge.fr>
> Cc: "Romain Garbage" <romain.garbage@inria.fr>, "Eric Bavier" <bavier@posteo.net>, "Sharlatan Hellseher"
> <sharlatanus@gmail.com>, 68682@debbugs.gnu.org, "Efraim Flashner" <efraim@flashner.co.il>
> Envoyé: Mercredi 24 Janvier 2024 14:51:52
> Objet: Re: [bug#68682] [PATCH] gnu: maths: arpack-ng: Modify build settings.

> Hi!  :-)
> 
> Andreas Enge <andreas@enge.fr> skribis:
> 
>> I see that the ISO C binding flag installs additional headers, but I do not
>> see why the flag for building shared libraries would be needed. In the current
>> arpack-ng, there is already a shared library in the lib/ subdirectory.
>>
>> Could you explain how adding the flag makes a difference?
> 
> The goal should be to build shared libraries only.  If that’s already
> happening without passing ‘-DBUILD_SHARED_LIBS=ON’, I agree we can drop
> it, in an effort to keep the package definition minimal.
> 
> Romain, could you confirm that ‘-DBUILD_SHARED_LIBS=ON’ is indeed
> unnecessary and send a new version without it if it is?

I built the package with and without '-DBUILD_SHARED_LIBS=ON' and compared the outputs:
```
$ diff -r /gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0 /gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0
Binary files /gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/lib/libarpack.so and /gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/lib/libarpack.so differ
Binary files /gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/lib/libarpack.so.2 and /gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/lib/libarpack.so.2 differ
Binary files /gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/lib/libarpack.so.2.1.0 and /gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/lib/libarpack.so.2.1.0 differ
diff -r /gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/lib/pkgconfig/arpack.pc /gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/lib/pkgconfig/arpack.pc
1c1
< prefix=/gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0
---
> prefix=/gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0
3,4c3,4
< libdir=/gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/lib
< includedir=/gnu/store/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng-3.9.0/include/arpack-ng
---
> libdir=/gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/lib
> includedir=/gnu/store/5hbj4pza16d0vbmam0rmyx5h6z50fgqi-arpack-ng-3.9.0/include/arpack-ng

$  diff -u /tmp/*arpack-ng # these files contain the output of 'ldd /gnu/store/*arpack-ng/lib/libarpack.so'
+++ /tmp/wsx55w6bbak6sa3g6c8lwm3bliipkhy1-arpack-ng	2024-01-24 16:53:44.805910227 +0100
@@ -1,9 +1,9 @@
-	linux-vdso.so.1 (0x00007ffe84d4b000)
-	libblas.so.3 => /gnu/store/p34bwhh7lb9lsa8vd5w7bs5v599iayag-lapack-3.9.0/lib/libblas.so.3 (0x00007f9208982000)
-	liblapack.so.3 => /gnu/store/p34bwhh7lb9lsa8vd5w7bs5v599iayag-lapack-3.9.0/lib/liblapack.so.3 (0x00007f9208200000)
-	libgfortran.so.5 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libgfortran.so.5 (0x00007f9207e00000)
-	libm.so.6 => /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/libm.so.6 (0x00007f92088a5000)
-	libgcc_s.so.1 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libgcc_s.so.1 (0x00007f92081e6000)
-	libquadmath.so.0 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libquadmath.so.0 (0x00007f920819d000)
-	libc.so.6 => /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/libc.so.6 (0x00007f9207c04000)
-	/gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/ld-linux-x86-64.so.2 (0x00007f9208a22000)
+	linux-vdso.so.1 (0x00007ffdb2fb5000)
+	libblas.so.3 => /gnu/store/p34bwhh7lb9lsa8vd5w7bs5v599iayag-lapack-3.9.0/lib/libblas.so.3 (0x00007f0e9f582000)
+	liblapack.so.3 => /gnu/store/p34bwhh7lb9lsa8vd5w7bs5v599iayag-lapack-3.9.0/lib/liblapack.so.3 (0x00007f0e9ee00000)
+	libgfortran.so.5 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libgfortran.so.5 (0x00007f0e9ea00000)
+	libm.so.6 => /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/libm.so.6 (0x00007f0e9f4a5000)
+	libgcc_s.so.1 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libgcc_s.so.1 (0x00007f0e9ede6000)
+	libquadmath.so.0 => /gnu/store/ldkp6a8cpl35vfs8bgnirhw12f76q414-gfortran-11.3.0-lib/lib/libquadmath.so.0 (0x00007f0e9ed9d000)
+	libc.so.6 => /gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/libc.so.6 (0x00007f0e9e804000)
+	/gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/ld-linux-x86-64.so.2 (0x00007f0e9f622000)
```

To me, it doesn't seem that the '-DBUILD_SHARED_LIBS=ON' option is necessary, but I might miss something.

What do you think?

Cheers,
Romain
Andreas Enge Jan. 24, 2024, 4:21 p.m. UTC | #5
Am Wed, Jan 24, 2024 at 05:04:50PM +0100 schrieb Romain Garbage:
> To me, it doesn't seem that the '-DBUILD_SHARED_LIBS=ON' option is necessary, but I might miss something.
> What do you think?

I agree it is not necessary; in Changes concerning arpack-ng 3.8.0:
 * Only build shared libraries by default.  To build static libraries, use
   --enable-static (autotools) or -DBUILD_SHARED_LIBS=OFF (cmake).

I will send a modified patch to this bug, and although I think this change
is completely harmless, I would suggest to let QA build the dependent
packages before applying it.

Andreas
Andreas Enge Feb. 14, 2024, 1:54 p.m. UTC | #6
Indeed the package and its dependencies are fine on most architectures,
just i686 lags behind on QA. So I have just pushed the patch. Thanks!

Andreas
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ada828cb3f..7d92dbcdaf 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1064,6 +1064,8 @@  (define-public arpack-ng
                 "09smxilyn8v9xs3kpx3nlj2s7ql3v8z40mpc09kccbb6smyd35iv"))
               (patches (search-patches "arpack-ng-propagate-rng-state.patch"))))
     (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON" "-DICB=ON")))
     (native-inputs
      (list pkg-config))
     (inputs