Error building package e_antic

64 views
Skip to first unread message

Byeongsu Yu

unread,
Feb 14, 2021, 6:47:36 PM2/14/21
to sage-devel
It seems that no one reported this error on the group, I want to report it.

My system is Mac OS, Catalina 10.15.7 with intel64 CPU. I thought the main error was
 as below, such that implicit declaration of function _fmpq_div. 

In my opinion, though I'm not expert on computer, it seems that C++ compiler needed for compile some sources of package does not work well. This kind of problem also happens when I try to upgrade python package 

cypari2, fpyll, and pplpy using pip install --upgrade command, all of which requires the compile by gcc.

I really appreciate your concern and help for this error.


-----------------

[e_antic-0.1.8] nf_elem/scalar_div_fmpq.c:37:7: error: implicit declaration of function '_fmpq_div' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

[e_antic-0.1.8]       _fmpq_div(num, den, num2, den2, fmpq_numref(c), fmpq_denref(c));

[e_antic-0.1.8]       ^

[e_antic-0.1.8] nf_elem/scalar_div_fmpq.c:37:7: note: did you mean 'fmpq_div'?

[e_antic-0.1.8] /Applications/SageMath-9.2.app/Contents/Resources/sage/local/include/flint/fmpq.h:280:16: note: 'fmpq_div' declared here

[e_antic-0.1.8] FLINT_DLL void fmpq_div(fmpq_t res, const fmpq_t op1, const fmpq_t op2);

[e_antic-0.1.8]                ^

[e_antic-0.1.8] 1 error generated.

[e_antic-0.1.8] make[4]: *** [nf_elem/scalar_div_fmpq.lo] Error 1

[e_antic-0.1.8] make[3]: *** [all] Error 2

[e_antic-0.1.8] ********************************************************************************

e_antic-0.1.8.log

Matthias Koeppe

unread,
Feb 15, 2021, 12:40:16 PM2/15/21
to sage-devel
This is likely caused by libraries from homebrew /usr/local leaking into the build, specifically homebrew's version of FLINT.
Remove homebrew's version of flint; or try the current development version, which has fixes for this problem.

Also - it's best to avoid "pip install --upgrade " for packages within the Sage distribution. Instead, compile a development version of Sage from source.

Byeongsu Yu

unread,
Feb 18, 2021, 5:05:58 PM2/18/21
to sage-devel
Dear Dr. Koeppe and other sage math users,

When I got your advice at first, my sage math version is not from source but compiled one; and installing e_antic with deleting flint from Homebrew or not does not change the error message. Hence, from your last advice, I just deleted all sagemath app, and download sourcecode and compile it in my own machine. It has an error when making document files, which I will upload in other group post soon, but still, sage itself was build without problem.

Now, I tried with the flint from Homebrew, but this gives the same error again; thus I deleted it and compile flint for sagemath by

sage -i flint

command.  (here, for someone who follow my fix, please sage -i fplll first since installing fpylll without fplll gives you error. See this https://github.com/fplll/fpylll/issues/98  ) Anyway, it was succesful to instal flint.

Next, I try to install e_antic again by

sage -i e_antic,

then, I've got different error message. In this error message, now it just gives warning for FLINT_DLL part, which generated error in the last time, however, it gives another error as below.

----------------------
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -c nf_elem/scalar_div_fmpq.c  -fno-common -DPIC -o nf_elem/.libs/scalar_div_fmpq.o
nf_elem/scalar_div_fmpq.c:37:7: error: implicit declaration of function '_fmpq_div' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      _fmpq_div(num, den, num2, den2, fmpq_numref(c), fmpq_denref(c));
      ^
nf_elem/scalar_div_fmpq.c:37:7: note: did you mean 'fmpq_div'?
/Applications/sage-9.2/local/include/flint/fmpq.h:280:16: note: 'fmpq_div' declared here
FLINT_DLL void fmpq_div(fmpq_t res, const fmpq_t op1, const fmpq_t op2);
               ^
1 error generated.
make[4]: *** [Makefile:2696: nf_elem/scalar_div_fmpq.lo] Error 1
make[3]: *** [Makefile:1580: all] Error 2
********************************************************************************
Error building e_antic-0.1.8
********************************************************************************
-------------------------------

Do you, and other people who see this post have any advice for dealing with this problem? It seems that I need to use C90 or other compiler for this package, but I don't know how. Thank you for concerning this question.

Best,
Byeongsu Yu
e_antic-0.1.8.log
Reply all
Reply to author
Forward
0 new messages