Skip to content

Commit

Permalink
Should now build on Linux, Windows problems tbd
Browse files Browse the repository at this point in the history
git-svn-id: https://ipvs.informatik.uni-stuttgart.de/SGpp/repos/trunk@5276 4eea3252-f0fb-4393-894d-40516dce545b
  • Loading branch information
Sekuraz committed Nov 25, 2015
1 parent ddaed0c commit 9d49203
Show file tree
Hide file tree
Showing 12 changed files with 2,373 additions and 31 deletions.
22 changes: 22 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ vars.Add(BoolVariable('OPT', "Sets optimization on and off", False))
# for compiling on LRZ without errors: omit unit tests
vars.Add(BoolVariable('NO_UNIT_TESTS', 'Omit UnitTests if set to True', False))
vars.Add(BoolVariable('SG_PYTHON', 'Build with python Support', 'SG_PYTHON' in languageSupportNames))
vars.Add(BoolVariable('PYDOC', 'Build python wrapper with comments', 'SG_PYTHON' in languageSupportNames))
vars.Add(BoolVariable('SG_JAVA', 'Build with java Support', 'SG_JAVA' in languageSupportNames))


for moduleName in moduleNames:
vars.Add(BoolVariable(moduleName, 'Build the module ' + moduleName, True))

Expand Down Expand Up @@ -206,11 +208,13 @@ installTargetList = []
testTargetList = []
boostTestTargetList = []
exampleTargetList = []
pydocTargetList = []
env.Export('libraryTargetList')
env.Export('installTargetList')
env.Export('testTargetList')
env.Export('boostTestTargetList')
env.Export('exampleTargetList')
env.Export('pydocTargetList')

# compile selected modules
flattenedDependencyGraph = []
Expand All @@ -229,6 +233,24 @@ for moduleFolder in moduleFolders:

Export('flattenedDependencyGraph')

if env['PYDOC']:
with open('moduleDoxy', 'r') as template:
data = template.read()
for module in moduleFolders:
print module
with open(os.path.join(module, 'Doxyfile'), 'w') as doxyFile:
doxyFile.write(data.replace('$modname', module))

doxy_env = env.Clone()

doxygen = doxy_env.Command(os.path.join(module, 'doc/xml/index.xml'), '', 'doxygen ' + os.path.join(module, 'Doxyfile'))
doxy2swig = doxy_env.Command(os.path.join(module, 'doc/doc.i'), doxygen, "python pysgpp/doxy2swig.py -o -c $SOURCE $TARGET")
for root, dirs, files in os.walk(os.path.join(module, 'src')):
for file in files:
doxy_env.Depends(doxygen, os.path.join(root, file))
doxy_env.Depends(doxy2swig, os.path.join(root, file))
pydocTargetList.append(doxy2swig)

if env['SG_PYTHON']:
env.SConscript('#/pysgpp/SConscript', {'env': env, 'moduleName': "pysgpp"})

Expand Down
8 changes: 4 additions & 4 deletions combigrid/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2008-today The SG++ Project
# This file is part of the SG++ project. For conditions of distribution and
# use, please see the copyright notice provided with SG++ or at
# use, please see the copyright notice provided with SG++ or at
# sgpp.sparsegrids.org

import os
Expand Down Expand Up @@ -48,7 +48,7 @@ else:
source=objs,
LIBPATH=BUILD_DIR,
LIBS=moduleDependencies)

for lib_str in moduleDependencies:
if lib_str.startswith("sgpp"):
env.Depends(lib, os.path.join("#", BUILD_DIR.path,
Expand All @@ -60,8 +60,8 @@ libInstall = env.Install(BUILD_DIR, lib)

if not env['NO_UNIT_TESTS'] and env['SG_PYTHON']:
Import('testTargetList')
moduleTest = env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
env.Requires(moduleTest, libInstall)
py_test_env = env.Clone()
moduleTest = py_test_env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
testTargetList.append(moduleTest)

for fileName in os.listdir("examples"):
Expand Down
6 changes: 3 additions & 3 deletions datadriven/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else:
LINKFLAGS=['/DEF:' + os.path.join(moduleName, '%s.def' % libname)])
env.Depends(cmd, objs)
env.Depends(lib, cmd)
else:
else:
lib = env.SharedLibrary(target=libname,
source=objs,
LIBPATH=BUILD_DIR,
Expand All @@ -108,8 +108,8 @@ libInstall = env.Install(BUILD_DIR, lib)

if not env['NO_UNIT_TESTS'] and env['SG_PYTHON']:
Import('testTargetList')
moduleTest = env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
env.Requires(moduleTest, libInstall)
py_test_env = env.Clone()
moduleTest = py_test_env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
testTargetList.append(moduleTest)

example_env = env.Clone()
Expand Down
8 changes: 4 additions & 4 deletions finance/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2008-today The SG++ project
# This file is part of the SG++ project. For conditions of distribution and
# use, please see the copyright notice provided with SG++ or at
# use, please see the copyright notice provided with SG++ or at
# sgpp.sparsegrids.org

import os
Expand Down Expand Up @@ -68,7 +68,7 @@ else:
LINKFLAGS=['/DEF:' + os.path.join(moduleName, '%s.def' % libname)])
env.Depends(cmd, objs)
env.Depends(lib, cmd)
else:
else:
lib = env.SharedLibrary(target=libname,
source=objs,
LIBPATH=BUILD_DIR,
Expand All @@ -85,8 +85,8 @@ libInstall = env.Install(BUILD_DIR, lib)

if not env['NO_UNIT_TESTS'] and env['SG_PYTHON']:
Import('testTargetList')
moduleTest = env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
env.Requires(moduleTest, libInstall)
py_test_env = env.Clone()
moduleTest = py_test_env.Test(os.path.join('tests', 'test_%s.py' % moduleName))
testTargetList.append(moduleTest)

for fileName in os.listdir("examples"):
Expand Down
4 changes: 2 additions & 2 deletions misc/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2008-today The SG++ project
# This file is part of the SG++ project. For conditions of distribution and
# use, please see the copyright notice provided with SG++ or at
# use, please see the copyright notice provided with SG++ or at
# sgpp.sparsegrids.org

import os
Expand Down Expand Up @@ -66,7 +66,7 @@ else:
LINKFLAGS=['/DEF:' + os.path.join(moduleName, '%s.def' % libname)])
env.Depends(cmd, objs)
env.Depends(lib, cmd)
else:
else:
lib = env.SharedLibrary(target=libname,
source=objs,
LIBPATH=BUILD_DIR,
Expand Down
Loading

0 comments on commit 9d49203

Please sign in to comment.