Got error messages when installing sagemath on Ubuntu

352 views
Skip to first unread message

Minho Song

unread,
Dec 30, 2022, 7:49:00 PM12/30/22
to sage-devel
OS: Windows10 (Build 19044.2364)

I tried to install sagemath on Ubuntu but it failed.

Could you check my logs and what I did, and tell me what to do at this stage?
What_I_did.png
python3-3.10.8.log
config.log

Matthias Koeppe

unread,
Dec 30, 2022, 7:57:10 PM12/30/22
to sage-devel
From python...log:

building '_ctypes' extension gcc -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -g -O2 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I. -I/home/mhsong/sage/local/include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/mhsong/sage/local/var/lib/sage/venv-python3.10.8/var/tmp/sage/build/python3-3.10.8/src/Include -I/home/mhsong/sage/local/var/lib/sage/venv-python3.10.8/var/tmp/sage/build/python3-3.10.8/src -c /home/mhsong/sage/local/var/lib/sage/venv-python3.10.8/var/tmp/sage/build/python3-3.10.8/src/Modules/_ctypes/_ctypes.c -o build/temp.linux-x86_64-3.10/home/mhsong/sage/local/var/lib/sage/venv-python3.10.8/var/tmp/sage/build/python3-3.10.8/src/Modules/_ctypes/_ctypes.o -DPy_BUILD_CORE_MODULE /home/mhsong/sage/local/var/lib/sage/venv-python3.10.8/var/tmp/sage/build/python3-3.10.8/src/Modules/_ctypes/_ctypes.c:107:10: fatal error: ffi.h: No such file or directory 107 | #include <ffi.h> | ^~~~~~~ compilation terminated.

Could you post logs/pkgs/libffi*.log please?

Minho Song

unread,
Jan 1, 2023, 4:03:53 AM1/1/23
to sage-devel

Here is the log file.
Thank you for your time.
2022년 12월 31일 토요일 오전 9시 57분 10초 UTC+9에 Matthias Koeppe님이 작성:
libffi-3.2.1.log

Matthias Koeppe

unread,
Jan 1, 2023, 1:31:30 PM1/1/23
to sage-devel
This log looks fine. Can you check that the file /home/mhsong/sage/local/include/ffi.h exists?
This may be an intermittent problem on WSL (see https://trac.sagemath.org/ticket/31088).
Try restarting the build by typing "make build".

Minho Song

unread,
Jan 3, 2023, 7:42:59 AM1/3/23
to sage-devel
I found I don't have the file ffi.h in that folder.

I typed "make build" and still it didn't work.
Please check the attachment, the end of the installation log.


2023년 1월 2일 월요일 오전 3시 31분 30초 UTC+9에 Matthias Koeppe님이 작성:
ubuntu.png

Matthias Koeppe

unread,
Jan 3, 2023, 12:38:43 PM1/3/23
to sage-devel
From config.log:

PATH: /mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2022.1.0_x64__79rhkp1fndgsc/
PATH: /mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64_win/compiler/
PATH: /mnt/c/Windows/system32/
PATH: /mnt/c/Windows/
PATH: /mnt/c/Windows/System32/Wbem/
PATH: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /mnt/c/Windows/System32/OpenSSH/
PATH: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common/
PATH: /mnt/c/Program Files/Git/cmd/
PATH: /mnt/c/Strawberry/c/bin/
PATH: /mnt/c/Strawberry/perl/site/bin/
PATH: /mnt/c/Strawberry/perl/bin/
PATH: /mnt/c/Users/Song/AppData/Local/Programs/Python/Python39/Scripts/
PATH: /mnt/c/Users/Song/AppData/Local/Programs/Python/Python39/
PATH: /mnt/c/Users/Song/AppData/Local/Microsoft/WindowsApps/
PATH: /mnt/c/Users/Song/AppData/Local/Programs/Microsoft VS Code/bin/
PATH: /mnt/c/Program Files/Bandizip/
PATH: /mnt/c/texlive/2020/bin/win32/
PATH: /mnt/c/Program Files/JetBrains/PyCharm Community Edition 2021.2/bin/
PATH: /mnt/c/Users/Song/AppData/Local/afreeca/

I'd recommend the following:
- Clear the PATH by removing everything that comes from /mnt/c ("export PATH=/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/sbin/:/bin/:/usr/lib/wsl/lib/")
- Start from scratch by cleaning the source tree ("make distclean")
- Run "./configure" and follow the instructions regarding Ubuntu package installation that are displayed at the end.

Minho Song

unread,
Jan 3, 2023, 7:56:38 PM1/3/23
to sage-devel
I got the following instructions after running "./configure"

--------------------------------------------------------------------------------------------------------
 notice: the following SPKGs did not find equivalent system packages:

        appdirs arb boost_cropped brial bzip2 cddlib cliquer cmake curl distlib ecl eclib ecm fflas_ffpack filelock flint flintqs fplll freetype gc gengetopt gf2x gfan giac givaro glpk gmp gsl iml lcalc libatomic_ops libbraiding libffi libgd libhomfly liblzma libpng linbox lrcalc m4ri m4rie meson mpc mpfi mpfr nauty ncurses ninja_build ntl openblas openssl palp pari pari_galdata pari_seadata_small pcre pkgconf planarity ppl primecount primesieve python3 qhull readline rw singular sqlite suitesparse symmetrica sympow tachyon toml tox virtualenv zeromq zlib   4ti2 cbc coxeter3 _develop ffmpeg gp2c graphviz igraph imagemagick isl libgraphviz libnauty libsemigroups libxml2 lrslib pandoc pari_elldata pari_galpol pari_nftables pari_seadata pdf2svg perl_cpan_polymake_prereq perl_mongodb perl_term_readline_gnu polymake r _recommended texlive

checking for the package system in use... debian
configure:

    hint: installing the following system packages, if not
    already present, is recommended and may avoid having to
    build them (though some may have to be built anyway):

      $ sudo apt-get update
      $ sudo apt-get install  libflint-arb-dev libboost-dev libbrial-dev libbrial-groebner-dev libbz2-dev bzip2 libcdd-dev libcdd-tools cliquer libcliquer-dev cmake curl libcurl4-openssl-dev ecl libec-dev eclib-tools gmp-ecm libecm-dev fflas-ffpack libflint-dev flintqs libfplll-dev libfreetype6-dev libgc-dev gengetopt libgf2x-dev gfan libgiac-dev xcas libgivaro-dev glpk-utils libglpk-dev libgmp-dev libgsl-dev libiml-dev lcalc liblfunction-dev libatomic-ops-dev libbraiding-dev libffi-dev libgd-dev libhomfly-dev xz-utils liblzma-dev liblinbox-dev liblrcalc-dev libm4ri-dev libm4rie-dev meson libmpc-dev libmpfi-dev libmpfr-dev nauty libncurses5-dev ninja-build libntl-dev libopenblas-dev openssl libssl-dev palp pari-gp2c libpari-dev pari-doc pari-elldata pari-galdata pari-galpol pari-seadata libpcre3-dev pkg-config libplanarity-dev planarity libppl-dev ppl-dev libprimesieve-dev python3 libpython3-dev python3-distutils python3-venv libqhull-dev libreadline-dev librw-dev singular singular-doc libsingular4-dev libsqlite3-dev sqlite3 libsuitesparse-dev libsymmetrica2-dev sympow tachyon tox libzmq3-dev libz-dev

configure:

    hint: installing the following system packages, if not
    already present, may provide additional optional features:

      $ sudo apt-get update
      $ sudo apt-get install  4ti2 coinor-cbc coinor-libcbc-dev gpgconf openssh-client ffmpeg pari-gp2c graphviz libigraph-dev imagemagick libisl-dev libgraphviz-dev libnauty-dev libxml2-dev lrslib pandoc pdf2svg libxml-libxslt-perl libxml-writer-perl libxml2-dev libperl-dev libfile-slurp-perl libjson-perl libsvg-perl libterm-readkey-perl libterm-readline-gnu-perl libmongodb-perl libterm-readline-gnu-perl polymake libpolymake-dev r-base-dev r-cran-lattice default-jdk libavdevice-dev texlive-latex-extra texlive-xetex latexmk dvipng tex-gyre texlive-fonts-recommended texlive-lang-cyrillic texlive-lang-english texlive-lang-european texlive-lang-french texlive-lang-german texlive-lang-italian texlive-lang-japanese texlive-lang-polish texlive-lang-portuguese texlive-lang-spanish

configure:

    hint: After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status
--------------------------------------------------------------------------------------------------------

So I did 

--------------------------------------------------------------------------------------------------------
 $ sudo apt-get update
 $ sudo apt-get install  libflint-arb-dev libboost-dev libbrial-dev libbrial-groebner-dev libbz2-dev bzip2 libcdd-dev libcdd-tools cliquer libcliquer-dev cmake curl libcurl4-openssl-dev ecl libec-dev eclib-tools gmp-ecm libecm-dev fflas-ffpack libflint-dev flintqs libfplll-dev libfreetype6-dev libgc-dev gengetopt libgf2x-dev gfan libgiac-dev xcas libgivaro-dev glpk-utils libglpk-dev libgmp-dev libgsl-dev libiml-dev lcalc liblfunction-dev libatomic-ops-dev libbraiding-dev libffi-dev libgd-dev libhomfly-dev xz-utils liblzma-dev liblinbox-dev liblrcalc-dev libm4ri-dev libm4rie-dev meson libmpc-dev libmpfi-dev libmpfr-dev nauty libncurses5-dev ninja-build libntl-dev libopenblas-dev openssl libssl-dev palp pari-gp2c libpari-dev pari-doc pari-elldata pari-galdata pari-galpol pari-seadata libpcre3-dev pkg-config libplanarity-dev planarity libppl-dev ppl-dev libprimesieve-dev python3 libpython3-dev python3-distutils python3-venv libqhull-dev libreadline-dev librw-dev singular singular-doc libsingular4-dev libsqlite3-dev sqlite3 libsuitesparse-dev libsymmetrica2-dev sympow tachyon tox libzmq3-dev libz-dev
--------------------------------------------------------------------------------------------------------

and then

--------------------------------------------------------------------------------------------------------
$ sudo apt-get update
$ sudo apt-get install  4ti2 coinor-cbc coinor-libcbc-dev gpgconf openssh-client ffmpeg pari-gp2c graphviz libigraph-dev imagemagick libisl-dev libgraphviz-dev libnauty-dev libxml2-dev lrslib pandoc pdf2svg libxml-libxslt-perl libxml-writer-perl libxml2-dev libperl-dev libfile-slurp-perl libjson-perl libsvg-perl libterm-readkey-perl libterm-readline-gnu-perl libmongodb-perl libterm-readline-gnu-perl polymake libpolymake-dev r-base-dev r-cran-lattice default-jdk libavdevice-dev texlive-latex-extra texlive-xetex latexmk dvipng tex-gyre texlive-fonts-recommended texlive-lang-cyrillic texlive-lang-english texlive-lang-european texlive-lang-french texlive-lang-german texlive-lang-italian texlive-lang-japanese texlive-lang-polish texlive-lang-portuguese texlive-lang-spanish
--------------------------------------------------------------------------------------------------------

after that

--------------------------------------------------------------------------------------------------------
$ ./config.status --recheck && ./config.status
--------------------------------------------------------------------------------------------------------

In the end, I got the following (say *):
--------------------------------------------------------------------------------------------------------
notice: the following SPKGs did not find equivalent system packages:

        ecl eclib fflas_ffpack fplll gc givaro libhomfly linbox lrcalc meson primecount primesieve qhull rpy2   4ti2 coxeter3 _develop igraph libsemigroups polymake _recommended

checking for the package system in use... debian
configure:

    hint: installing the following system packages, if not
    already present, is recommended and may avoid having to
    build them (though some may have to be built anyway):

      $ sudo apt-get update
      $ sudo apt-get install  ecl libec-dev eclib-tools fflas-ffpack libfplll-dev libgc-dev libgivaro-dev libhomfly-dev liblinbox-dev liblrcalc-dev meson libprimesieve-dev libqhull-dev

configure:

    hint: installing the following system packages, if not
    already present, may provide additional optional features:

      $ sudo apt-get update
      $ sudo apt-get install  4ti2 gpgconf openssh-client libigraph-dev polymake libpolymake-dev default-jdk libavdevice-dev

configure:

    hint: After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status

config.status: creating build/make/Makefile-auto
config.status: creating build/make/Makefile
config.status: creating src/bin/sage-env-config
config.status: creating src/bin/sage-src-env-config
config.status: creating build/bin/sage-build-env-config
config.status: creating pkgs/sage-conf/_sage_conf/_conf.py
config.status: executing depfiles commands
config.status: executing mkdirs commands
config.status: creating directory /home/mhsong/sage/logs/pkgs
config.status: creating directory local
config.status: creating directory local/bin
config.status: creating directory local/etc
config.status: creating directory local/include
config.status: creating directory local/lib
config.status: creating directory local/lib/pkgconfig
config.status: creating directory local/share
config.status: creating directory local/var/lib/sage/installed
config.status: executing links commands
config.status: creating convenience symlink prefix -> local
config.status: creating convenience symlink venv -> local/var/lib/sage/venv-python3.10
--------------------------------------------------------------------------------------------------------

So I did follow the instruction again:
--------------------------------------------------------------------------------------------------------
      $ sudo apt-get update
      $ sudo apt-get install  ecl libec-dev eclib-tools fflas-ffpack libfplll-dev libgc-dev libgivaro-dev libhomfly-dev liblinbox-dev liblrcalc-dev meson libprimesieve-dev libqhull-dev
--------------------------------------------------------------------------------------------------------

and then 
--------------------------------------------------------------------------------------------------------
      $ sudo apt-get update
      $ sudo apt-get install  4ti2 gpgconf openssh-client libigraph-dev polymake libpolymake-dev default-jdk libavdevice-dev
--------------------------------------------------------------------------------------------------------

You can check the details in the attachment 'ubuntu230104.png'.

After that, I did
--------------------------------------------------------------------------------------------------------
$ ./config.status --recheck && ./config.status
--------------------------------------------------------------------------------------------------------
But still, I got the same notice *. (You can see this in the attachment, 'ununtu_same_notice.png')

How can I get out of this loop and fix all problems?

I really appreciate your time.
2023년 1월 4일 수요일 오전 2시 38분 43초 UTC+9에 Matthias Koeppe님이 작성:
ubuntu_same_notice.png
ubuntu230104.png

Matthias Koeppe

unread,
Jan 3, 2023, 8:03:53 PM1/3/23
to sage-devel
Just ignore the ones that persist and continue with "make build"

Jan Groenewald

unread,
Jan 3, 2023, 11:32:17 PM1/3/23
to sage-...@googlegroups.com
Hi

On Wed, 4 Jan 2023 at 03:03, Matthias Koeppe <matthia...@gmail.com> wrote:
Just ignore the ones that persist and continue with "make build"

Is this (repeated printing of "you need to sudo apt install") able to be fixed? It trips up many of our students as well.

Regards,
Jan


 

--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

Matthias Koeppe

unread,
Jan 3, 2023, 11:38:02 PM1/3/23
to sage-devel
Suggestions on how to improve the wording of this are welcome.
"  hint: installing the following system packages, if not
    already present, is recommended and may avoid having to
    build them (though some may have to be built anyway):"


Minho Song

unread,
Jan 5, 2023, 7:26:17 AM1/5/23
to sage-devel
Now the problem is solved and I got sagemath on my laptop.
I really appreciate your help. 

2023년 1월 4일 수요일 오전 10시 3분 53초 UTC+9에 Matthias Koeppe님이 작성:
Reply all
Reply to author
Forward
0 new messages