Skip to content

Commit

Permalink
add lua to python build
Browse files Browse the repository at this point in the history
  • Loading branch information
hughperkins committed Jun 25, 2015
1 parent ea76ecd commit ccf2a3a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ build-win64/
build-*/
build.old/
install/
build2/
build3/
build4/
build5/

node_modules/
data/
Expand Down
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ endif(LIBJPEG_AVAILABLE)
add_executable( deepcl_train src/main/train.cpp src/util/stringhelper.cpp )
add_executable( deepcl_predict src/main/predict.cpp src/util/stringhelper.cpp )

# create 'aliases', for backwards compatibility
add_executable( train src/main/train.cpp src/util/stringhelper.cpp )
add_executable( predict src/main/predict.cpp src/util/stringhelper.cpp )
add_executable( deepclrun src/main/train.cpp src/util/stringhelper.cpp )
add_executable( deepclexec src/main/predict.cpp src/util/stringhelper.cpp )

add_executable( cifar-to-mat test/CifarToMat.cpp src/util/stringhelper.cpp test/CifarLoader.cpp )
add_executable( prepare-norb test/prepare-norb.cpp src/util/stringhelper.cpp )
add_executable( mnist-to-floats test/mnist-to-floats.cpp src/util/stringhelper.cpp )
Expand All @@ -181,17 +175,17 @@ else()
endif()
include_directories( thirdparty/gtest )

add_executable( unittests ${UNITTEST_SOURCES} test/gtest_main.cpp test/GtestGlobals.cpp
add_executable( deepcl_unittests ${UNITTEST_SOURCES} test/gtest_main.cpp test/GtestGlobals.cpp
test/TestArgsParser.cpp )
target_link_libraries( unittests deepcl_gtest )
target_link_libraries( deepcl_unittests deepcl_gtest )

if( PROTOTYPING )
add_executable( clconvolve-fixedweights prototyping/clconvolve-fixedweights.cpp src/util/stringhelper.cpp )
add_executable( learn_scenario_image prototyping/qlearning/learnScenarioImage.cpp
prototyping/qlearning/ScenarioImage.cpp )
endif( PROTOTYPING )

target_link_libraries( unittests DeepCL )
target_link_libraries( deepcl_unittests DeepCL )

add_executable( testgtestsupp test/testgtestsupp.cpp thirdparty/gtest/gtest_main.cc )
target_link_libraries( testgtestsupp deepcl_gtest )
Expand Down
2 changes: 1 addition & 1 deletion python/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ include mysrc/*
include *.pxd
include *.pyx
include version.txt
recursive-include mysrc *.txt *.cpp *.h *.cl
recursive-include mysrc *.txt *.cpp *.h *.cl *.c

15 changes: 13 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
if arg in ('sdist','bdist','bdist_egg','build_ext'):
docopy = True

srcdirs = ['activate','batch','clmath','conv','dropout','fc','forcebackprop',
srcdirs = ['lua', 'activate','batch','clmath','conv','dropout','fc','forcebackprop',
'input','layer','loaders','loss','net','netdef','normalize','patches',
'pooling','trainers','util','weights', 'qlearning' ]

Expand All @@ -51,6 +51,8 @@
os.makedirs('mysrc/util')
if not os.path.isdir('mysrc/templates'):
os.makedirs('mysrc/templates')
if not os.path.isdir('mysrc/lua'):
os.makedirs('mysrc/lua')
for thisdir in ['../src','../EasyCL',
'../EasyCL/thirdparty/clew/src']: # copy everything..
for thisfile in os.listdir(thisdir):
Expand All @@ -64,6 +66,13 @@
thisfilepath = thisdir +'/' + thisfile
if os.path.isfile(thisfilepath):
distutils.file_util.copy_file( thisfilepath, 'mysrc/util/' + thisfile )
for thisdir in ['../EasyCL/thirdparty/lua-5.1.5/src']:
for thisfile in os.listdir(thisdir):
#print(thisfile)
thisfilepath = thisdir +'/' + thisfile
if os.path.isfile(thisfilepath):
distutils.file_util.copy_file( thisfilepath, 'mysrc/lua/' + thisfile )
distutils.file_util.copy_file('../EasyCL/thirdparty/lua-5.1.5/files.txt', 'mysrc/lua/files.txt')
for thisdir in ['../EasyCL/templates']:
for thisfile in os.listdir(thisdir):
#print(thisfile)
Expand All @@ -72,6 +81,8 @@
distutils.file_util.copy_file( thisfilepath, 'mysrc/templates/' + thisfile )
distutils.file_util.copy_file( '../jenkins/version.txt', 'version.txt' )
for srcdir in srcdirs:
if srcdir == 'lua':
continue
if not os.path.isdir('mysrc/' + srcdir):
os.makedirs('mysrc/' + srcdir)
for thisfile in os.listdir('../src/' + srcdir):
Expand Down Expand Up @@ -246,7 +257,7 @@ def lib_build_dir():
+ easyclsources
+ deepcl_sources,
# glob.glob('DeepCL/EasyCL/*.h'),
include_dirs = ['mysrc'],
include_dirs = ['mysrc', 'mysrc/lua'],
libraries= libraries,
extra_compile_args=compile_options,
define_macros = [('DeepCL_EXPORTS',1),('EasyCL_EXPORTS',1)],
Expand Down

0 comments on commit ccf2a3a

Please sign in to comment.