Skip to content

recipes for igraph, a hi-performance library of graph algorithms #171

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

Merged
merged 8 commits into from
Nov 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions recipes/c_igraph/Makefile.am.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
68,72d67
< f2c/arith.h: f2c/arithchk.c
< $(CC) $(CFLAGS) -DNO_FPINIT f2c/arithchk.c -lm -o f2c/arith || \
< $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT f2c/arithchk.c \
< $(WARNING_CFLAGS) -lm -o f2c/arith
< f2c/arith > f2c/arith.h
6 changes: 6 additions & 0 deletions recipes/c_igraph/arith.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#define IEEE_8087
#define Arith_Kind_ASL 1
#define Double_Align
#define NANCHECK
#define QNaN0 0x0
#define QNaN1 0x7ff80000
11 changes: 11 additions & 0 deletions recipes/c_igraph/config.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- build/c_igraph/igraph-0.6.5/config.h 2013-11-05 14:10:26.285433616 -0500
+++ config.h 2013-11-05 14:12:36.431283045 -0500
@@ -53,7 +53,7 @@
/* #undef HAVE_LOG2 */

/* Define to 1 if you have the `logbl' function. */
-/* #undef HAVE_LOGBL */
+#define HAVE_LOGBL 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
53 changes: 53 additions & 0 deletions recipes/c_igraph/recipe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Recipe for igraph, a high performance graph library in C: http://igraph.org
#
# Written by Zachary Spector: https://github.com/LogicalDash/
#
#

VERSION_c_igraph=${VERSION_c_igraph:0.6.5}

DEPS_c_igraph=()

URL_c_igraph=http://downloads.sourceforge.net/project/igraph/C%20library/0.6.5/igraph-0.6.5.tar.gz

MD5_c_igraph=5f9562263ba78b31c564d6897ff5a110

BUILD_c_igraph=$BUILD_PATH/c_igraph/$(get_directory $URL_c_igraph)

RECIPE_c_igraph=$RECIPES_PATH/c_igraph

function prebuild_c_igraph() {
true
}

function shouldbuild_c_igraph() {
if [ -e $BUILD_c_igraph/.built ]; then
export DO_BUILD=0;
fi
}

function build_c_igraph() {
cd $BUILD_c_igraph

push_arm
try patch $BUILD_c_igraph/src/Makefile.am $RECIPE_c_igraph/Makefile.am.patch
export OLD_CPPFLAGS="$CPPFLAGS"
export CPPFLAGS="$CPPFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -L$ANDROIDNDK/platforms/android-$ANDROIDAPI/arch-arm/usr/lib"
try ./configure --prefix="$BUILD_PATH/python-install" --build=i686-pc-linux-gnu --host=arm-linux-eabi
export CPPFLAGS="$OLD_CPPFLAGS"
try cp -f $RECIPE_c_igraph/arith.h $BUILD_c_igraph/src/f2c/arith.h
try patch $BUILD_c_igraph/src/f2c/sysdep1.h $RECIPE_c_igraph/sysdep1.h.patch
try patch $BUILD_c_igraph/src/f2c/uninit.c $RECIPE_c_igraph/uninit.c.patch
try patch $BUILD_c_igraph/config.h $RECIPE_c_igraph/config.h.patch
try $MAKE
try $MAKE install

pop_arm
touch .built
}

function postbuild_c_igraph() {
true
}
7 changes: 7 additions & 0 deletions recipes/c_igraph/sysdep1.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
16a17
> /*android doesn't like these
18c19,20
< #define OFF_T __off64_t
---
> #define OFF_T __off64_t*/
> #define OFF_T long
23 changes: 23 additions & 0 deletions recipes/c_igraph/uninit.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
276c276,277
< #include <fpu_control.h>
---
> //doesn't exist on Android
> //#include <fpu_control.h>
334a336
> /*
336c338
< #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)
---
> #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)*/
343a346
> /*
345c348
< #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)
---
> #define RQD_FPU_MASK (_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_ZM)*/
350a354
> /*
352c356
< #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z)
---
> #define RQD_FPU_MASK (_FPU_MASK_O+_FPU_MASK_V+_FPU_MASK_Z)*/
47 changes: 47 additions & 0 deletions recipes/igraph/Makefile.am.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
170c170,180
< scg_headers.h igraph_hacks_internal.h
---
> scg_headers.h igraph_hacks_internal.h \
> arpackobject.h \
> pyattributes.h bfsiter.h \
> common.h convert.h \
> edgeobject.h edgeseqobject.h \
> error.h filehandle.h \
> graphobject.h igraphmodule_api.h \
> indexing.h platform.h \
> py2compat.h pyhelpers.h \
> pyrandom.h vertexobject.h \
> vertexseqobject.h
260c270,287
< qsort.c qsort_r.c types.c hacks.c
---
> qsort.c qsort_r.c types.c hacks.c \
> arpackobject.c \
> pyattributes.c \
> bfsiter.c \
> common.c \
> convert.c \
> edgeobject.c \
> edgeseqobject.c \
> error.c \
> filehandle.c \
> graphobject.c \
> igraphmodule.c \
> indexing.c \
> py2compat.c \
> pyhelpers.c \
> pyrandom.c \
> vertexobject.c \
> vertexseqobject.c
263,265c290,292
< libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
< libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS)
< libigraph_la_LDFLAGS = -no-undefined
---
> libigraph_la_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
> libigraph_la_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(WARNING_CFLAGS) -IBUILD_PATH/python-install/include/python2.7
> libigraph_la_LDFLAGS = -no-undefined -LBUILD_PATH/python-install/lib -IBUILD_PATH/python-install/include/python2.7
267c294
< $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB)
---
> $(LAPACK_LIB) $(ARPACK_LIB) $(GLPK_LIB) $(PLFIT_LIB) -lpython2.7
2 changes: 2 additions & 0 deletions recipes/igraph/config.h.in.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1a2
> #define HAVE_LOGBL 1
2 changes: 2 additions & 0 deletions recipes/igraph/config.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2a3
> #define HAVE_LOGBL 1
4 changes: 4 additions & 0 deletions recipes/igraph/configure.ac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
43c43
< AC_CHECK_FUNCS([expm1 rint rintf finite log2 logbl snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy])
---
> AC_CHECK_FUNCS([expm1 rint rintf finite log2 snprintf log1p round fabsl fmin strcasecmp isnan strdup _strdup ftruncate stpcpy])
3 changes: 3 additions & 0 deletions recipes/igraph/get_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from distutils.util import get_platform
from sys import version
print get_platform() + '-' + version[:3]
42 changes: 42 additions & 0 deletions recipes/igraph/recipe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# Recipe for the Python interface to igraph, a high-performance graph library in C: http://igraph.org/
#
# Written by Zachary Spector: https://github.com/LogicalDash/

VERSION_igraph=${VERSION_igraph:0.6.5}

DEPS_igraph=(c_igraph python)

URL_igraph=http://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.6.5.tar.gz

MD5_igraph=c626585baf003af855c0dc4eec0c9baa

BUILD_igraph=$BUILD_PATH/igraph/$(get_directory $URL_igraph)

RECIPE_igraph=$RECIPES_PATH/igraph


function prebuild_igraph() {
patch setup.py $RECIPE_igraph/setup.py.patch
}

function shouldbuild_igraph() {
if [ -e $BUILD_igraph/.built ]; then
export DO_BUILD=0;
fi
}

function build_igraph() {
cd $BUILD_igraph
push_arm

try $HOSTPYTHON setup.py build_ext -I"$BUILD_PATH/python-install/include/igraph:$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include" -L"$BUILD_PATH/python-install/lib:$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi" -l gnustl_static -p arm-gnueabi install

pop_arm
touch .built
}

function postbuild_igraph() {
true
}
50 changes: 50 additions & 0 deletions recipes/igraph/setup.py.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--- /home/sanotehu/Downloads/python-igraph-0.6.5/setup.py 2013-02-27 06:04:09.000000000 -0500
+++ build/igraph/python-igraph-0.6.5/setup.py 2013-11-06 08:54:17.944200143 -0500
@@ -19,7 +19,7 @@
from shutil import copy2
from subprocess import Popen, PIPE

-LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['/usr/include/igraph', '/usr/local/include/igraph']
+LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ['../../python-install/include/igraph', '../../python-install/include/python2.7']
LIBIGRAPH_FALLBACK_LIBRARIES = ['igraph']
LIBIGRAPH_FALLBACK_LIBRARY_DIRS = []

@@ -40,26 +40,15 @@

def detect_igraph_include_dirs(default = LIBIGRAPH_FALLBACK_INCLUDE_DIRS):
"""Tries to detect the igraph include directory"""
- line, exit_code = get_output("pkg-config igraph --cflags")
- if exit_code > 0 or len(line) == 0:
- return default
- opts=line.split()
- return [opt[2:] for opt in opts if opt.startswith("-I")]
+ return default

def detect_igraph_libraries(default = LIBIGRAPH_FALLBACK_LIBRARIES):
"""Tries to detect the libraries that igraph uses"""
- line, exit_code = get_output("pkg-config igraph --libs")
- if exit_code>0 or len(line) == 0:
- return default
- opts=line.split()
- return [opt[2:] for opt in opts if opt.startswith("-l")]
+ return default

def detect_igraph_library_dirs(default = LIBIGRAPH_FALLBACK_LIBRARY_DIRS):
"""Tries to detect the igraph library directory"""
- line, exit_code = get_output("pkg-config igraph --libs")
- if exit_code>0 or len(line) == 0: return default
- opts=line.split()
- return [opt[2:] for opt in opts if opt[0:2]=="-L"]
+ return default

sources=glob.glob(os.path.join('src', '*.c'))
include_dirs=[]
@@ -113,7 +102,7 @@
Many thanks to the maintainers of this page!
"""

-plat = get_platform()
+plat = 'arm-gnueabi'
options = dict(
name = 'python-igraph',
version = '0.6.5',