Table des matières

Macaulay2

Depuis 2016, s'installe à partir de dépots comme http://www.math.uiuc.edu/Macaulay2/Downloads/GNU-Linux/Ubuntu/index.html

1.4 sur octopus

rpm -ivh Macaulay2-1.4-1.common.rpm
rpm -ivh Macaulay2-1.4-1.x86_64-Linux-ScientificLinux-5.5.rpm 

Vérification simple:

[henry@octopus ~]$ M2
Macaulay2, version 1.4
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases,
               PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : 2+2

o1 = 4

installation des binaires

shrek

shrek:~# dpkg -i Macaulay2-0.9.95-i386-Linux.deb 
Selecting previously deselected package macaulay2.
(Reading database ... 22381 files and directories currently installed.)
Unpacking macaulay2 (from Macaulay2-0.9.95-i386-Linux.deb) ...
Setting up macaulay2 (0.9.95) ...
Macaulay 2, version 0.9.95
with packages: Classic, Core, Elimination, IntegralClosure, LLLBases, Parsing,
               PrimaryDecomposition, SchurRings, TangentCone
--dumping to /usr/lib/Macaulay2/Core/cache/Macaulay2-i686-data.tmp
--success
--moving: /usr/lib/Macaulay2/Core/cache/Macaulay2-i686-data.tmp -> /usr/lib/Macaulay2/Core/cache/Macaulay2-i686-data

compilation version stable

Les librairies nécessaires

nom archive installée dans logs
Singular-Factory factory-3-0-2.tar.gz /local/henry/logiciels/{lib,include} /local/henry/factory/{WORK,MAKE_GFTABLES,INSTALL}.LOG
Singular-Libfac libfac-3-0-2.tar.gz /local/henry/logiciels/{lib,include} /local/henry/libfac/WORK.LOG
gmp 4.2.1 /opt/csw/(lib,include)
gc gc-7.0.tar.gz /local/henry/logiciels/{lib,include} /local/henry/gc-7.0/{WORK,CHECK}.LOG
gdbm 1.8.3 /opt/csw/(lib,include)
ntl or Singular-ntl ntl-5.4.1.tar.gz /local/henry/logiciels/{lib,include} /local/henry/ntl-5.4.1/src/{MAKE,INSTALL}.LOG

compilation version stable (tout est recompilé)

Les librairies nécessaires

nom archive installée dans logs
Singular-Factory factory-3-0-2.tar.gz /local/henry/logiciels/{lib,include} /local/henry/factory/{WORK,MAKE_GFTABLES,INSTALL}.LOG
Singular-Libfac libfac-3-0-2.tar.gz /local/henry/logiciels/{lib,include} /local/henry/libfac/WORK.LOG
gmp 4.2.2 /local/henry/logiciels/{lib,include} /local/henry/gmp-4.2.2/WORK.LOG
gc gc-7.0.tar.gz /local/henry/logiciels/{lib,include} /local/henry/gc-7.0/{WORK,CHECK}.LOG
gdbm 1.8.3 /local/henry/logiciels/{lib,include} /local/henry/gdbm-1.8.3/WORK.LOG
readline 5.2 /local/henry/logiciels/{lib,include} /local/henry/readline-5.2/WORK.LOG
ncurses 5.6 /local/henry/logiciels/{lib,include} /local/henry/ncurses-5.6/WORK.LOG
ntl or Singular-ntl ntl-5.4.1.tar.gz /local/henry/logiciels/{lib,include} /local/henry/ntl-5.4.1/src/{MAKE,INSTALL}.LOG

La compilation échoue:

../c/scc1 -dep -J. ../../../Macaulay2/d/C.d
../../../Macaulay2/c/chk.c:2512: assertion failed
../../../Macaulay2/c/readfile.c:273: <- here
make[2]: *** [C.dep] Error 1
make[2]: Leaving directory `/local/henry/M2/BUILD/Macaulay2/d'

version svn

nemo-dgrayson% svn co svn://macaulay2.math.uiuc.edu/Macaulay2/trunk/M2
...
Checked out revision 5981.
nemo-dgrayson% cd M2
/home/dgrayson/M2
nemo-dgrayson% make
+ autoconf
+ rm -f include/config.h.in.stamp
autoheader
touch "include/config.h.in.stamp"
--: The configure script in this directory has been prepared.
--: To configure and build Macaulay 2:
--:
     mkdir BUILD/normal
     cd BUILD/normal
     ../../configure --prefix=/usr/local
     make install
--:
--: To reconfigure and try again:
--:
     cd BUILD/normal
     make reconfigure install
--:
--: To see all the options to "configure":
--:
     ./configure --help
--:

1er problème: ne détecte pas la lib factory:

conftest.cpp:6: error: `SW_USE_NTL' undeclared (first use this function)

avec le code suivant:

#include <factoryconf.h>
extern const char * libfac_version;

int main () {
extern const char factoryVersion[];
return SW_USE_NTL;
return *factoryVersion;
return *libfac_version; }

mais SW_USE_NTL n'est déclaré nulle part! (grep -r SW_USE_NTL *). On le supprime!
Voir les modifs sur le configure.ac

diff ../../configure.ac ../../configure.ac.ori
413c413
< do eval BUILD_$i=yes
---
> do eval BUILD_$i=no
531,532c531,532
< test $BUILD_blas = yes && BUILTLIBS="-lsunperf $BUILTLIBS"
< test $BUILD_lapack = yes && BUILTLIBS="-lsunperf $BUILTLIBS"
---
> test $BUILD_blas = yes && BUILTLIBS="-lblas $BUILTLIBS"
> test $BUILD_lapack = yes && BUILTLIBS="-llapack $BUILTLIBS"
551a552
>                 return SW_USE_NTL;
591,594c592,595
< #for i in $LIBLIST
< #do eval t=\$BUILD_$i
< #   test "$t" = yes && LIBRARIES="$LIBRARIES $i"
< #done
---
> for i in $LIBLIST
> do eval t=\$BUILD_$i
>    test "$t" = yes && LIBRARIES="$LIBRARIES $i"
> done

et enfin, obligé de relinker /bin/sh sur /bin/bash (au lieu de /sbin/sh) sinon le make échoue immédiatement (grrr!)

Nouvelle erreur:

../../../../../Macaulay2/e/f4/../mem.hpp:123: error: `bzero' undeclared (first use this function)

pourquoi utiliser bzero() au lieu de memset()? bzero On remplace:

nemo-henry% cp -rp Macaulay2/e/f4/../mem.hpp Macaulay2/e/f4/../mem.hpp.ori
nemo-henry% diff Macaulay2/e/f4/../mem.hpp.ori Macaulay2/e/f4/../mem.hpp
7a8,9
> #define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
>

et toujours l'erreur:

../../../../Macaulay2/e/ntl-interface.cpp:56: error: expected unqualified-id before numeric constant
../../../../Macaulay2/e/ntl-interface.cpp:56: error: expected `,' or `;' before numeric constant

corrigée par:

nemo-henry% diff Macaulay2/e/ntl-interface.cpp Macaulay2/e/ntl-interface.cpp.ori
56,58d55
< #if defined(__sun) && defined(__SVR4)
< #undef GS
< #endif

mais finalement, échoue sur:

../c/scc1 -dep -J. ../../../../Macaulay2/d/C.d
../../../../Macaulay2/c/chk.c:2512: assertion failed
../../../../Macaulay2/c/readfile.c:274: <- here
make[2]: *** [C.dep] Error 1
make[2]: Leaving directory `/local/henry/Macaulay2/subversion/M2/BUILD/normal/Macaulay2/d'
restart: done
make[1]: *** [all] Error 2
make[1]: Leaving directory `/local/henry/Macaulay2/subversion/M2/BUILD/normal/Macaulay2'
make: *** [all] Error 2
make: Leaving directory `/local/henry/Macaulay2/subversion/M2/BUILD/normal'

En utilisant le debugger:

nemo-henry% dbx ../c/scc1
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
Reading scc1
Reading ld.so.1
Reading libgc.so.1.0.3
Reading libm.so.2
Reading libc.so.1
Reading libpthread.so.1
Reading librt.so.1
Reading libdl.so.1
Reading libgcc_s.so.1
Reading libaio.so.1
Reading libmd5.so.1
(dbx) list                                  
(dbx) stop at 189
(2) stop at "scc1.c":189
(dbx) run -dep -J. ../../../../Macaulay2/d/C.d
Running: scc1 -dep -J. ../../../../Macaulay2/d/C.d 
(process id 8680)
t@1 (l@1) signal SEGV (no mapping at the fault address) in GC_SysVGetDataStart at 0xfef766dc
0xfef766dc: GC_SysVGetDataStart+0x0069: movb     (%edx),%dl
Current function is newnode1
   23        char *p = malloc(n);
(dbx) where
current thread: t@1
  [1] GC_SysVGetDataStart(0x1000, 0x8082ae4, 0xfefc0270, 0x620, 0xfef751b1), at 0xfef766dc 
  [2] GC_register_data_segments(0xfef70d16, 0x14, 0x0, 0x0, 0x10, 0xfef8e128), at 0xfef7673e 
  [3] GC_init_inner(0x0, 0xfefc0270, 0x1, 0xfef79e04, 0x80472b0, 0xfef93214), at 0xfef751b1 
  [4] GC_generic_malloc_many(0x28, 0x1, 0x98, 0xfef79c87), at 0xfef70d16 
  [5] GC_malloc(0x27, 0xfefca924, 0xfeffcc58, 0xfef6bf0b), at 0xfef79d4e 
  [6] GC_debug_malloc(0x14, 0x807f178, 0x17, 0xfedb63c0), at 0xfef6bf2b 
=>[7] newnode1(len = 0, tag = 134509400), line 23 in "scc1.c"
  [8] UniqueStringN(s = 0x808288a "do", len = 0), line 233 in "dictionary.c"
  [9] UniqueString(s = 0x808288a "do"), line 18 in "type.c"
  [10] yyinit(), line 2837 in "grammar.c"
  [11] main(argc = 1, argv = 0x80475fc), line 188 in "scc1.c"

Problèmes

compilation de gmp

par défaut, le “make check” échoue pour gmp.

compilation de ntl

bien entendu, le configure ne prend pas tout en compte, du coup:

./configure PREFIX=$HOME/logiciels/64 \
GMP_PREFIX=$HOME/logiciels/64 \
NTL_GMP_LIP=on NTL_STD_CXX=on NTL_NO_INIT_TRANS=on NTL_CXX_ONLY=on \
CC=c++ \
CFLAGS="-m64" \
LDFLAGS="-m64 -R/usr/sfw/lib/64 -R$HOME/logiciels/64/lib" \

compilation de factory

LDFLAGS='-R$HOME/logiciels/64/lib -L$HOME/logiciels/64/lib' \
CFLAGS="-O0 -g -m64" \
CXXFLAGS="-g -O0 --no-rtti --no-exceptions -m64" \
LDFLAGS="-m64 -R/usr/sfw/lib/64 -R$HOME/logiciels/64/lib" \
./configure --prefix=$HOME/logiciels/64 \
--enable-NTL \
--with-gmp=$HOME/logiciels/64/include,$HOME/logiciels/64/lib

compilation de macaulay2

cette erreur:

 ** compiling ../../../Macaulay2/e/ntl_interface.cpp
../../../Macaulay2/e/ntl_interface.cpp:56: error: expected unqualified-id before numeric constant
../../../Macaulay2/e/ntl_interface.cpp:56: error: expected `,' or `;' before numeric constant
make[2]: *** [ntl_interface.o] Error 1

se résoud de la façon suivante:

nemo-henry% cp -rp ../Macaulay2/e/ntl_interface.cpp ../Macaulay2/e/ntl_interface.cpp.ori
nemo-henry% diff ../Macaulay2/e/ntl_interface.cpp.ori ../Macaulay2/e/ntl_interface.cpp
55a56
> #undef GS