Ask Your Question
1

Sage9.2: Install gap_packages on macOS 10.15 fails

asked 2020-11-16 15:25:09 +0100

Hotschke gravatar image

updated 2020-11-17 08:23:14 +0100

FrédéricC gravatar image

I have tried to install the sage package gap_packages as following

$ sage -v
SageMath version 9.2, Release Date: 2020-10-24
$ sage -i gap_packages

on macOS 10.15 (Catalina) returns

Building GAP package cohomolo-1.6.7
Building gap_packages-4.10.2.p1
mkdir -p bin/x86_64-apple-darwin19.6.0-default64-kv3;
cd standalone/progs.d;\
    make CC="gcc" BIN="..//..//bin/x86_64-apple-darwin19.6.0-default64-kv3" COPTS=""
gcc -c -O -fno-builtin gpd.c 
gpd.c:37:7: error: implicit declaration of function 'gpprog' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (gpprog()== -1) exit(1);
      ^
1 error generated.
make[4]: *** [gpd.o] Error 1
make[3]: *** [all] Error 2
********************************************************************************
Error building gap_packages-4.10.2.p1
********************************************************************************

real    0m1.379s
user    0m0.132s
sys 0m1.200s
************************************************************************
Error installing package gap_packages-4.10.2.p1
************************************************************************
Please email sage-devel
explaining the problem and including the log file
  /Applications/SageMath/logs/pkgs/gap_packages-4.10.2.p1.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/Applications/SageMath/local/var/tmp/sage/build/gap_packages-4.10.2.p1 and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/Applications/SageMath/local/var/tmp/sage/build/gap_packages-4.10.2.p1' && '/Applications/SageMath/sage' --buildsh)
When you are done debugging, you can type "exit" to leave the subshell.
************************************************************************

Compiler from XCode:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

The error can be disabled with the compiler flag -Wno-implicit-function-declaration.

I could proceed with the compilation as following by editing manually the Makefile with vim

$ (cd '/Applications/SageMath/local/var/tmp/sage/build/gap_packages-4.10.2.p1' && '/Applications/SageMath/sage' --buildsh)
$ cd src/pkg/cohomolo-1.6.7/
$ vim Makefile

I have modified the rule all to following:

all:
    mkdir -p bin/x86_64-apple-darwin19.6.0-default64-kv3;
    cd standalone/progs.d;\
    $(MAKE) CC="$(CC) -Wno-implicit-function-declaration" BIN="..//..//$(BIN)" COPTS="$(COPTS)"

Now at least I can run make

 $ pwd
/Applications/SageMath/local/var/tmp/sage/build/gap_packages-4.10.2.p1/src/pkg/cohomolo-1.6.7
 $ make

How can I finish the installation of gap_packages from this subshell?

edit retag flag offensive close merge delete

Comments

If you are willing to build Sage from source, I believe that version 9.3.beta1 has a fix to allow gap_packagesto build with the latest version of Xcode. (See https://trac.sagemath.org/ticket/30729, which should be included in the latest beta versions.)

John Palmieri gravatar imageJohn Palmieri ( 2020-11-17 20:31:51 +0100 )edit

You can also apply the changes at https://git.sagemath.org/sage.git/com... directly to your current version of Sage. They should allow gap_packages to build.

John Palmieri gravatar imageJohn Palmieri ( 2020-11-17 20:32:32 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-11-17 09:47:21 +0100

Hotschke gravatar image

updated 2020-11-17 09:48:47 +0100

Workaround: Disable gap packages with build issues

If you do not need the gap packages

  • cohomolo-*
  • crypting-*
  • grape-*
  • guava-*
  • orb-*

comment them in the spkg-install script for the sage package gap_packages.

$ sage -i gap_packages
... error message ...
$ (cd '/Applications/SageMath/local/var/tmp/sage/build/gap_packages-4.10.2.p1' && '/Applications/SageMath/sage' --buildsh)
$ vim spkg-install

and comment gap packages with build issues:

 96 # Build and install compiled packages:
 97 #
 98 # These packages have an old ./configure that take the GAP_ROOT as a positional
 99 # argument
100 # for pkg in cohomolo-* crypting-* grape-* guava-* orb-*
101 # do
102 #     echo "Building GAP package $pkg"
103 #     cd "$PKG_SRC_DIR/$pkg"
104 #     ./configure "$GAP_ROOT"
105 #     sdh_make -j1
106 #     install_compiled_pkg "$pkg"
107 #     cd "$PKG_SRC_DIR"
108 # done

and then proceed within the subshell with the compilation and installation with

$ ./spkg-install
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-16 15:20:35 +0100

Seen: 365 times

Last updated: Nov 17 '20