Commit d36d6b54 authored by Andreas Enge's avatar Andreas Enge

Switch to autotools and organise code in subdirectories.

For the time being, deactivate CMH.

* pari-gnump-user.c, pari-gnump-user.h, pari-gnump.c, pari-gnump.h: Move to...
* src: ...this new subdirectory and remove references to CMH.
* tests.c: Move to...
* tests: ...this new subdirectory and disable printing.
* example.gp: Move to...
* gp: ...this new subdirectory and drop directory from library name.
* AUTHOR: Rename to...
* AUTHORS: ...this.
* Makefile: Remove.
* ChangeLog, INSTALL, NEWS: New (empty) files.
* configure.ac, Makefile.am, src/Makefile.am, tests/Makefile.am: New files.
parent eb2cda4a
export GUIX_LD_WRAPPER_ALLOW_IMPURITIES
DIR=${HOME}/.guix-profile
PARI=${DIR}
GMP=${DIR}
MPFR=${DIR}
MPC=${DIR}
CMH=${HOME}/local/cmh
# DO NOT CHANGE ANYTHING BEYOND THIS LINE #
VERSION=0.0.2dev
DISTDIR=pari-gnump-${VERSION}
INCLUDE=-I${PARI}/include -I${GMP}/include -I${MPFR}/include -I${MPC}/include -I${CMH}/include
LIB=-L${PARI}/lib -L${GMP}/lib -L${MPFR}/lib -L${MPC}/lib -L${CMH}/lib -lpari -lcmh -lmpc -lmpfr -lgmp
RPATH=-Wl,-rpath=${PARI}/lib -Wl,-rpath=${GMP}/lib -Wl,-rpath=${MPFR}/lib -Wl,-rpath=${MPC}/lib -Wl,-rpath=${CMH}/lib -Wl,-rpath=.
all : libpari-gnump.so
check : tests
${PARI}/bin/gp < example.gp
./tests
dist : clean
mkdir ${DISTDIR}
cp AUTHOR COPYING example.gp Makefile pari-gnump.c pari-gnump.h pari-gnump-user.c pari-gnump-user.h README tests.c ${DISTDIR}
tar zcvf ${DISTDIR}.tar.gz ${DISTDIR}/
tests : libpari-gnump.so tests.o
gcc -o tests tests.o libpari-gnump.so ${LIB} ${RPATH}
tests.o : tests.c pari-gnump.h
gcc -c tests.c ${INCLUDE}
libpari-gnump.so : pari-gnump.o pari-gnump-user.o
gcc -o libpari-gnump.so $^ -shared ${LIB} ${RPATH}
%.o : %.c %.h
gcc $< -c -fPIC ${INCLUDE}
clean :
-rm -rf *.o libpari-gnump.so tests ${DISTDIR} ${DISTDIR}.tgz
SUBDIRS = src tests
/*
Copyright © 2017 Andreas Enge <andreas.enge@inria.fr>
This file is part of pari-gnump.
Pari-gnump is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
Pari-gnump is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Pari-gnump. If not, see <http://www.gnu.org/licenses/>.
*/
AC_PREREQ(2.61)
AC_INIT(pari-gnump, 0.2dev, andreas.enge@inria.fr)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([src/pari-gnump.h])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
# Check for programs.
AC_PROG_CC
AC_LANG(C)
# Set up LibTool.
AC_PROG_LIBTOOL
# Check for libraries.
AC_CHECK_LIB([pari],[pari_init], ,
AC_MSG_ERROR([pari cannot be found.])
)
AC_CHECK_LIB([gmp],[__gmpz_init], ,
AC_MSG_ERROR([gmp cannot be found.])
)
AC_CHECK_LIB([mpfr],[mpfr_init])
AC_CHECK_LIB([mpc],[mpc_init2])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
AC_OUTPUT
......@@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License
along with Pari-gnump. If not, see <http://www.gnu.org/licenses/>.
*/
install ("pari_mpc_mul", "GGp", "mpc_mul", "./libpari-gnump.so");
install ("pari_mpfr_mul", "GGp", "mpfr_mul", "./libpari-gnump.so");
install ("pari_mpfr_erf", "Gp", "mpfr_erf", "./libpari-gnump.so");
install ("pari_mpfr_zeta", "Gp", "mpfr_zeta", "./libpari-gnump.so");
install ("pari_mpc_mul", "GGp", "mpc_mul", "libpari-gnump.so");
install ("pari_mpfr_mul", "GGp", "mpfr_mul", "libpari-gnump.so");
install ("pari_mpfr_erf", "Gp", "mpfr_erf", "libpari-gnump.so");
install ("pari_mpfr_zeta", "Gp", "mpfr_zeta", "libpari-gnump.so");
mpc_mul (1+2*I, 3-I)
(1+2*I) * (3-I)
......
lib_LTLIBRARIES = libpari-gnump.la
libpari_gnump_la_SOURCES = pari-gnump.h pari-gnump.c \
pari-gnump-user.h pari-gnump-user.c
libpari_gnump_la_LIBADD = @LTLIBOBJS@
include_HEADERS = pari-gnump.h pari-gnump-user.c
......@@ -119,6 +119,7 @@ GEN pari_mpfr_zeta (GEN x, long prec)
/****************************************************************************/
/****************************************************************************/
#if 0
GEN pari_cmh_I2I4I6I10 (GEN tau, long prec)
/* Returns the Igusa-Clebsch invariants I2, I4, I6, I10 in the 2x2-
period matrix tau of type t_MAT; since tau is assumed to be symmetric,
......@@ -239,4 +240,6 @@ GEN pari_cmh_10theta2 (GEN tau, long prec)
return gerepileupto (av, res);
}
#endif
......@@ -25,7 +25,9 @@ GEN pari_mpfr_mul (GEN x, GEN y, long prec);
GEN pari_mpfr_erf (GEN x, long prec);
GEN pari_mpfr_zeta (GEN x, long prec);
/*
GEN pari_cmh_I2I4I6I10 (GEN tau, long prec);
GEN pari_cmh_4theta (GEN tau, long prec);
GEN pari_cmh_10theta2 (GEN tau, long prec);
*/
......@@ -21,7 +21,9 @@ along with Pari-gnump. If not, see <http://www.gnu.org/licenses/>.
#include <limits.h>
#include <assert.h>
#include <mpc.h>
/*
#include <cmh.h>
*/
#include <pari/pari.h>
void mpz_set_GEN (mpz_ptr z, GEN x);
......
AM_CPPFLAGS = -I$(top_srcdir)/src
LDADD = $(top_builddir)/src/libpari-gnump.la
check_PROGRAMS = tests
TESTS = $(check_PROGRAMS)
......@@ -361,7 +361,6 @@ void test ()
int main ()
{
test ();
printf ("All library tests passed.\n");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment