Changeset bbeddf in git


Ignore:
Timestamp:
Nov 15, 2013, 5:13:23 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
989d6be2dba06d1abec8f5c86bd77f2a001e1e4d
Parents:
1684c331ce908bffa043d3afe97c0a2c4b181d99
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-11-15 17:13:23+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-11-15 17:17:40+01:00
Message:
Fixed BS: gfanlib/cddlib checking/building/embedding

fix: cddlib configure checks
add: static building-in
fix: return code for _mod_init functions
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Singular/mod_lib.h

    r1684c3 rbbeddf  
    99lib_types type_of_LIB(const char *newlib, char *fullname);
    1010
     11
     12#if HAVE_GFANLIB
     13#define SI_BUILTIN_GFANLIB(add) add(gfanlib)
     14#else
     15#define SI_BUILTIN_GFANLIB(add)
     16#endif
     17
     18
    1119#ifdef EMBED_PYTHON
    12 #define SI_BUILTIN_PYOBJECT(add) add(pyobject) add(syzextra)
     20#define SI_BUILTIN_PYOBJECT(add) add(pyobject)  add(syzextra)      SI_BUILTIN_GFANLIB(add)
    1321//TODO: the line above means that syzextra should be staticly embedded IFF pyobjects do so :(
    1422#else
  • dyn_modules/callgfanlib/Makefile.am

    r1684c3 rbbeddf  
    11ACLOCAL_AMFLAGS = -I ../../m4
    22
    3 moduledir = $(libexecdir)/singular/MOD
    4 
    5 if HAVE_GFANLIB
    6 if ENABLE_P_PROCS_DYNAMIC
    7   module_LTLIBRARIES=gfanlib.la
    8 endif
    9 endif
    10 
    11 
    12 CXXTEMPLFLAGS   =
    13 ## -fno-implicit-templates
    14 ## --no-exceptions
    15 
    16 # DEBUGCXXFLAGS = -g -Wextra -Wall -pedantic -Wno-long-long ${CXXTEMPLFLAGS}
    17 #
    18 # NODEBUGCFLAGS   = -O3 -w -fomit-frame-pointer ${PIPE}
    19 # NODEBUGCXXFLAGS = -O3 -w -fomit-frame-pointer ${CXXTEMPLFLAGS}
    20 # ##  --no-rtti ?
    21 # NODEBUGDEFS = -DNDEBUG -DOM_NDEBUG
    22 
    23 # -DHAVE_CONFIG_H??
     3SOURCES = bbcone.cc bbcone.h bbfan.cc bbfan.h bbpolytope.cc bbpolytope.h gfan.h gitfan.cc gitfan.h gfanlib.cc
    244
    255MYINCLUDES =  -I${top_srcdir} -I${top_builddir} -I${srcdir} \
     
    288$(FACTORY_CFLAGS) $(NTL_CFLAGS) $(GMP_CFLAGS)
    299
    30 #### AM_LDFLAGS = -release ${PACKAGE_VERSION}
    31 #  -L${abs_top_builddir}/gfanlib/
    32 # -L${top_builddir}/Singular -L${top_builddir}/numeric -L${top_builddir}/kernel \
    33 # -L${top_builddir}/libpolys/polys $(USE_FACTORY) -L${top_builddir}/omalloc -L${top_builddir}/resources
    34 
    35 
    36 
    37 SOURCES = bbcone.cc bbcone.h bbfan.cc bbfan.h bbpolytope.cc bbpolytope.h gfan.h gitfan.cc gitfan.h gfanlib.cc
    38 gfanlib_la_SOURCES   = $(SOURCES)
    39 # gfanlib_g_la_SOURCES = $(SOURCES)
    40 
    41 P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION
    42 
    43 gfanlib_la_CPPFLAGS   = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON}
    44 # ${NODEBUGDEFS}
    45 # gfanlib_g_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON}
    46 
    47 # gfanlib_la_CXXFLAGS   = ${NODEBUGCXXFLAGS}
    48 # gfanlib_g_la_CXXFLAGS = ${DEBUGCXXFLAGS}
    49 
    50 
    51 gfanlib_la_LIBADD = ${abs_top_builddir}/gfanlib/libgfan.la ${CDDGMPLDFLAGS}
    52 # gfanlib_g_la_LIBADD = ${gfanlib_la_LIBADD}
     10if HAVE_GFANLIB
     11  module_LTLIBRARIES=gfanlib.la
     12endif
    5313
    5414if ENABLE_P_PROCS_DYNAMIC
    55   P_PROCS_MODULE_LDFLAGS = ${AM_LDFLAGS} -module -export-dynamic -avoid-version -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup
     15  moduledir = $(libexecdir)/singular/MOD
     16  P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION
     17# Add under Mac OS X: -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup
    5618else
    57   P_PROCS_MODULE_LDFLAGS = ${AM_LDFLAGS}
     19  moduledir = $(libdir)/singular
     20  P_PROCS_CPPFLAGS_COMMON = -DSTATIC_VERSION
    5821endif
    5922
    60 # Add under Mac OS X: -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup
     23P_PROCS_MODULE_LDFLAGS =  -module -export-dynamic -avoid-version -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup
    6124
    62 gfanlib_la_LDFLAGS = ${P_PROCS_MODULE_LDFLAGS}
    63 # gfanlib_g_la_LDFLAGS = ${P_PROCS_MODULE_LDFLAGSG}
     25gfanlib_la_SOURCES  = $(SOURCES)
     26gfanlib_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON}
     27gfanlib_la_LDFLAGS  = ${AM_LDFLAGS} ${P_PROCS_MODULE_LDFLAGS}
    6428
    65 
     29gfanlib_la_LIBADD   = ${abs_top_builddir}/gfanlib/libgfan.la ${CDDGMPLDFLAGS}
    6630
    6731
  • dyn_modules/callgfanlib/gfanlib.cc

    r1684c3 rbbeddf  
    99#include <bbpolytope.h>
    1010#include <gitfan.h>
    11 #include "Singular/ipid.h"
     11
     12#include <Singular/ipid.h>
     13#include <Singular/mod_lib.h>
    1214
    1315template class gfan::Vector<gfan::Integer>;
     
    1618template class gfan::Matrix<gfan::Rational>;
    1719
    18 extern "C" int mod_init(SModulFunctions* p)
     20int SI_MOD_INIT(gfanlib)(SModulFunctions* p)
    1921{
    2022  bbcone_setup(p);
     
    2224  bbpolytope_setup(p);
    2325  gitfan_setup(p);
     26  return 0;
    2427}
     28
     29#ifndef EMBED_PYTHON
     30extern "C"
     31{
     32int mod_init(SModulFunctions* psModulFunctions)
     33{
     34  return SI_MOD_INIT(gfanlib)(psModulFunctions);
     35}
     36}
     37#endif
  • gfanlib/Makefile.am

    r1684c3 rbbeddf  
    33if HAVE_GFANLIB
    44  libgfan_LTLIBRARIES=libgfan.la
    5 # if WANT_DEBUG
    6 #   libgfan_LTLIBRARIES+=libgfan_g.la
    7 # endif
    85endif
    96
    107libgfandir = $(libdir)/
    118
    12 #CXXTEMPLFLAGS =-ftrapv
    13 ### -fno-implicit-templates
    14 
    15 #libgfan_la_CFLAGS   = -O3 -fpermissive -fomit-frame-pointer ${PIPE}
    16 #libgfan_g_la_CFLAGS = ${PIPE}
    17 
    18 # libgfan_la_CXXFLAGS   = -O3 -fpermissive -fomit-frame-pointer ${PIPE} ${CXXTEMPLFLAGS} -fno-exceptions -fno-rtti
    19 # libgfan_g_la_CXXFLAGS = -g -Wextra -Wall -pedantic -Wno-long-long ${PIPE} ${CXXTEMPLFLAGS}
    20 # -fdiagnostics-show-option
    21 
    229AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -DGMPRATIONAL -DHAVE_CONFIG_H
    23 
    24 # libgfan_la_CPPFLAGS   = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG
    25 # libgfan_g_la_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H
    2610
    2711SOURCES  = gfanlib_zcone.cpp gfanlib_symmetry.cpp gfanlib_symmetriccomplex.cpp gfanlib_polyhedralfan.cpp gfanlib_zfan.cpp gfanlib_polymakefile.cpp
    2812libgfan_la_SOURCES   = $(SOURCES)
    29 # libgfan_g_la_SOURCES = $(SOURCES)
    3013
    3114libgfan_includedir  =$(includedir)/gfanlib/
  • gfanlib/configure.ac

    r1684c3 rbbeddf  
    2424
    2525# Checks for libraries.
    26 
    2726LT_INIT
    2827
     
    3029AC_HEADER_STDC
    3130
    32 LB_CHECK_GMP(4.0,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
    33 SING_CHECK_GFANLIB
    34 
    35 # AC_CHECK_HEADERS([gmp.h])
    36 # if test "$ac_cv_header_gmp_h" == no
    37 # then
    38 #       AC_MSG_WARN([Error, gmp.h is missing!])
    39 #       exit 1
    40 # fi
    41 AC_CHECK_HEADERS([cdd/setoper.h setoper.h cddlib/setoper.h])
    42 # if test "$ac_cv_header_setoper_h" == no -a "$ac_cv_header_cdd_setoper_h" == no -a "$ac_cv_header_cddlib_setoper_h" == no
    43 #then
    44 #       AC_MSG_WARN([Error, setoper.h is missing!])
    45 #fi
    46 
    47 # if setoper.h is there, assume that also cdd.h is there
    48 
    49 #if test "x$ENABLE_GFANLIB" = xyes; then
    50 #if test "$ac_cv_header_setoper_h" == no -a "$ac_cv_header_cdd_setoper_h" == no -a "$ac_cv_header_cddlib_setoper_h" == no
    51 #then
    52 ###     exit 0
    53 #fi
    54 #fi
    55 
    5631# Checks for typedefs, structures, and compiler characteristics.
    5732AC_C_INLINE
    5833
     34LB_CHECK_GMP(4.0,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
     35
     36SING_CHECK_GFANLIB
    5937
    6038#AC_MSG_RESULT($ac_cv_singuname)
  • m4/gfanlib-check.m4

    r1684c3 rbbeddf  
    99[ENABLE_GFANLIB="no"])
    1010
    11 BACKUP_LIBS=$LIBS
     11AC_MSG_CHECKING(whether to build with gfanlib)
    1212
    13 AC_MSG_CHECKING(whether to build with gfanlib)
    1413if test "x$ENABLE_GFANLIB" = xyes; then
    1514 AC_MSG_RESULT(yes)
     15
     16 AC_CHECK_HEADERS([setoper.h cdd/setoper.h cddlib/setoper.h])
     17
     18 if test "$ac_cv_header_setoper_h" == no -a "$ac_cv_header_cdd_setoper_h" == no -a "$ac_cv_header_cddlib_setoper_h" == no
     19 then
     20        AC_MSG_WARN([Error, setoper.h is missing!])
     21 fi
     22
     23 AC_MSG_CHECKING([whether libcddgmp is usable])
     24
     25 BACKUP_LIBS=$LIBS
     26
     27 LIBS="-lcddgmp $GMP_LIBS $LIBS"
     28
    1629 AC_LANG_PUSH(C++)
    17  SAVE_LIBS=$LIBS
    18  LIBS="-lcddgmp $GMP_LIBS $LIBS"
    19 AC_LINK_IFELSE(
    20   [AC_LANG_PROGRAM([#include <cdd/setoper.h>
    21   #include <cdd/cdd.h>],
    22     [dd_set_global_constants()])],
    23   [LIBS="-lcddgmp $SAVE_LIBS"] [CDDGMPLDFLAGS="-lcddgmp"]
    24   [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
    25   [AC_MSG_WARN([libcddgmp is not installed.])]
    26   [PASSED_ALL_TESTS_FOR_GFANLIB="no"
    27   ]
    28 )
    29 if test "$PASSED_ALL_TESTS_FOR_GFANLIB" != yes; then
    30 AC_LINK_IFELSE(
    31   [AC_LANG_PROGRAM([#include <setoper.h>
    32   #include "cdd.h"],
    33     [dd_set_global_constants()])],
    34   [LIBS="$SAVE_LIBS -lcddgmp"] [CDDGMPLDFLAGS="-lcddgmp"]
    35   [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
    36   [AC_MSG_WARN([libcddgmp is not installed.])]
    37   [PASSED_ALL_TESTS_FOR_GFANLIB="no"
    38   ]
    39 )
    40 fi
    41 if test "$PASSED_ALL_TESTS_FOR_GFANLIB" != yes; then
    42 AC_LINK_IFELSE(
    43   [AC_LANG_PROGRAM([#include <cddlib/setoper.h>
    44   #include "cddlib/cdd.h"],
    45     [dd_set_global_constants()])],
    46   [LIBS="$SAVE_LIBS -lcddgmp"] [CDDGMPLDFLAGS="-lcddgmp"]
    47   [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
    48   [AC_MSG_WARN([libcddgmp is not installed.])]
    49   [PASSED_ALL_TESTS_FOR_GFANLIB="no"
    50   ]
    51 )
    52 fi
    53   AC_LANG_POP()
     30 AC_LINK_IFELSE(
     31  [
     32   AC_LANG_PROGRAM(
     33    [
     34     #ifdef HAVE_SETOPER_H
     35     # include <setoper.h>
     36     # include <cdd.h>
     37     #endif
     38     #ifdef HAVE_CDD_SETOPER_H
     39     # include <cdd/setoper.h>
     40     # include <cdd/cdd.h>
     41     #endif
     42     #ifdef HAVE_CDDLIB_SETOPER_H
     43     # include <cddlib/setoper.h>
     44     # include <cddlib/cdd.h>
     45     #endif
     46    ], [dd_set_global_constants()]    )
     47  ],
     48  [PASSED_ALL_TESTS_FOR_GFANLIB="1"] [CDDGMPLDFLAGS="-lcddgmp"],
     49  [PASSED_ALL_TESTS_FOR_GFANLIB="0"]
     50 )
     51 AC_LANG_POP()
     52
     53 LIBS=$BACKUP_LIBS
     54
     55 AC_MSG_RESULT(no)
     56
     57 AC_SUBST(CDDGMPLDFLAGS)
    5458else
    5559 AC_MSG_RESULT(no)
    56  PASSED_ALL_TESTS_FOR_GFANLIB="no";
     60 PASSED_ALL_TESTS_FOR_GFANLIB="0"
    5761fi
    5862
    59 LIBS=$BACKUP_LIBS
    6063
    61 AM_CONDITIONAL(HAVE_GFANLIB, test "x$PASSED_ALL_TESTS_FOR_GFANLIB" = xyes)
     64AM_CONDITIONAL(HAVE_GFANLIB, test "x$PASSED_ALL_TESTS_FOR_GFANLIB" = x1)
     65AC_DEFINE_UNQUOTED(HAVE_GFANLIB, ${PASSED_ALL_TESTS_FOR_GFANLIB}, [whether gfanlib support is enabled])
    6266
    6367])
Note: See TracChangeset for help on using the changeset viewer.