#29071 closed defect (fixed)

verify if cblas.pc and lapack.pc should be replaced by links to openblas.pc

Reported by: dimpase Owned by:
Priority: major Milestone: sage-9.1
Component: build: configure Keywords:
Cc: isuruf, mkoeppe, arojas Merged in:
Authors: Dima Pasechnik Reviewers: Isuru Fernando, Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 3a4524e (Commits, GitHub, GitLab) Commit: 3a4524e4c82840fb023a0fd2af83d0a1c65292cd
Dependencies: #29051 Stopgaps:

Status badges

Description

currently openblas's spkg-configure.pc unconditionally makes cblas.pc and lapack.pc copies of openblas.pc, which in some cases if incorrect, e.g. Arch Linux has libcblas linked to libopenblas and containing stuff missing in libopenblas, resulting in errors.

this has been reported on sage-devel https://groups.google.com/d/msg/sage-devel/pIOnFyFJMtM/_FbzM2OxCQAJ

So we should make these installations conditional.

Attachments (2)

vdelecroix-29071-fflas_ffpack-2.4.3.log (107.5 KB) - added by vdelecroix 20 months ago.
vdelecroix-29071-config.log (187.3 KB) - added by vdelecroix 20 months ago.

Download all attachments as: .zip

Change History (88)

comment:1 Changed 20 months ago by dimpase

  • Cc isuruf mkoeppe added

It depends on the fortran name mangling. For gfortran, one symbol would be dgeqrf_.

we can do an AC_LINK_IFELSE() test with a subroutine dgeqef call, and try to link it against libopenblas. this would be independent of Fortran compiler.

http://www.netlib.org/lapack/explore-html/df/dc5/group__variants_g_ecomputational_ga3766ea903391b5cf9008132f7440ec7b.html

Last edited 20 months ago by dimpase (previous) (diff)

comment:2 Changed 20 months ago by dimpase

  • Cc arojas added

And for cblas we can do AC_CHECK_LIB() on cblas_dgemm, as Antonio proposed.

comment:3 follow-up: Changed 20 months ago by isuruf

You can also use AC_FC_FUNC to get the mangled name.

comment:4 in reply to: ↑ 3 Changed 20 months ago by dimpase

Replying to isuruf:

You can also use AC_FC_FUNC to get the mangled name.

OK, that's better, thanks.

comment:5 Changed 20 months ago by dimpase

  • Authors set to Dima Pasechnik
  • Branch set to u/dimpase/packages/openblaspcfix
  • Commit set to ccc5d82e586569f764c9fcdffb0d4aab9a7e1e04
  • Status changed from new to needs_review

needs testing on Arch in particular.


New commits:

ccc5d82install cblas.pc and lapack.pc links conditionally

comment:6 Changed 20 months ago by vdelecroix

trying now on arch

comment:7 Changed 20 months ago by git

  • Commit changed from ccc5d82e586569f764c9fcdffb0d4aab9a7e1e04 to f6714fb778558136095fd9a8d61b86da1d744160

Branch pushed to git repo; I updated commit sha1. New commits:

f6714fbuse AC_SEARCH_LIBS

comment:8 Changed 20 months ago by vdelecroix

With the branch applied, I end up with the same permission issues as with ./configure --without-system-openblas. That is to say

Copying package files from temporary location /opt/sage/local/var/tmp/sage/build/openblas-0.3.6.p0/inst to /opt/sage/local
cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/blas.pc': Permission denied
cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/cblas.pc': Permission denied
cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/lapack.pc': Permission denied

comment:9 Changed 20 months ago by dimpase

Is /opt/sage/local your $SAGE_LOCAL? If so, could you try rm -rf /opt/sage/local/pkgconfig/ ?

comment:10 Changed 20 months ago by dimpase

sorry, I meant rm -rf /opt/sage/local/lib/pkgconfig/

comment:11 Changed 20 months ago by dimpase

even more precisely, rm -f /opt/sage/local/lib/pkgconfig/*blas.pc && rm -f /opt/sage/local/lib/pkgconfig/lapack.pc

comment:12 Changed 20 months ago by dimpase

I presume you get permission problems while running make. This is due to #29003 - where the installation of these is done somewhat carelessly.

comment:13 Changed 20 months ago by git

  • Commit changed from f6714fb778558136095fd9a8d61b86da1d744160 to 7ac129319552ce341bf5f827f378fd43e95d7315

Branch pushed to git repo; I updated commit sha1. New commits:

7ac1293added missing module names - cblas and lapack

comment:14 follow-up: Changed 20 months ago by vdelecroix

When I do make distclean it does remove local entirely. At which step do you want me to try rm XXX?

comment:15 Changed 20 months ago by dimpase

the logic of this branch is still not 100% correct - if we end up installing OpenBLAS we should not install any *.pc files, i.e. should not run any AC_CONFIG_LINKS.

comment:16 in reply to: ↑ 14 Changed 20 months ago by dimpase

Replying to vdelecroix:

When I do make distclean it does remove local entirely. At which step do you want me to try rm XXX?

these rm from comment:11 should be run after ./configure and before make, assuming I understand what's going on.

comment:17 Changed 20 months ago by dimpase

By the way, please pull the branch again - comment:13 is rather important for Arch.

comment:18 Changed 20 months ago by vdelecroix

After ./configure there is no directory local/lib/pkgconfig/

$ ls -R local/
local/:
bin  etc  include  lib  lib64  share  var

local/bin:

local/etc:

local/include:

local/lib:

local/share:

local/var:
lib

local/var/lib:
sage

local/var/lib/sage:
installed

local/var/lib/sage/installed:

comment:19 Changed 20 months ago by dimpase

local/lib/pkgconfig/ may or may not be present, it depends upon the state of the system. (e.g. if you did make distclean before ./configure you won't have local/ at all)

Now, what happens if you run make? Do you still get the same error?

comment:20 Changed 20 months ago by dimpase

It seems I got Arch running in an lxc container, so I guess I can polish it on my own.

comment:21 Changed 20 months ago by git

  • Commit changed from 7ac129319552ce341bf5f827f378fd43e95d7315 to 16b4d9d74aa9217253f12ad8cd3b3d7dd48323c5

Branch pushed to git repo; I updated commit sha1. New commits:

16b4d9dmake installing *.pc files conditional

comment:22 Changed 20 months ago by git

  • Commit changed from 16b4d9d74aa9217253f12ad8cd3b3d7dd48323c5 to 29414110c7d0e6880774aa327948ce6bb4528ed1

Branch pushed to git repo; I updated commit sha1. New commits:

2941411correct quoting of m4 index variable

comment:23 Changed 20 months ago by dimpase

with this last commit appears to work on Arch, all the way to the point of a broken scipy build - cf #29051.

Version 0, edited 20 months ago by dimpase (next)

comment:24 follow-up: Changed 20 months ago by isuruf

If I'm reading the code correctly openblas.pc is not copied to blas.pc right in the Arch Linux case right?

comment:25 in reply to: ↑ 24 Changed 20 months ago by dimpase

Replying to isuruf:

If I'm reading the code correctly openblas.pc is not copied to blas.pc right in the Arch Linux case right?

it is copied (i.e. blas.pc becomes a link to openblas.pc), but on Arch it makes no difference, as they are also like this on the system

[dimpase@arch]$ file /usr/lib/pkgconfig/blas.pc 
/usr/lib/pkgconfig/blas.pc: symbolic link to openblas.pc

comment:26 Changed 20 months ago by isuruf

  • Reviewers set to Isuru Fernando
  • Status changed from needs_review to positive_review

Thanks. I misread the code

comment:27 follow-up: Changed 20 months ago by dimpase

with this branch, reverting #29025 makes everything work on Arch (also with OpenBLAS, gsl, R, etc from the system)

comment:28 Changed 20 months ago by vdelecroix

Does not work on my arch... At commit 2941411, the build of fflas-ffpack failed with

../../../fflas-ffpack/fflas/fflas_fassign.inl: In function 'void FFLAS::fassign(const Field&, size_t, typename Field::ConstElement_ptr, size_t, typename Field::Element_ptr, size_t) [with Field = Givaro::Modular<f
loat>; size_t = long unsigned int; typename Field::ConstElement_ptr = const float*; typename Field::Element_ptr = float*]':
../../../fflas-ffpack/fflas/fflas_fassign.inl:75:9: error: 'openblas_set_num_threads' was not declared in this scope; did you mean 'omp_set_num_threads'?
   75 |         openblas_set_num_threads(__FFLASFFPACK_OPENBLAS_NUM_THREADS);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
      |         omp_set_num_threads
Last edited 20 months ago by vdelecroix (previous) (diff)

comment:29 follow-up: Changed 20 months ago by vdelecroix

(trying now with ./configure --without-system-openblas)

comment:30 in reply to: ↑ 29 Changed 20 months ago by vdelecroix

Replying to vdelecroix:

(trying now with ./configure --without-system-openblas)

In the above situation, make fails at building openblas with the same as usual

cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/blas.pc': Permission denied
cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/cblas.pc': Permission denied
cp: cannot create regular file '/opt/sage/local/./lib/pkgconfig/lapack.pc': Permission denied

comment:31 follow-up: Changed 20 months ago by vbraun

  • Status changed from positive_review to needs_work

That breaks configure if there is no system-wide fortran:

checking for Fortran libraries of ... 
checking for dummy main to link with Fortran libraries... none
configure: error: in `/Users/buildbot-sage/slave/sage_git/build':
configure: error: cannot compile a simple Fortran program
See `config.log' for more details
checking for Fortran name-mangling scheme... If you would like to try to build Sage anyway (to help porting),
export the variable 'SAGE_PORT' to something non-empty.
make[1]: *** [build/make/Makefile] Error 1
make: *** [base-toolchain] Error 2
make: Target `start' not remade because of errors.

comment:32 in reply to: ↑ 31 Changed 20 months ago by dimpase

Replying to vbraun:

That breaks configure if there is no system-wide fortran:

good catch - so the gfortran is a dependency here.

But this also applies to many spkg-configure.m4 tests that use a C++ compiler to run tests.

comment:33 Changed 20 months ago by dimpase

by right, C, C++, and Fortran compilers are pre-reqs for many spkg-configure.m4 tests, as testing with one compiler and then build another compiler and use it is dodgy.

comment:34 in reply to: ↑ 27 ; follow-up: Changed 20 months ago by arojas

Replying to dimpase:

with this branch, reverting #29025 makes everything work on Arch (also with OpenBLAS, gsl, R, etc from the system)

I can confirm, thank you. Vincent, can you post the config log of the failed fflas-ffpack build?

comment:35 Changed 20 months ago by dimpase

  • Dependencies set to #29051

Changed 20 months ago by vdelecroix

comment:36 in reply to: ↑ 34 ; follow-up: Changed 20 months ago by vdelecroix

Replying to arojas:

Replying to dimpase:

with this branch, reverting #29025 makes everything work on Arch (also with OpenBLAS, gsl, R, etc from the system)

I can confirm, thank you. Vincent, can you post the config log of the failed fflas-ffpack build?

Here they are

comment:37 in reply to: ↑ 36 ; follow-up: Changed 20 months ago by arojas

Replying to vdelecroix:

Replying to arojas:

Replying to dimpase:

with this branch, reverting #29025 makes everything work on Arch (also with OpenBLAS, gsl, R, etc from the system)

I can confirm, thank you. Vincent, can you post the config log of the failed fflas-ffpack build?

Here they are

I think your issue is caused by the same .pc stale symlinks that are making the build fail with sage's openblas. fflas-ffpack's spkg-install has LINBOX_BLAS="$(pkg-config --libs cblas)", which should return -lcblas on Arch, but it is returning -lopenblas for you. The only reason I can think of is those symlinks. Can you delete them and try again?

comment:38 in reply to: ↑ 37 Changed 20 months ago by vdelecroix

Replying to arojas:

Replying to vdelecroix:

Replying to arojas:

Replying to dimpase:

with this branch, reverting #29025 makes everything work on Arch (also with OpenBLAS, gsl, R, etc from the system)

I can confirm, thank you. Vincent, can you post the config log of the failed fflas-ffpack build?

Here they are

I think your issue is caused by the same .pc stale symlinks that are making the build fail with sage's openblas. fflas-ffpack's spkg-install has LINBOX_BLAS="$(pkg-config --libs cblas)", which should return -lcblas on Arch, but it is returning -lopenblas for you. The only reason I can think of is those symlinks. Can you delete them and try again?

Indeed

(sage-sh)$ pkg-config --libs cblas
-lopenblas 
(sage-sh) vincent@mangouste:sage$ rm local/lib/pkgconfig/cblas.pc 
(sage-sh) vincent@mangouste:sage$ rm local/lib/pkgconfig/blas.pc 
(sage-sh) vincent@mangouste:sage$ pkg-config --libs cblas
-lcblas 

I just relaunched make after that...

comment:39 Changed 20 months ago by git

  • Commit changed from 29414110c7d0e6880774aa327948ce6bb4528ed1 to 508ac7cd7400a8302a5bf3fcb8f18672415cbb4f

Branch pushed to git repo; I updated commit sha1. New commits:

508ac7censure gfortran is available

comment:40 Changed 20 months ago by dimpase

  • Status changed from needs_work to needs_review

fixed the issue in comment:31

comment:41 follow-ups: Changed 20 months ago by arojas

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

Dima, do you want to include this change here or should I open a new ticket?

Last edited 20 months ago by arojas (previous) (diff)

comment:42 in reply to: ↑ 41 Changed 20 months ago by dimpase

Replying to arojas:

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

Dima, do you want to include this change here or should I open a new ticket?

let's do a new ticket, as this is a rather different issue.

comment:43 in reply to: ↑ 41 ; follow-up: Changed 20 months ago by vdelecroix

Replying to arojas:

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

On my machine I got

(sage-sh)$ pkg-config --libs blas cblas
-lopenblas 

comment:44 in reply to: ↑ 43 ; follow-ups: Changed 20 months ago by vdelecroix

Replying to vdelecroix:

Replying to arojas:

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

On my machine I got

(sage-sh)$ pkg-config --libs blas cblas
-lopenblas 

The above is coherent with the symlinks provided in Sage

(sage-sh)$ ls -l local/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 11:54 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

But not with what I have in /usr/lib/pkgconfig/

$ ls -l /usr/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 root root   11 20 août  12:35 blas.pc -> openblas.pc
-rw-r--r-- 1 root root  256 24 nov.  11:43 cblas.pc
-rw-r--r-- 1 root root  497 20 août  12:35 openblas.pc
Last edited 20 months ago by vdelecroix (previous) (diff)

comment:45 in reply to: ↑ 44 Changed 20 months ago by arojas

Replying to vdelecroix:

Replying to vdelecroix:

Replying to arojas:

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

On my machine I got

(sage-sh)$ pkg-config --libs blas cblas
-lopenblas 

The above is coherent with the symlinks provided in Sage

(sage-sh)$ ls -l local/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 11:54 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

But not with what I have in /usr/lib/pkgconfig/

$ ls -l /usr/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 root root   11 20 août  12:35 blas.pc -> openblas.pc
-rw-r--r-- 1 root root  256 24 nov.  11:43 cblas.pc
-rw-r--r-- 1 root root  497 20 août  12:35 openblas.pc

Those links are no longer created on Arch, that's the point of this ticket

comment:46 in reply to: ↑ 44 Changed 20 months ago by vdelecroix

Replying to vdelecroix:

Replying to vdelecroix:

Replying to arojas:

The fact that LINBOX_BLAS is set to -lcblas on Arch makes fflas-ffpack not detect openblas (since -lcblas doesn't provide openblas_set_num_threads), so it is compiled without openblas optimizations.

To fix this, LINBOX_BLAS="$(pkg-config --libs cblas)" should be replaced with LINBOX_BLAS="$(pkg-config --libs blas cblas)" in fflas-ffpack's spkg-install, which would return -lopenblas -lcblas on Arch and wouldn't make any difference on systems where openblas provides cblas

On my machine I got

(sage-sh)$ pkg-config --libs blas cblas
-lopenblas 

The above is coherent with the symlinks provided in Sage

(sage-sh)$ ls -l local/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 12:25 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 11:54 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

But not with what I have in /usr/lib/pkgconfig/

$ ls -l /usr/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 root root   11 20 août  12:35 blas.pc -> openblas.pc
-rw-r--r-- 1 root root  256 24 nov.  11:43 cblas.pc
-rw-r--r-- 1 root root  497 20 août  12:35 openblas.pc

Removing the symlinks and setting them according to what is in /usr/lib seems to fix the issue

$ rm /opt/sage/local/lib/pkgconfig/blas.pc /opt/sage/local/lib/pkgconfig/cblas.pc
$ ln -s /usr/lib/pkgconfig/blas.pc /opt/sage/local/lib/pkgconfig/
$ ln -s /usr/lib/pkgconfig/cblas.pc /opt/sage/local/lib/pkgconfig/

comment:47 Changed 20 months ago by vdelecroix

After a make distclean and standing at commit 508ac7c I see the same problem

$ ls -l /opt/sage/local/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:02 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:02 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:02 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

comment:48 Changed 20 months ago by dimpase

have you run ./bootstrap && ./configure ? If yes, please post config.log (as attachement)

comment:49 Changed 20 months ago by dimpase

Wait, why do you do these:

$ ln -s /usr/lib/pkgconfig/blas.pc /opt/sage/local/lib/pkgconfig/
$ ln -s /usr/lib/pkgconfig/cblas.pc /opt/sage/local/lib/pkgconfig/

?

This could only break stuff, if you do it after make distclean.

comment:50 Changed 20 months ago by vdelecroix

After make distclean, ./bootstrap, ./configure the build still fails at fflas-ffpack with the same

error: 'openblas_set_num_threads' was not declared in this scope; did you mean 'omp_set_num_threads'?

Also the blas symlinks are still pointing to openblas

$ ls -l local/lib/pkgconfig/ | grep blas
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:12 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:12 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:12 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

Changed 20 months ago by vdelecroix

comment:51 Changed 20 months ago by dimpase

Please also make sure there is nothing in src/lib/pkgconfig before running ./configure. After running ./configure on Arch it should look like

$ ls src/lib/pkgconfig/
blas.pc  gsl.pc

You could have these stale stuff from older versions of this ticket or even before.

comment:52 Changed 20 months ago by vdelecroix

Here is config.log

comment:53 Changed 20 months ago by vdelecroix

Indeed

$ ls -l src/lib/pkgconfig/
total 4
lrwxrwxrwx 1 vincent vincent  30 26 janv. 14:12 blas.pc -> /usr/lib/pkgconfig/openblas.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 11:51 cblas.pc -> /usr/lib/pkgconfig/openblas.pc
-rw-r--r-- 1 vincent vincent 200 26 janv. 14:12 gsl.pc
lrwxrwxrwx 1 vincent vincent  30 26 janv. 11:51 lapack.pc -> /usr/lib/pkgconfig/openblas.pc

comment:54 Changed 20 months ago by vdelecroix

Why isn't src/lib/pkgconfig properly cleaned?

comment:55 follow-up: Changed 20 months ago by dimpase

I agree that src/lib/pkgconfig should be properly cleaned, you are right. Perhaps by make distclean?

comment:56 in reply to: ↑ 55 ; follow-up: Changed 20 months ago by vdelecroix

Replying to dimpase:

I agree that src/lib/pkgconfig should be properly cleaned, you are right. Perhaps by make distclean?

That make distclean removes src/lib/pkgconfig entirely would make sense to me.

comment:57 Changed 20 months ago by vdelecroix

After removing src/lib/pkgconfig the build fflas-ffpack succeeded! Thank you.

comment:58 in reply to: ↑ 56 ; follow-up: Changed 20 months ago by dimpase

Replying to vdelecroix:

Replying to dimpase:

I agree that src/lib/pkgconfig should be properly cleaned, you are right. Perhaps by make distclean?

That make distclean removes src/lib/pkgconfig entirely would make sense to me.

I've opened a blocker #29082 to deal with cleaning of these files, sorry for this mess.

comment:59 in reply to: ↑ 58 Changed 20 months ago by vdelecroix

Replying to dimpase:

Replying to vdelecroix:

Replying to dimpase:

I agree that src/lib/pkgconfig should be properly cleaned, you are right. Perhaps by make distclean?

That make distclean removes src/lib/pkgconfig entirely would make sense to me.

I've opened a blocker #29082 to deal with cleaning of these files, sorry for this mess.

You did more good than bad :-) It is quite nice to have Sage using the libraries from the system!

comment:60 Changed 20 months ago by dimpase

Please also don't forget that you'll need (an equivalent of) #29051 to make the build succeed (without it scipy will fail).

comment:61 Changed 20 months ago by mkoeppe

  • Branch changed from u/dimpase/packages/openblaspcfix to u/mkoeppe/packages/openblaspcfix

comment:62 Changed 20 months ago by mkoeppe

  • Commit changed from 508ac7cd7400a8302a5bf3fcb8f18672415cbb4f to 2be29056cf55bd19730fffdb69a6814885bc9c54

I have merged in #29051 and current beta.


New commits:

9d1770arevert #29025, remove useless [ALL] section
dba7aefrevert from "libraries=" back to section-specific "BLAH_libs="
fe4a67eMerge branch 'public/packages/numpy/no_DEFAULT_and_ALL_numpy_site_cfg' of git://trac.sagemath.org/sage into t/29071/packages/openblaspcfix
2be2905Merge tag '9.1.beta2' into t/29071/packages/openblaspcfix

comment:63 follow-ups: Changed 20 months ago by mkoeppe

I don't like the idea of requiring a Fortran compiler to even run ./configure successfully.

After all, sage-the-distribution has a mechanism to install gfortran itself. We shouldn't break that.

As you can see at https://github.com/mkoeppe/sage/runs/411989461, with this ticket all "minimal" installs fail with configure: error: in /sage': configure: error: cannot compile a simple Fortran program`.

comment:64 Changed 20 months ago by mkoeppe

  • Reviewers changed from Isuru Fernando to Isuru Fernando, Matthias Koeppe

comment:65 follow-up: Changed 20 months ago by git

  • Commit changed from 2be29056cf55bd19730fffdb69a6814885bc9c54 to d2b5e139875c8769d1b0dca0cc05512df3cdfcbe

Branch pushed to git repo; I updated commit sha1. New commits:

d2b5e13configure.ac, build/pkgs/{openblas,gfortran}: Do not fail if there is no FC

comment:66 in reply to: ↑ 63 Changed 20 months ago by mkoeppe

Replying to mkoeppe:

I don't like the idea of requiring a Fortran compiler to even run ./configure successfully.

Fixed in d2b5e13.

comment:68 in reply to: ↑ 63 Changed 20 months ago by dimpase

Replying to mkoeppe:

I don't like the idea of requiring a Fortran compiler to even run ./configure successfully.

After all, sage-the-distribution has a mechanism to install gfortran itself. We shouldn't break that.

As you can see at https://github.com/mkoeppe/sage/runs/411989461, with this ticket all "minimal" installs fail with configure: error: in /sage': configure: error: cannot compile a simple Fortran program`.

oops, I see, I only tested with ./configure --without-system-gfortran - which worked just fine :-)

comment:69 follow-up: Changed 20 months ago by dimpase

+       if test "$SAGE_HAVE_FC_FREEFORM" = yes ; then dnl Have a suitable Fortran compiler

could we please stick to AS_IF ?

comment:70 in reply to: ↑ 65 Changed 20 months ago by dimpase

Replying to git:

Branch pushed to git repo; I updated commit sha1. New commits:

d2b5e13configure.ac, build/pkgs/{openblas,gfortran}: Do not fail if there is no FC

this has broken recognition of gfortran on Debian 10.

probably cause arguments were shuffled around...

comment:71 Changed 20 months ago by dimpase

  • Status changed from needs_review to needs_work

comment:72 follow-up: Changed 20 months ago by dimpase

I also don't get

+      # We already checked (in the initial portion of configure.ac)
+      # whether the Fortran compiler accepts free-format source code (as

IMHO there is nothing either in configure.ac or build/pkgs/gcc/spkg-configure.m4 that does any Fortran checks.

comment:73 in reply to: ↑ 69 ; follow-up: Changed 20 months ago by dimpase

Replying to dimpase:

+       if test "$SAGE_HAVE_FC_FREEFORM" = yes ; then dnl Have a suitable Fortran compiler

could we please stick to AS_IF ?

actually, I don't see the point of this if at all. If we get there then it's already true, as it's inside the check for gfortran as a pre-req, in the scope of SAGE_SPKG_DEPCHECK([gfortran], ...). `

comment:74 follow-up: Changed 20 months ago by dimpase

The trouble is in AC_FC_FUNC(), which throws a fit if there is no Fortran compiler around, instead of just suffering in silence.

comment:75 Changed 20 months ago by git

  • Commit changed from d2b5e139875c8769d1b0dca0cc05512df3cdfcbe to c98c6b2c3d95119445975e45c3e5d4ad2ce586f7

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8cf2a3bconfigure.ac: Check some FC properties earlier
c98c6b2configure.ac, build/pkgs/{openblas,gfortran}: Do not fail if there is no FC

comment:76 in reply to: ↑ 72 Changed 20 months ago by mkoeppe

Replying to dimpase:

I also don't get

+      # We already checked (in the initial portion of configure.ac)
+      # whether the Fortran compiler accepts free-format source code (as

IMHO there is nothing either in configure.ac or build/pkgs/gcc/spkg-configure.m4 that does any Fortran checks.

Sorry, I forgot to include one commit on this branch. Fixed.

comment:77 in reply to: ↑ 74 Changed 20 months ago by mkoeppe

Replying to dimpase:

The trouble is in AC_FC_FUNC(), which throws a fit if there is no Fortran compiler around, instead of just suffering in silence.

Yes, exactly, and more specifically: Because of AC_REQUIRE and AC_DEFUN_ONCE one cannot easily make all things conditional that one would liike.

comment:78 in reply to: ↑ 73 Changed 20 months ago by mkoeppe

Replying to dimpase:

Replying to dimpase:

+       if test "$SAGE_HAVE_FC_FREEFORM" = yes ; then dnl Have a suitable Fortran compiler

could we please stick to AS_IF ?

No, they are unfortunately not equivalent because of autoconf's AC_PREREQ/AC_DEFUN_ONCE magic.

comment:79 Changed 20 months ago by dimpase

  • Branch changed from u/mkoeppe/packages/openblaspcfix to u/dimpase/packages/openblaspcfix
  • Commit changed from c98c6b2c3d95119445975e45c3e5d4ad2ce586f7 to 3a4524e4c82840fb023a0fd2af83d0a1c65292cd
  • Status changed from needs_work to needs_review

New commits:

39a317dinstall cblas.pc and lapack.pc links conditionally
7adc712use AC_SEARCH_LIBS
abda83eadded missing module names - cblas and lapack
683a926make installing *.pc files conditional
a0acbcbcorrect quoting of m4 index variable
5ee6844ensure gfortran is available
56541aewrap AC_FC_FUNC so that it does not throw an error without Fortran
3a4524eMerge remote-tracking branch 'trac/public/packages/numpy/no_DEFAULT_and_ALL_numpy_site_cfg' into openblaspcfix

comment:80 in reply to: ↑ 63 ; follow-up: Changed 20 months ago by dimpase

Replying to mkoeppe:

I don't like the idea of requiring a Fortran compiler to even run ./configure successfully.

Fixed by wrap AC_FC_FUNC so that it does not throw an error without Fortran: 56541ae

comment:81 follow-up: Changed 20 months ago by dimpase

IMHO it's an autoconf bug/feature that AC_FC_FUNC errors out without Fortran, while e.g. AC_FC_FREEFORM does not.

comment:82 in reply to: ↑ 81 Changed 20 months ago by mkoeppe

Replying to dimpase:

IMHO it's an autoconf bug/feature that AC_FC_FUNC errors out without Fortran, while e.g. AC_FC_FREEFORM does not.

Yes, I agree.

comment:83 in reply to: ↑ 80 Changed 20 months ago by mkoeppe

Replying to dimpase:

Replying to mkoeppe:

I don't like the idea of requiring a Fortran compiler to even run ./configure successfully.

Fixed by wrap AC_FC_FUNC so that it does not throw an error without Fortran: 56541ae

Great, a much easier fix than what I put together in ​8cf2a3b/​c98c6b2. Testing at https://github.com/mkoeppe/sage/actions/runs/32186055

comment:85 Changed 20 months ago by mkoeppe

  • Status changed from needs_review to positive_review

Looking good, and certainly fixes what was original reported on this ticket (fflas_ffpack on archlinux). The build error of fflas_ffpack on debian-jessie-standard (https://github.com/mkoeppe/sage/runs/412891766) is unrelated. It is good on all other configurations.

comment:86 Changed 20 months ago by vbraun

  • Branch changed from u/dimpase/packages/openblaspcfix to 3a4524e4c82840fb023a0fd2af83d0a1c65292cd
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.