Skip to content

Commit

Permalink
Added C inference extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cwacek committed Sep 6, 2013
1 parent a571e5b commit 6788d1d
Show file tree
Hide file tree
Showing 18 changed files with 2,960 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

28 changes: 28 additions & 0 deletions c_extensions/inferrer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Compiled Dynamic libraries
*.so
*.dylib

# # Compiled Static libraries
*.lai
*.la
*.a

# Object files
*.o
*.ko

# Libraries
*.lib
*.a

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

Makefile.in
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt
47 changes: 47 additions & 0 deletions c_extensions/inferrer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
TARGET = as_infer
LIBS = -L../hiredis/ -lhiredis -L/usr/local/lib64
SRC = infer.cc logger.cc structures.cc
CMD_SRC = cmdline.cc main.cc
CC = g++
CFLAGS = -g -Wall -std=c++0x
PROD_CFLAGS = -g -Wall -std=c++0x -O2
TESTDIR = test

.PHONY: default all clean cmdline test lib

default: $(TARGET)
all: default

cmdline.cc: opts.ggo
gengetopt -c cc < opts.ggo

OBJECTS = $(patsubst %.cc, %.o, $(SRC))
HEADERS = $(wildcard *.h)

%.o: %.cc $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(CMD_SRC) $(OBJECTS)
$(CC) $(CFLAGS) -c $(CMD_SRC)
$(CC) $(CFLAGS) $(OBJECTS) $(patsubst %.cc, %.o, $(CMD_SRC)) -pg -Wall $(LIBS) -o $@

production:
$(MAKE) CFLAGS="$(PROD_CFLAGS)" $(TARGET)
#$(CC) $(PROD_CFLAGS) -c $(CMD_SRC)
#$(CC) $(PROD_CFLAGS) $(OBJECTS) $(patsubst %.cc, %.o, $(CMD_SRC)) -Wall $(LIBS) -o $(TARGET)

lib: $(OBJECTS)
ar -rv libasinfer.a $(OBJECTS)

clean:
-rm -f *.o
-rm -f $(TARGET)
-rm -f libasinfer.a

test: lib
$(MAKE) -C $(TESTDIR)
test/test


Loading

0 comments on commit 6788d1d

Please sign in to comment.