Skip to content

Commit

Permalink
Wrap up igraph bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dnery committed Jun 12, 2017
1 parent 5b292b3 commit 51cdd8f
Show file tree
Hide file tree
Showing 36 changed files with 59,034 additions and 177,856 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
*.zip
*.pdf
*.txt
*.o
*.a
*.lo
*.la
*.so
*.so.*
.libs/
image_to_graph
image_to_graph.out*
1 change: 1 addition & 0 deletions .syntastic_clang_check_config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-std=c++11
-stdlib=libstdc++
-I ./igraph/include
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
all:
@echo "Build the dependencies, the local program and then run some tests:"
@echo " make deps"
@echo " make build"
@echo " make tests"

.PHONY: deps build tests clean cleandeps

deps:
@cd igraph && autoreconf -f -i && ./configure && cd ..
$(MAKE) -C igraph
g++ image_to_graph.cc -o image_to_graph -Wall -ligraph `pkg-config --cflags --libs opencv`

config:
cd igraph && ./configure && cd ..
build:
g++ image_to_graph.cc -o image_to_graph -Wall -I ./igraph/include -L ./igraph/src/.libs -ligraph `pkg-config --cflags --libs opencv`

.PHONY: clean allclean
tests:
@echo "Test: Lena"
LD_LIBRARY_PATH=./igraph/src/.libs ./image_to_graph assets/lena.jpg && python display_graph.py assets/lena.jpg
@echo "Test: Shapes"
LD_LIBRARY_PATH=./igraph/src/.libs ./image_to_graph assets/shapes.png && python display_graph.py assets/shapes.png
@echo "Test: Jacobite"
LD_LIBRARY_PATH=./igraph/src/.libs ./image_to_graph assets/jacobite.jpg && python display_graph.py assets/jacobite.jpg
@echo "Test: Arara"
LD_LIBRARY_PATH=./igraph/src/.libs ./image_to_graph assets/arara.jpg && python display_graph.py assets/arara.jpg

clean:
rm -f image_to_graph

allclean:
cleandeps:
$(MAKE) -C igraph clean
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
You'll need OpenCV for this. The igraph package is also needed and it's included.
You'll need to have installed on your system:
- automake/autoconf/autoreconf (Linux package)
- OpenCV (opencv2 headers & python3 package)
- Matplotlib (python3)
- NetworkX (python3)
- Numpy (python3)


The `igraph` C library is also used and bundled together. It takes a few minutes
to build (`make deps` step), so just hang in there.


Compile:
```
make config
make
make deps
make build
```

Run stack:

Run tests:
```
./image_to_graph <input_image> && python display_graph.py <input_image>
make tests
```
4 changes: 2 additions & 2 deletions igraph/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================

Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
Expand Down
68 changes: 42 additions & 26 deletions igraph/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.

# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -15,7 +15,17 @@



am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
Expand Down Expand Up @@ -79,24 +89,18 @@ POST_UNINSTALL = :
build_triplet = x86_64-unknown-linux-gnu
host_triplet = x86_64-unknown-linux-gnu
subdir = .
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(srcdir)/igraph.pc.in \
$(srcdir)/igraph_Info.plist.in \
$(top_srcdir)/include/igraph_version.h.in \
$(top_srcdir)/include/igraph_threading.h.in COPYING TODO \
compile config.guess config.sub install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/tools/autoconf/ax_tls.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = igraph.pc igraph_Info.plist \
CONFIG_CLEAN_FILES = igraph.pc igraph_Info.plist doc/Makefile \
include/igraph_version.h include/igraph_threading.h
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
Expand Down Expand Up @@ -185,6 +189,13 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/igraph.pc.in $(srcdir)/igraph_Info.plist.in \
$(top_srcdir)/doc/Makefile.in \
$(top_srcdir)/include/igraph_threading.h.in \
$(top_srcdir)/include/igraph_version.h.in AUTHORS COPYING \
ChangeLog INSTALL NEWS README TODO compile config.guess \
config.sub install-sh ltmain.sh missing ylwrap
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
Expand Down Expand Up @@ -227,15 +238,15 @@ distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing aclocal-1.14
ACLOCAL = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing aclocal-1.15
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AR = ar
AS = as
AUTOCONF = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing autoconf
AUTOHEADER = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing autoheader
AUTOM4TE = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing autom4te
AUTOMAKE = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing automake-1.14
AUTOMAKE = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing automake-1.15
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
Expand Down Expand Up @@ -277,6 +288,7 @@ LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
LTLIBOBJS =
LT_SYS_LIBRARY_PATH =
MAKEINFO = ${SHELL} /home/danilo/Projects/DIP/DIP-project/igraph/missing makeinfo
MANIFEST_TOOL = :
MKDIR_P = /usr/bin/mkdir -p
Expand Down Expand Up @@ -397,7 +409,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
Expand Down Expand Up @@ -435,6 +446,8 @@ igraph.pc: $(top_builddir)/config.status $(srcdir)/igraph.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
igraph_Info.plist: $(top_builddir)/config.status $(srcdir)/igraph_Info.plist.in
cd $(top_builddir) && $(SHELL) ./config.status $@
doc/Makefile: $(top_builddir)/config.status $(top_srcdir)/doc/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
include/igraph_version.h: $(top_builddir)/config.status $(top_srcdir)/include/igraph_version.h.in
cd $(top_builddir) && $(SHELL) ./config.status $@
include/igraph_threading.h: $(top_builddir)/config.status $(top_srcdir)/include/igraph_threading.h.in
Expand Down Expand Up @@ -644,7 +657,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)

dist-bzip2: distdir
Expand All @@ -660,17 +673,17 @@ dist-xz: distdir
$(am__post_remove_distdir)

dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)

dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)

dist-zip: distdir
Expand All @@ -688,7 +701,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
Expand All @@ -698,22 +711,23 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
Expand Down Expand Up @@ -896,6 +910,8 @@ uninstall-am: uninstall-pkgconfigDATA
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-pkgconfigDATA

.PRECIOUS: Makefile


tests/testsuite:
cd tests && make testsuite
Expand Down
Loading

0 comments on commit 51cdd8f

Please sign in to comment.