-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade autotools & cleanup #1
Conversation
* Added AC_CONFIG_MACRO_DIR to configure.ac and associated ACLOCAL_AMFLAGS to Makefile.am * Replaced the INCLUDES variables in the Makefile.am files with AM_CPPFLAGS
…distcheck') can work
these should not be part of the git repository but only part of the released tarballs, see https://stackoverflow.com/a/3291181/812379
to create a releasable tarball
to restore generated files by autotools.
TODOThese files are part of the repository but not part of the tarball. Check which of the are actually missing:
These files are part of the tarball but not in the repository. That's ok. They are all generated by autotools.
|
Looking for "main" is cheating a bit (main is always there.) Instead we look for __gmpz_init as proposed by GMP. If GMP can not be found, we don't build the GMP enabled parts. Also this drops obsolete checks (according to autoconf's manual) such as AC_HEADER_STDC, AC_C_CONST (check that "const" is supported). cddlib.so is now in theory versioned. We probably want to stick to 0.0.0 as some people might rely on this? Finally, this drops a bunch of hackish variables in the .am files around GMP.
dc35bc0
to
c84d924
Compare
Debian and Archlinux each have a patch for that.
4d21aa1
to
a853266
Compare
I am not sure what to do with these source files:
They are apparently not used in any of the Makefiles. Is that on purpose or should they be built as well? |
I had a look at all the patches used elsewhere.
|
The author answered about the
So, I think it makes sense to build them, so the interested developer does not need to figure out how to do that. But they should not be installed. |
The author answered about the examples:
Since the documentation mentions these example files, they should probably be part of the documentation? Whether they get installed to |
and build all libraries in one directory
@komeifukuda dc05ae0 makes your sed script unnecessary I think. |
@komeifukuda strangely, --- src/testuniq.c 2018-04-22 22:25:01.636505790 +0200
+++ src-gmp/testuniq.c 2018-04-22 22:25:01.635505776 +0200
@@ -59,17 +59,15 @@
int main(int argc, char *argv[])
{
- dd_MatrixPtr M=NULL,M1=NULL,M2=NULL;
+ dd_MatrixPtr M=NULL,M1=NULL,M2=NULL,M3=NULL,M4=NULL;
dd_rowrange i;
dd_colrange d;
dd_ErrorType err=dd_NoError;
- dd_rowset redrows,linrows,posset;
- dd_rowindex newpos=NULL, newpos1=NULL, newpos2=NULL;
+ dd_rowset redrows,linrows;
+ dd_rowindex newpos1=NULL, newpos2=NULL,newpos4=NULL;
mytype val;
dd_DataFileType inputfile;
FILE *reading=NULL;
- int foi;
- dd_Arow certificate;
dd_set_global_constants(); /* First, this must be called. */
@@ -92,69 +90,67 @@
d=M->colsize;
- /*
printf("\nInput Matrix.\n");
- dd_WriteMatrix(stdout, M);
- */
-
- M1=dd_MatrixSortedUniqueCopy(M,&newpos1);
- printf("\nSort and remove duplicates with dd_MatrixSortedUniqueCopy.\n");
+ dd_WriteMatrix(stdout, M);
+ M1=dd_MatrixSortedCopy(M,&newpos1);
+ printf("\nNormalize and sort the matrix with dd_MatrixSortedCopy.\n");
printf(" Row index changes -- original:new\n");
for (i=1;i<=M->rowsize; i++){
printf(" %ld:%ld",i,newpos1[i]);
}
printf("\n");
- /* dd_WriteMatrix(stdout, M1); */
- dd_InitializeArow(M1->colsize+2, &certificate);
- fprintf(stdout, "\nCheck whether the system contains an implicit linearity.\n");
- foi=dd_FreeOfImplicitLinearity(M1, certificate, &posset, &err);
- switch (foi) {
- case 1:
- fprintf(stdout, " It is free of implicit linearity.\n");
- break;
-
- case 0:
- fprintf(stdout, " It is not free of implicit linearity.\n");
- break;
-
- case -1:
- fprintf(stdout, " The input system is trivial (i.e. the empty H-polytope or the V-rep of the whole space.\n");
- break;
+ dd_WriteMatrix(stdout, M1);
+
+ M2=dd_MatrixUniqueCopy(M1,&newpos2);
+ printf("\nRemove row (consecutive) duplicates with dd_MatrixUniqueCopy.\n");
+ printf(" Row index changes -- original:new\n");
+ for (i=1;i<=M1->rowsize; i++){
+ printf(" %ld:%ld",i,newpos2[i]);
+ }
+ printf("\n");
+ dd_WriteMatrix(stdout, M2);
+
+
+ M4=dd_MatrixSortedUniqueCopy(M,&newpos4);
+ printf("\nTwo operations can be done at once with dd_MatrixSortedUniqueCopy.\n");
+ printf(" Row index changes -- original:new\n");
+ for (i=1;i<=M->rowsize; i++){
+ printf(" %ld:%ld",i,newpos4[i]);
}
+ printf("\n");
+ dd_WriteMatrix(stdout, M4);
- fprintf(stdout, "\nOne can then remove nontrivial redundant rows with dd_RedundantRows.\n Redundant rows:\n");
- redrows=dd_RedundantRowsWithPresorting(M1, &err);
- /* redrows=dd_RedundantRows(M1, &err); */
+ fprintf(stdout, "\nOne can then remove nontrivial redundant rows with dd_RedundantRows.\n Redundant rows:");
+ redrows=dd_RedundantRows(M2, &err);
set_fwrite(stdout, redrows);
- printf("\n");
- M2=dd_MatrixSubmatrix2(M1, redrows, &newpos);
+ M3=dd_MatrixSubmatrix(M2, redrows);
dd_FreeMatrix(M1);
+ dd_FreeMatrix(M2);
set_free(redrows);
- free(newpos);
-
+
fprintf(stdout, " Implicit linearity (after removal of redundant rows): ");
- linrows=dd_ImplicitLinearityRows(M2, &err);
+ linrows=dd_ImplicitLinearityRows(M3, &err);
if (M->representation==dd_Generator)
fprintf(stdout," %ld ", set_card(linrows));
else
fprintf(stdout," %ld ", set_card(linrows));
set_fwrite(stdout,linrows);
- set_uni(M2->linset, M2->linset, linrows);
+ set_uni(M3->linset, M3->linset, linrows);
/* add the implicit linrows to the given linearity rows */
printf("\nNonredundant representation (except for the linearity part):\n");
- dd_WriteMatrix(stdout, M2);
- dd_WriteLPStats(stdout);
+ dd_WriteMatrix(stdout, M3);
set_free(linrows);
dd_FreeMatrix(M);
- dd_FreeMatrix(M2);
+ dd_FreeMatrix(M3);
+ dd_FreeMatrix(M4);
dd_clear(val);
- free(newpos1); free(newpos2);
+ free(newpos1); free(newpos2); free(newpos4);
_L99:;
/* if (err!=dd_NoError) dd_WriteErrorMessages(stderr,err); */ |
@komeifukuda Is there any reason why one would want to build the binaries without GMP support if GMP is available? I think it's a bit non-standard to build two flavours of every binary. |
Or rather: I think if one really wants this, then it should simply be:
|
So. What is the right default: with or without GMP support? @komeifukuda |
and don't install advanced binaries
4c2f282
to
c7f731b
Compare
c7f731b
to
f745518
Compare
so they should link against the headers in the paths provided by -I and not assume that the headers are available locally.
it worked locally because I do have cddlib installed
by putting pdflatex on the PATH
d04eea2
to
3c7c268
Compare
use awk instead to insert the first line
@komeifukuda I think I have fixed all the things that I wanted to. If you are happy with this this, just press "Merge pull request". Otherwise I am looking forward to hearing your suggestions. |
ade330a
to
c88174a
Compare
If you want to try this out:
|
Komei Fukuda wrote: > By the way, among the .c files in src directory not used, minkowski.c and > testuniq.c should be removed. > They and not complete and not meant to be distributed.
This tries to modernize the use of autotools in cddlib (see also https://groups.google.com/forum/#!msg/sage-devel/uHsTOd5sTxY/ivpNHT1MAwAJ)
Most significant changes:
./bootstrap
script to regenerate files used by autotools and friends.make distcheck
work again which createscddlib-0.94i.tar.gz
for distribution. (So in the future to create a releasable tarball one would increase the version number inconfigure.ac
, run./bootstrap
, run./configure
andmake distcheck
.)Many of the changes are originally due to @embray.
TODO
Check that this works for OSXOk. TravisCI takes care of that.Update the README so it talks aboutLet's postpone this to a separate PR. The README needs some fixes to make it looks nice on github anyway../bootstrap
for people who clone from here instead of downloading a tarball.Things such asI just setexport gmpdir := /usr/local
in Makefile.am seem dubious../configure
should decide that I guess?-lgmp
conditionally now. I think that's good enough for GMP (otherwise we could use pkg-config?) Note that this is also what most distributions patch into theconfigure.in
file.cddlib installs itself asThis can now be changed inlibcdd.so.0.0.0
andlibcddgmp.so.0.0.0
.configure.ac
.should the binaries really install toLet's put everything into/usr/bin/
? I do not really understand what people use in the end, but maybe some things should not be on thePATH
? (So maybe these should go into /usr/libexec instead? Or not be installed at all?)PREFIX/bin
for now.documentation does not install withIt does now.make install
. Should it?should the documentation be built as part ofthe currently distributed .pdf, .dvi, .ps is now built bymake dist
?make dist
.examples do not install withThey do now.make install
. Should they?