Building sage fails at gsl because of openblas

169 views
Skip to first unread message

Kwankyu Lee

unread,
Sep 29, 2021, 5:03:15 AM9/29/21
to sage-devel
Hi,

I started to build the latest Sage 9.5.beta2 from some old Sage installation on Mac. Then it failed while building "gsl" complaining missing "openblas" library. I could overcome the problem by issuing "sage -i openblas". I went through this twice on two Sage installations on the same machine.

But my question is: if openblas is a requirement of building gsl, then why "make" build openblas first and then gsl, instead of forcing me to do this manually?  I guess there is a bug in the make script...

Thank you for attention.

Kwankyu Lee

unread,
Sep 29, 2021, 5:06:43 AM9/29/21
to sage-devel
My question is: why "make" does not build openblas first and then gsl, instead of forcing me to do this manually?  

Dima Pasechnik

unread,
Sep 29, 2021, 5:20:46 AM9/29/21
to sage-devel
On Wed, Sep 29, 2021 at 10:06 AM Kwankyu Lee <ekwa...@gmail.com> wrote:
My question is: why "make" does not build openblas first and then gsl, instead of forcing me to do this manually? 

"make" does what ./configure tells it to do. Normally speaking one doesn't need to build openblas nor gsl if using Homebrew or Conda...

Probably you have some old openblas installed that confuses configure or make.

  
 


On Wednesday, September 29, 2021 at 6:03:15 PM UTC+9 Kwankyu Lee wrote:
Hi,

I started to build the latest Sage 9.5.beta2 from some old Sage installation on Mac. Then it failed while building "gsl" complaining missing "openblas" library. I could overcome the problem by issuing "sage -i openblas". I went through this twice on two Sage installations on the same machine.

But my question is: if openblas is a requirement of building gsl, then why "make" build openblas first and then gsl, instead of forcing me to do this manually?  I guess there is a bug in the make script...

Thank you for attention.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/010c54f8-3ade-41ba-aee8-83e7985c0832n%40googlegroups.com.

Vincent Delecroix

unread,
Sep 29, 2021, 5:29:34 AM9/29/21
to sage-...@googlegroups.com
I had the exact same trouble building the optional package barvinok
that has 3 dependencies : ntl, isl and polylib. Running
'sage -i barvinok' gave me an error that shows that isl was not built

[barvinok-0.41.1] basis_reduction.c:5:10: fatal error: isl/val_gmp.h: No
such file or directory
[barvinok-0.41.1] 5 | #include <isl/val_gmp.h>
[barvinok-0.41.1] | ^~~~~~~~~~~~~~~
[barvinok-0.41.1] compilation terminated.
[barvinok-0.41.1] make[5]: *** [Makefile:1517: basis_reduction.lo] Error 1
[barvinok-0.41.1] make[4]: *** [Makefile:1825: all-recursive] Error 1
[barvinok-0.41.1] make[3]: *** [Makefile:1094: all] Error 2

After doing 'sage -i isl' and then 'sage -i barvinok' it worked.

Vincent
>> <https://groups.google.com/d/msgid/sage-devel/010c54f8-3ade-41ba-aee8-83e7985c0832n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

Dima Pasechnik

unread,
Sep 29, 2021, 5:47:04 AM9/29/21
to sage-devel
"sage -i <blah>" is deprecated. Please use "make <blah>".


Matthias Koeppe

unread,
Sep 29, 2021, 12:19:20 PM9/29/21
to sage-devel
On Wednesday, September 29, 2021 at 2:03:15 AM UTC-7 Kwankyu Lee wrote:
I started to build the latest Sage 9.5.beta2 from some old Sage installation on Mac. Then it failed [...]

When incremental builds fail, use "make distclean" to start from scratch.
 

Matthias Koeppe

unread,
Sep 29, 2021, 12:21:56 PM9/29/21
to sage-devel
On Wednesday, September 29, 2021 at 2:29:34 AM UTC-7 vdelecroix wrote:
I had the exact same trouble building the optional package barvinok

I don't think this is the same problem
 

that has 3 dependencies : ntl, isl and polylib. Running
'sage -i barvinok' gave me an error that shows that isl was not built

post your config.log, build/make/Makefile, tail of logs/install.log 
 

John H Palmieri

unread,
Sep 29, 2021, 4:09:07 PM9/29/21
to sage-devel
One guess would be that ./configure found what it thought was a usable installation of openblas, but when gsl tried to build, that openblas was not in fact usable. You can bypass this by either installing a system version of gsl or using `./configure --with-system-openblas=no` to force Sage to build its own openblas.

Kwankyu Lee

unread,
Sep 29, 2021, 10:02:09 PM9/29/21
to sage-devel
On Thursday, September 30, 2021 at 5:09:07 AM UTC+9 John H Palmieri wrote:
One guess would be that ./configure found what it thought was a usable installation of openblas, but when gsl tried to build, that openblas was not in fact usable. 

Perhaps. That is strange. It was "not usable" because the library was not found. Then I wonder what openblas the configure found...  

Dima Pasechnik

unread,
Sep 30, 2021, 4:10:25 AM9/30/21
to sage-devel
you can see it in top-level config.log (the following is what you see if openblas is accepted):

## Checking whether SageMath should install SPKG openblas... ##
## --------------------------------------------------------- ##
configure:14782: checking BLAS library
configure:14802: result: openblas
configure:15932: $? = 0
configure:15954: checking for cblas_dgemm
configure:15954: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
configure:15954: $? = 0
configure:15954: result: yes
configure:16036: checking for dgeqrf
configure:16036: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
...
...
configure:16196: will use system package and not install SPKG openblas


--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Kwankyu Lee

unread,
Sep 30, 2021, 10:58:16 PM9/30/21
to sage-devel


On Thursday, September 30, 2021 at 5:10:25 PM UTC+9 dim...@gmail.com wrote:
... you can see it in top-level config.log (the following is what you see if openblas is accepted):

## Checking whether SageMath should install SPKG openblas... ##
## --------------------------------------------------------- ##
configure:14782: checking BLAS library
configure:14802: result: openblas
configure:15932: $? = 0
configure:15954: checking for cblas_dgemm
configure:15954: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
configure:15954: $? = 0
configure:15954: result: yes
configure:16036: checking for dgeqrf
configure:16036: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
...
...
configure:16196: will use system package and not install SPKG openblas

I cannot reproduce the gsl build failure again. But after "make distclean; ./configure", the config.log shows the following. This time sage building is going well until now.

Can you see a problem with my system openblas in the log? Thank you for attention.

## --------------------------------------------------------- ##
## Checking whether SageMath should install SPKG openblas... ##
## --------------------------------------------------------- ##
configure:13878: checking BLAS library
configure:13898: result: openblas
configure:13953: checking whether any of gfortran is installed as or will be installed as SPKG
configure:13963: result: no
configure:13974: checking for openblas >= 0.2.20
configure:13981: $PKG_CONFIG --exists --print-errors "openblas >= 0.2.20"
configure:13984: $? = 0
configure:13998: $PKG_CONFIG --exists --print-errors "openblas >= 0.2.20"
configure:14001: $? = 0
configure:15015: result: yes
configure:15025: $PKG_CONFIG --exists --print-errors "openblas"
configure:15028: $? = 0
configure:15050: checking for cblas_dgemm
configure:15050: g++ -std=gnu++11 -o conftest    conftest.cpp -L/usr/local/Cellar/openblas/0.3.17/lib -lopenblas -lmpfr -lgmp -lm  >&5
configure:15050: $? = 0
configure:15050: result: yes
configure:15132: checking for dgeqrf
configure:15132: g++ -std=gnu++11 -o conftest    conftest.cpp -L/usr/local/Cellar/openblas/0.3.17/lib -lopenblas -lmpfr -lgmp -lm  >&5
Undefined symbols for architecture x86_64:
  "_dgeqrf", referenced from:
      _main in conftest-39a3a4.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:15132: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Sage"
| #define PACKAGE_TARNAME "sage"
| #define PACKAGE_VERSION "9.5.beta2"
| #define PACKAGE_STRING "Sage 9.5.beta2"
| #define PACKAGE_BUGREPORT "sage-...@googlegroups.com"
| #define PACKAGE_URL ""
| #define PACKAGE "sage"
| #define VERSION "9.5.beta2"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define STDC_HEADERS 1
| #define HAVE_LIBM 1
| #define HAVE_CXX11 1
| #define HAVE_GMP_H 1
| #define ABSOLUTE_GMP_H "///usr/local/include/gmp.h"
| /* end confdefs.h.  */
| /* Define dgeqrf to an innocuous variant, in case <limits.h> declares dgeqrf.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define dgeqrf innocuous_dgeqrf
| /* System header to define __stub macros and hopefully few prototypes,
|    which can conflict with char dgeqrf (); below.  */
| #include <limits.h>
| #undef dgeqrf
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char dgeqrf ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_dgeqrf || defined __stub___dgeqrf
| choke me
| #endif
| int
| main (void)
| {
| return dgeqrf ();
|   ;
|   return 0;
| }
configure:15132: result: no
configure:15141: checking for dgeqrf_
configure:15141: g++ -std=gnu++11 -o conftest    conftest.cpp -L/usr/local/Cellar/openblas/0.3.17/lib -lopenblas -lmpfr -lgmp -lm  >&5
configure:15141: $? = 0
configure:15141: result: yes
configure:15150: checking for DGEQRF
configure:15150: g++ -std=gnu++11 -o conftest    conftest.cpp -L/usr/local/Cellar/openblas/0.3.17/lib -lopenblas -lmpfr -lgmp -lm  >&5
Undefined symbols for architecture x86_64:
  "_DGEQRF", referenced from:
      _main in conftest-8e34df.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:15150: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Sage"
| #define PACKAGE_TARNAME "sage"
| #define PACKAGE_VERSION "9.5.beta2"
| #define PACKAGE_STRING "Sage 9.5.beta2"
| #define PACKAGE_BUGREPORT "sage-...@googlegroups.com"
| #define PACKAGE_URL ""
| #define PACKAGE "sage"
| #define VERSION "9.5.beta2"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define STDC_HEADERS 1
| #define HAVE_LIBM 1
| #define HAVE_CXX11 1
| #define HAVE_GMP_H 1
| #define ABSOLUTE_GMP_H "///usr/local/include/gmp.h"
| /* end confdefs.h.  */
| /* Define DGEQRF to an innocuous variant, in case <limits.h> declares DGEQRF.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define DGEQRF innocuous_DGEQRF
| /* System header to define __stub macros and hopefully few prototypes,
|    which can conflict with char DGEQRF (); below.  */
| #include <limits.h>
| #undef DGEQRF
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char DGEQRF ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_DGEQRF || defined __stub___DGEQRF
| choke me
| #endif
| int
| main (void)
| {
| return DGEQRF ();
|   ;
|   return 0;
| }
configure:15150: result: no
configure:15159: checking for DGEQRF_
configure:15159: g++ -std=gnu++11 -o conftest    conftest.cpp -L/usr/local/Cellar/openblas/0.3.17/lib -lopenblas -lmpfr -lgmp -lm  >&5
Undefined symbols for architecture x86_64:
  "_DGEQRF_", referenced from:
      _main in conftest-1e2411.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:15159: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Sage"
| #define PACKAGE_TARNAME "sage"
| #define PACKAGE_VERSION "9.5.beta2"
| #define PACKAGE_STRING "Sage 9.5.beta2"
| #define PACKAGE_BUGREPORT "sage-...@googlegroups.com"
| #define PACKAGE_URL ""
| #define PACKAGE "sage"
| #define VERSION "9.5.beta2"
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define STDC_HEADERS 1
| #define HAVE_LIBM 1
| #define HAVE_CXX11 1
| #define HAVE_GMP_H 1
| #define ABSOLUTE_GMP_H "///usr/local/include/gmp.h"
| /* end confdefs.h.  */
| /* Define DGEQRF_ to an innocuous variant, in case <limits.h> declares DGEQRF_.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define DGEQRF_ innocuous_DGEQRF_
| /* System header to define __stub macros and hopefully few prototypes,
|    which can conflict with char DGEQRF_ (); below.  */
| #include <limits.h>
| #undef DGEQRF_
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char DGEQRF_ ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_DGEQRF_ || defined __stub___DGEQRF_
| choke me
| #endif
| int
| main (void)
| {
| return DGEQRF_ ();
|   ;
|   return 0;
| }
configure:15159: result: no
configure:15292: will use system package and not install SPKG openblas     

Dima Pasechnik

unread,
Oct 1, 2021, 2:59:12 AM10/1/21
to sage-devel
On Fri, Oct 1, 2021 at 3:58 AM Kwankyu Lee <ekwa...@gmail.com> wrote:


On Thursday, September 30, 2021 at 5:10:25 PM UTC+9 dim...@gmail.com wrote:
... you can see it in top-level config.log (the following is what you see if openblas is accepted):

## Checking whether SageMath should install SPKG openblas... ##
## --------------------------------------------------------- ##
configure:14782: checking BLAS library
configure:14802: result: openblas
configure:15932: $? = 0
configure:15954: checking for cblas_dgemm
configure:15954: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
configure:15954: $? = 0
configure:15954: result: yes
configure:16036: checking for dgeqrf
configure:16036: g++ -o conftest    conftest.cpp -lopenblas  -lmpfr -lgmp -lm  >&5
...
...
configure:16196: will use system package and not install SPKG openblas

I cannot reproduce the gsl build failure again. But after "make distclean; ./configure", the config.log shows the following. This time sage building is going well until now.

Can you see a problem with my system openblas in the log? Thank you for attention.

There is nothing strange in this log, everything looks as expected.

We need to look at the config.log of gsl to see the error it gives.

That's on macOS with Homebrew, right?

Did you forget to source .homebrew-build-env
by any chance?


 
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

Kwankyu Lee

unread,
Oct 1, 2021, 4:10:44 AM10/1/21
to sage-devel
There is nothing strange in this log, everything looks as expected.

Okay. That is reasonable because this was building from scratch, and it finished without problem.

We need to look at the config.log of gsl to see the error it gives.

The error was from an incremental build from an old installation (I don't remember the exact version).  

As I cannot reproduce the error, I would just forget it. Thanks for your attention.
 
That's on macOS with Homebrew, right?

Yes. 

Did you forget to source .homebrew-build-env
by any chance?

No. It's always sourced by my bash profile.

Reply all
Reply to author
Forward
0 new messages