Simplified naming and compilation.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 14 Jun 2017 21:06:47 +0000 (23:06 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 14 Jun 2017 21:06:47 +0000 (23:06 +0200)
Makefile
README.md
build.py
flatland-test.py

index 1bdce0a..166d6ff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -30,11 +30,14 @@ CXXFLAGS += -I/usr/include/cairo -DCAIRO_SUPPORT
 
 LDFLAGS += -lcairo
 
 
 LDFLAGS += -lcairo
 
-all: flatland_generator.so TAGS
+all: flatland TAGS
 
 TAGS: *.cc *.h
        etags *.cc *.h
 
 
 TAGS: *.cc *.h
        etags *.cc *.h
 
+flatland: flatland_generator.so
+       ./build.py
+
 flatland_generator.so: \
        sequence_generator.o misc.o \
        polygon.o universe.o \
 flatland_generator.so: \
        sequence_generator.o misc.o \
        polygon.o universe.o \
@@ -45,6 +48,6 @@ Makefile.depend: *.h *.cc Makefile
        $(CC) $(CXXFLAGS) -M *.cc > Makefile.depend
 
 clean:
        $(CC) $(CXXFLAGS) -M *.cc > Makefile.depend
 
 clean:
-       \rm -f flatland *.o *.so Makefile.depend
+       \rm -rf flatland *.o *.so Makefile.depend
 
 -include Makefile.depend
 
 -include Makefile.depend
index 1bf3e1f..9e8e3b3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -39,6 +39,5 @@ small images), the simulation may be stuck.
 
 ```
 make -j -k
 
 ```
 make -j -k
-./build.py
 ./flatland-test.py
 ```
 ./flatland-test.py
 ```
index 7df40c0..3078209 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -27,7 +27,7 @@ from torch.utils.ffi import create_extension
 abs_path = os.path.dirname(os.path.abspath(__file__))
 
 ffi = create_extension(
 abs_path = os.path.dirname(os.path.abspath(__file__))
 
 ffi = create_extension(
-    '_ext.flatland',
+    'flatland',
     headers = [ 'flatland.h' ],
     sources = [ 'flatland.c' ],
     extra_objects = [ abs_path + '/flatland_generator.so' ],
     headers = [ 'flatland.h' ],
     sources = [ 'flatland.c' ],
     extra_objects = [ abs_path + '/flatland_generator.so' ],
index 8d9f11b..2c269ba 100755 (executable)
@@ -25,7 +25,7 @@ import torch
 import torchvision
 import argparse
 
 import torchvision
 import argparse
 
-from _ext import flatland
+import flatland
 
 ######################################################################
 
 
 ######################################################################