[TOPCOM] Initial import.

Jerry James jjames at fedoraproject.org
Fri Mar 30 15:14:43 UTC 2012


commit d8a02f5ace58fe8bea97f78d1f30515e59592e70
Author: Jerry James <loganjerry at gmail.com>
Date:   Fri Mar 30 09:14:27 2012 -0600

    Initial import.

 .gitignore         |    2 +
 TOPCOM-Makefile    |  132 ++++++++++++++++++++++++++++++++++++++++++++++++
 TOPCOM-gcc47.patch |   11 ++++
 TOPCOM.spec        |  142 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources            |    2 +
 5 files changed, 289 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..070d0d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/TOPCOM-0.17.1.tar.gz
+/TOPCOM-man.tar.xz
diff --git a/TOPCOM-Makefile b/TOPCOM-Makefile
new file mode 100644
index 0000000..d3d8b80
--- /dev/null
+++ b/TOPCOM-Makefile
@@ -0,0 +1,132 @@
+# Makefile written by Jerry James <loganjerry at gmail.com>
+# and released into the public domain.
+
+version = @version@
+major = @major@
+minor = @minor@
+
+INCLUDES = -Ilib-src -Ilib-src-reg -Iwrap-gmp-gmpxx -I/usr/include/cddlib
+CPPFLAGS = $(INCLUDES) -DPACKAGE=\"TOPCOM\" -DVERSION=\"$(version)\" \
+ -DVERBOSE -DGMPRATIONAL -ftemplate-depth=35
+CFLAGS = $(CPPFLAGS) @RPM_OPT_FLAGS@
+LIB_LDFLAGS = -Wl,--as-needed -lcddgmp -lgmpxx -lgmp
+LDFLAGS = -Wl,--as-needed -L. -lTOPCOM -lcddgmp -lgmpxx -lgmp
+SHFLAGS = -shared -Wl,-h,libTOPCOM.so.$(major)
+bindir = @bindir@
+libdir = @libdir@
+includedir = @includedir@/TOPCOM
+
+library_sources = \
+	lib-src-reg/SPXinterface.cc \
+	lib-src-reg/LPinterface.cc \
+	lib-src-reg/RegularityCheck.cc \
+	lib-src/Admissibles.cc \
+	lib-src/CheckTriang.cc \
+	lib-src/Circuits.cc \
+	lib-src/Cocircuits.cc \
+	lib-src/CommandlineOptions.cc \
+	lib-src/CompressedIntegerSet.cc \
+	lib-src/ComputeTriangs.cc \
+	lib-src/Facets.cc \
+	lib-src/FastSimplicialComplex.cc \
+	lib-src/Field.cc \
+	lib-src/FineTriang.cc \
+	lib-src/Flip.cc \
+	lib-src/IndexTableArray.cc \
+	lib-src/IntegerSet.cc \
+	lib-src/InteriorFacets.cc \
+	lib-src/MarkedFlips.cc \
+	lib-src/Matrix.cc \
+	lib-src/Permutation.cc \
+	lib-src/PlacingTriang.cc \
+	lib-src/PointConfiguration.cc \
+	lib-src/RealChiro.cc \
+	lib-src/SimplicialComplex.cc \
+	lib-src/SimplicialComplexTemplate.cc \
+	lib-src/SparseIntegerSet.cc \
+	lib-src/SparseSimplicialComplex.cc \
+	lib-src/StairCaseMatrix.cc \
+	lib-src/SymmetricBFS.cc \
+	lib-src/Symmetry.cc \
+	lib-src/TriangFlips.cc \
+	lib-src/TriangNode.cc \
+	lib-src/Vector.cc \
+	lib-src/VertexFacetTable.cc \
+	lib-src/VertexFacetTableArray.cc \
+	lib-src/VirtualChiro.cc
+library_objs = $(library_sources:%.cc=%.o)
+
+bin_sources = \
+	src-reg/checkregularity.cc \
+	src/B_A.cc \
+	src/B_A_center.cc \
+	src/B_D.cc \
+	src/bench.cc \
+	src/chiro2allfinetriangs.cc \
+	src/chiro2alltriangs.cc \
+	src/chiro2circuits.cc \
+	src/chiro2cocircuits.cc \
+	src/chiro2dual.cc \
+	src/chiro2finetriang.cc \
+	src/chiro2finetriangs.cc \
+	src/chiro2mintriang.cc \
+	src/chiro2nallfinetriangs.cc \
+	src/chiro2nalltriangs.cc \
+	src/chiro2nfinetriangs.cc \
+	src/chiro2ntriangs.cc \
+	src/chiro2placingtriang.cc \
+	src/chiro2triangs.cc \
+	src/cocircuits2facets.cc \
+	src/cross.cc \
+	src/cube.cc \
+	src/cyclic.cc \
+	src/hypersimplex.cc \
+	src/lattice.cc \
+	src/points2allfinetriangs.cc \
+	src/points2alltriangs.cc \
+	src/points2chiro.cc \
+	src/points2facets.cc \
+	src/points2finetriang.cc \
+	src/points2finetriangs.cc \
+	src/points2flips.cc \
+	src/points2nallfinetriangs.cc \
+	src/points2nalltriangs.cc \
+	src/points2nfinetriangs.cc \
+	src/points2nflips.cc \
+	src/points2ntriangs.cc \
+	src/points2placingtriang.cc \
+	src/points2triangs.cc \
+	src/points2volume.cc \
+	src/santos_22_triang.cc \
+	src/santos_dim4_triang.cc \
+	src/santos_triang.cc
+bin_exes = $(bin_sources:%.cc=%)
+
+all: $(bin_exes)
+
+libTOPCOM.so.$(major).$(minor): $(library_objs)
+	$(CXX) $(CFLAGS) $(SHFLAGS) -o $@ $^ $(LIB_LDFLAGS)
+	ln -s libTOPCOM.so.$(major).$(minor) libTOPCOM.so.$(major)
+	ln -s libTOPCOM.so.$(major) libTOPCOM.so
+
+lib-src-reg/%.o: lib-src-reg/%.cc
+	$(CXX) $(CFLAGS) -fPIC -c -o $@ $^
+
+lib-src/%.o: lib-src/%.cc
+	$(CXX) $(CFLAGS) -fPIC -c -o $@ $^
+
+src-reg/%: src-reg/%.cc libTOPCOM.so.$(major).$(minor)
+	$(CXX) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+src/%: src/%.cc libTOPCOM.so.$(major).$(minor)
+	$(CXX) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+install: $(bin_exes)
+	install -d $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
+	install -p -m 0755 libTOPCOM.so.$(major).$(minor) $(DESTDIR)$(libdir)
+	ln -s libTOPCOM.so.$(major).$(minor) $(DESTDIR)$(libdir)/libTOPCOM.so.$(major)
+	ln -s libTOPCOM.so.$(major) $(DESTDIR)$(libdir)/libTOPCOM.so
+	install -p -m 0755 $(bin_exes) $(DESTDIR)$(bindir)
+	install -p -m 0644 wrap-gmp-gmpxx/*.h $(DESTDIR)$(includedir)
+	install -p -m 0644 lib-src-reg/*.hh $(DESTDIR)$(includedir)
+	install -p -m 0644 lib-src/*.hh $(DESTDIR)$(includedir)
diff --git a/TOPCOM-gcc47.patch b/TOPCOM-gcc47.patch
new file mode 100644
index 0000000..cce1c45
--- /dev/null
+++ b/TOPCOM-gcc47.patch
@@ -0,0 +1,11 @@
+--- ./lib-src/PlainHashIndexTable.hh.orig	2011-06-20 06:58:56.000000000 -0600
++++ ./lib-src/PlainHashIndexTable.hh	2012-03-28 16:36:08.189453905 -0600
+@@ -55,7 +55,7 @@
+     return *_index_data[index];
+   }
+   inline const size_type get_index(const Key& key) {
+-    const dataptr_type& indexptr(member(key));
++    const dataptr_type& indexptr(this->member(key));
+     if (indexptr) {
+       return *indexptr;
+     }
diff --git a/TOPCOM.spec b/TOPCOM.spec
new file mode 100644
index 0000000..bacfc37
--- /dev/null
+++ b/TOPCOM.spec
@@ -0,0 +1,142 @@
+Name:           TOPCOM
+Version:        0.17.1
+Release:        3%{?dist}
+Summary:        Triangulations Of Point Configurations and Oriented Matroids
+
+Group:          Applications/Engineering
+License:        GPLv2+
+URL:            http://www.rambau.wm.uni-bayreuth.de/TOPCOM/
+Source0:        http://www.rambau.wm.uni-bayreuth.de/Software/%{name}-%{version}.tar.gz
+# Man pages, written by Jerry James using text from the sources.  Therefore,
+# these man pages have the same copyright and license as the sources.
+Source1:        %{name}-man.tar.xz
+# A replacement Makefile.  See the %%build section for more information.
+Source2:        %{name}-Makefile
+# Patch sent upstream 28 Mar 2012.  Adapt to restricted C++ lookups in GCC 4.7.
+Patch0:         %{name}-gcc47.patch
+
+BuildRequires:  cddlib-devel
+BuildRequires:  gmp-devel
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%global topcom_major $(echo %{version} | cut -d. -f1)
+%global topcom_minor $(echo %{version} | cut -d. -f2)
+
+%description
+TOPCOM is a package for computing Triangulations Of Point Configurations
+and Oriented Matroids.  It was very much inspired by the maple program
+PUNTOS, which was written by Jesus de Loera.  TOPCOM is entirely written
+in C++, so there is a significant speed up compared to PUNTOS.
+
+%package devel
+Summary:        Header files needed to build with %{name}
+Group:          Development/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+Requires:       cddlib-devel%{?_isa}
+Requires:       gmp-devel%{?_isa}
+
+%description devel
+Header files needed to build applications that use the %{name} library.
+
+%package libs
+Summary:        Core %{name} functionality in a library
+Group:          Development/Libraries
+
+%description libs
+Command line tools that expose %{name} library functionality.
+
+%prep
+%setup -q
+%setup -q -T -D -a 1
+%patch0
+
+# Fix character encoding
+iconv -f iso8859-1 -t utf8 -o README.utf8 README
+touch -r README README.utf8
+mv -f README.utf8 README
+
+# Fix the FSF's address
+for f in COPYING README; do
+  sed -i.orig \
+    's/59 Temple Place, Suite 330, Boston, MA  02111-1307/51 Franklin Street, Suite 500, Boston, MA  02110-1335/' \
+    $f
+  touch -r $f.orig $f
+  rm -f $f.orig
+done
+
+%build
+# We cannot use upstream's build system.  It has the following problems.
+# (1) It builds two static libraries, libTOPCOM.a and libCHECKREG.a, then
+#     includes both libraries in each of the 38 binaries that it installs in
+#     %%{_bindir}.
+# (2) Each of libTOPCOM.a and libCHECKREG.a refers to symbols defined by the
+#     other.
+# (3) It builds static gmp and cddlib libraries, which are also linked into
+#     all of the constructed binaries.  There is no way to make it use the
+#     installed versions of those libraries instead.
+# We could fix (3) with a little build system hackery.  We could fix (1) by
+# building shared libraries, but that doesn't help with (2).  Instead, we pull
+# in our own evilly constructed Makefile to build a single shared library
+# containing all of the object files in both libTOPCOM.a and libCHECKREG.a,
+# and link the binaries against that and the system gmp and cddlib libraries.
+sed -e "s|@RPM_OPT_FLAGS@|${RPM_OPT_FLAGS}|" \
+    -e "s|@bindir@|%{_bindir}|" \
+    -e "s|@libdir@|%{_libdir}|" \
+    -e "s|@includedir@|%{_includedir}|" \
+    -e "s|@version@|%{version}|" \
+    -e "s|@major@|%{topcom_major}|" \
+    -e "s|@minor@|%{topcom_minor}|" \
+    %{SOURCE2} > Makefile
+make %{?_smp_mflags}
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+# Fix a too-generic name
+mv $RPM_BUILD_ROOT%{_bindir}/bench $RPM_BUILD_ROOT%{_bindir}/%{name}_bench
+
+# Get rid of the Makefiles in the examples dir before packaging
+rm -f examples/Makefile*
+
+# Install the man pages
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man7
+cd man
+for f in *.1; do
+  sed -i "s/@version@/%{version}/" $f > $RPM_BUILD_ROOT%{_mandir}/man1/$f
+  touch -r $f $RPM_BUILD_ROOT%{_mandir}/man1/$f
+done
+for f in *.7; do
+  sed -i "s/@version@/%{version}/" $f > $RPM_BUILD_ROOT%{_mandir}/man7/$f
+  touch -r $f $RPM_BUILD_ROOT%{_mandir}/man7/$f
+done
+
+
+%post libs -p /sbin/ldconfig
+
+%postun libs -p /sbin/ldconfig
+
+%files
+%doc examples
+%{_bindir}/*
+%{_mandir}/man1/*
+%{_mandir}/man7/*
+
+%files devel
+%{_includedir}/%{name}/
+%{_libdir}/*.so
+
+%files libs
+%doc AUTHORS ChangeLog COPYING README
+%{_libdir}/*.so.*
+
+%changelog
+* Thu Mar 29 2012 Jerry James <loganjerry at gmail.com> - 0.17.1-3
+- Preserve timestamps when installing
+- Move most of the doc files to the -libs subpackage
+
+* Wed Mar 28 2012 Jerry James <loganjerry at gmail.com> - 0.17.1-2
+- Fix build failure due to restricted C++ lookups in GCC 4.7
+
+* Tue Oct 18 2011 Jerry James <loganjerry at gmail.com> - 0.17.1-1
+- Initial RPM
diff --git a/sources b/sources
index e69de29..fc8df10 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+eb9472f9ad66e00c568744a19156fccd  TOPCOM-0.17.1.tar.gz
+56e58edcc50ade7594bb37e41351b1c9  TOPCOM-man.tar.xz


More information about the scm-commits mailing list