1

I am attempting to compile Sage on Ubuntu 16.04. I downloaded the binaries and installed a package. I run "make" in my Sage directory and this is what I get:

> [maxima-5.35.1.p2] Now installing the Maxima library as
> '/home/davidk/Desktop/SageMath/local/lib/ecl//maxima.fas'...
> [maxima-5.35.1.p2]  [maxima-5.35.1.p2] real   5m8.176s
> [maxima-5.35.1.p2] user   4m31.916s [maxima-5.35.1.p2] sys    0m20.496s
> [maxima-5.35.1.p2] Successfully installed maxima-5.35.1.p2
> [maxima-5.35.1.p2] Deleting temporary build directory
> [maxima-5.35.1.p2]
> /home/davidk/Desktop/SageMath/local/var/tmp/sage/build/maxima-5.35.1.p2
> [maxima-5.35.1.p2] Finished installing maxima-5.35.1.p2.spkg cd ../..
> && sage-logger -p './sage --docbuild --no-pdf-links all html '
> logs/dochtml.log [dochtml]
> /home/davidk/Desktop/SageMath/local/bin/python:
> /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.21' not found (required by
> /home/davidk/Desktop/SageMath/local/lib/libbrial.so.0);
> 'sage_setup.docbuild' is a package and cannot be directly executed
> Makefile:1023: recipe for target 'doc-html' failed make[2]: ***
> [doc-html] Error 1 make[2]: Leaving directory
> '/home/davidk/Desktop/SageMath/build/make' Makefile:846: recipe for
> target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving
> directory '/home/davidk/Desktop/SageMath/build/make'
> 
> real  110m50.466s user    102m18.460s sys 5m7.284s
> *************************************************************** Error building Sage.
> 

The following package(s) may have failed to build (not necessarily during this run of 'make all'):

The build directory may contain configuration files and other potentially helpful information. WARNING: if you now run 'make' again, the build directory will, by default, be deleted. Set the environment variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

Makefile:16: recipe for target 'all' failed make: *** [all] Error 1

Following the suggestion in the error message, I changed my environmental variables as follows (I added the second line):

~/Desktop/SageMath$ cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" export SAGE_KEEP_BUILT_SPKGS=yes

Then, following a suggestion here I executed the following:

sudo apt-get install libstdc++6

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get upgrade

When I run "make", I still get the following errors:

> [sagelib-7.3]  [sagelib-7.3] real 0m4.203s [sagelib-7.3] user 0m3.516s
> [sagelib-7.3] sys 0m0.460s cd ../.. && sage-logger -p './sage
> --docbuild --no-pdf-links all html ' logs/dochtml.log [dochtml] /home/davidk/Desktop/SageMath/local/bin/python:
> /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.21' not found (required by
> /home/davidk/Desktop/SageMath/local/lib/libbrial.so.0);
> 'sage_setup.docbuild' is a package and cannot be directly executed
> Makefile:1023: recipe for target 'doc-html' failed make[2]: ***
> [doc-html] Error 1 make[2]: Leaving directory
> '/home/davidk/Desktop/SageMath/build/make' Makefile:846: recipe for
> target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving
> directory '/home/davidk/Desktop/SageMath/build/make'
> 
> real  0m6.692s user   0m5.536s sys    0m0.800s
> *************************************************************** Error building Sage.
> 
> The following package(s) may have failed to build (not necessarily
> during this run of 'make all'):
> 
> The build directory may contain configuration files and other
> potentially helpful information. WARNING: if you now run 'make' again,
> the build directory will, by default, be deleted. Set the environment
> variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
> 
> Makefile:16: recipe for target 'all' failed make: *** [all] Error 1

Can someone please advise? Any suggestions would be greatly appreciated. Thanks!

  • 1
    Please tell us where you downloaded Sage. Most often a source tarball includes an executable script called configure or autogen.sh that needs to be run before make to set up the build environment. Did you do this? Or was there no such file? – Zanna Aug 21 '16 at 22:15
  • Hi, Zanna. I downloaded it from sagemath.org. The readme file didn't say I needed to compile anything. In fact, I was able to execute sage. It was only after I downloaded and installed a package; and then ran "make" that I encountered a problem.

    Yes, it came with a configure file. I just ran "make configure" and it said "make: 'configure' is up to date."

    – user584936 Aug 21 '16 at 22:54
  • @user584936 And what is this package that you downloaded and installed? – edwinksl Aug 21 '16 at 23:01
  • Ah you don't make configure you run the configure script like this ./configure do that and tell us your next problem... but what is the program you are trying to compile, if not Sage? – Zanna Aug 21 '16 at 23:04
  • @Zanna : I ran ./configure without any issue.

    @edwinksl : The package I downloaded was polytopes_db_4d obtained via typing in a shell ./sage -i polytopes_db_4d

    – user584936 Aug 22 '16 at 02:21
  • I may have come up with a fix for this following link (cf. the second to last message) but may have also inadvertently created another issue that I hope you can still assist me with.

    I ran ldd /usr/bin/eog and found libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6

    Then I tried to create hard links to the new libstdc++ compiler; but accidentally removed the compiler with: ulink libstdc++.so.6.0.20! (Didn't know ulink is effectively rm)

    – user584936 Aug 22 '16 at 03:11
  • Continuing, now I have

    ~/Desktop/SageMath$ ls -l /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.22

    and

    :~/Desktop/SageMath/local/lib$ ls libstdc -l

    libstdc++.a libstdc++.so -> libstdc++.so.6.0.20 libstdc++.so.6.0.20-gdb.py

    So it seems like both

    /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/davidk/Desktop/SageMath/local/lib/libstdc++.so

    are using libstdc++.so.6.0.22 instead of libstdc++.so.6. The problem is that libstdc++.so.6.0.22 doesn't seem to exist (can't find it using locate). Advise?

    – user584936 Aug 22 '16 at 03:14
  • after ./configure exits without errors (and you've thanked any applicable divine powers) then you run make, and usually it works OK. As far as I can tell there was no problem except that you didn't do that. Personally, I'm confused by your subsequent messages (ulink??) Can you please [edit] your question instead of putting additional info in comments. – Zanna Aug 23 '16 at 16:32

1 Answers1

2
  1. Verify your current libstdc++ has GLIBCXX_3.4.21:

    strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.21
    
  2. Create a symlink as follows:

    ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6
    
  3. make

edwinksl
  • 23,789