X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=flatland.git;a=blobdiff_plain;f=build.py;h=b3c7b919dccb669fe12a7f3952c1fd9e195b8267;hp=4f00b970e75d44e724a3fc40fbec43f6ed0e3930;hb=HEAD;hpb=26abc735ca75a78974c7ced091035e8c27ca1c00 diff --git a/build.py b/build.py index 4f00b97..b3c7b91 100755 --- a/build.py +++ b/build.py @@ -1,23 +1,40 @@ -#!/usr/bin/env python-for-pytorch +#!/usr/bin/env python -import os -from torch.utils.ffi import create_extension +# +# flatland is a simple 2d physical simulator +# +# Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ +# Written by Francois Fleuret +# +# This file is part of flatland +# +# flatland is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# flatland is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with flatland. If not, see . +# -this_file = os.path.dirname(__file__) +from os import path +from torch.utils.ffi import create_extension -print('__file__', __file__) +abs_path = path.dirname(path.abspath(__file__)) ffi = create_extension( - '_ext.mylib', - headers = [ 'mylib.h' ], - sources = [ 'mylib.c' ], - extra_objects = [ '/home/fleuret/sources/python/flatland/flatland.so' ], + 'flatland', + headers = [ 'flatland.h' ], + sources = [ 'flatland.c' ], + extra_objects = [ abs_path + '/libflatland.so' ], libraries = [ ], library_dirs = [ ], define_macros = [ ], - relative_to=this_file, with_cuda = False ) -if __name__ == '__main__': - ffi.build() +ffi.build()