yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #03244
[Branch ~yade-dev/yade/trunk] Rev 1996: 1. Re-disable CInem{CNC, KNC}Engines (sorry, Jerome)
------------------------------------------------------------
revno: 1996
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-02-02 09:51:30 +0100
message:
1. Re-disable CInem{CNC,KNC}Engines (sorry, Jerome)
2. don't compile cxx main anymore; delete the executable from installation if present
3. Add help for --threads equali with OMP_NUM_THREADS
modified:
core/SConscript
core/main/main.cpp
core/main/main.py.in
gui/py/PythonUI.cpp
pkg/common/Engine/PartialEngine/CinemCNCEngine.cpp
pkg/common/Engine/PartialEngine/CinemKNCEngine.cpp
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'core/SConscript'
--- core/SConscript 2010-01-09 17:26:41 +0000
+++ core/SConscript 2010-02-02 08:51:30 +0000
@@ -15,7 +15,14 @@
env.SharedLibrary('boot',['main/pyboot.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['yade-support','core'])
])
-env.InstallAs('$PREFIX/bin/yade$SUFFIX-cxx',env.Program('yade',['main/main.cpp'],LIBS=env['LIBS']+['yade-support','core'],CPPDEFINES=env['CPPDEFINES']+[('YADE_VERSION','\\"'+env['version']+'\\"'),]))
+# env.InstallAs('$PREFIX/bin/yade$SUFFIX-cxx',env.Program('yade',['main/main.cpp'],LIBS=env['LIBS']+['yade-support','core'],CPPDEFINES=env['CPPDEFINES']+[('YADE_VERSION','\\"'+env['version']+'\\"'),]))
+## remove old executable
+## might be removed in the future
+import os.path, os
+cxxExec=env.subst('$PREFIX/bin/yade$SUFFIX-cxx')
+if os.path.exists(cxxExec):
+ print "Deleting old executable",cxxExec
+ os.remove(cxxExec)
env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
env.SharedLibrary('core',
=== modified file 'core/main/main.cpp'
--- core/main/main.cpp 2009-12-06 22:02:12 +0000
+++ core/main/main.cpp 2010-02-02 08:51:30 +0000
@@ -1,3 +1,7 @@
+/*****
+deprecated faile, will be removed
+*****/
+
/*************************************************************************
* Copyright (C) 2004 by Olivier Galizzi *
* olivier.galizzi@xxxxxxx *
@@ -197,9 +201,6 @@
Omega::instance().yadeConfigPath = configPath;
filesystem::path yadeConfigPath = filesystem::path(Omega::instance().yadeConfigPath, filesystem::native);
-#if 0
- filesystem::path yadeConfigFile = filesystem::path(Omega::instance().yadeConfigPath + "/preferences.xml", filesystem::native);
-#endif
/* see http://www.python.org/dev/peps/pep-0311 for threading with Python embedded */
@@ -229,26 +230,18 @@
}
#endif
- #if 0
- LOG_INFO("Loading "<<yadeConfigFile.string()); IOFormatManager::loadFromFile("XMLFormatManager",yadeConfigFile.string(),"preferences",Omega::instance().preferences);
- #endif
-
LOG_INFO("Loading plugins");
+ // set YADE_PREFIX to use prefix different from the one compiled-in; used for testing deb package when not installed
+ string prefix=getenv("YADE_PREFIX")?getenv("YADE_PREFIX"):PREFIX;
+ PyRun_SimpleString(("import sys; sys.path.insert(0,'"+prefix+"/lib/yade" SUFFIX "/py')").c_str());
+ PyRun_SimpleString("import yade");
+ PyRun_SimpleString("from __future__ import division");
+
vector<string> pluginDirs;
- // set YADE_PREFIX to use prefix different from the one compiled-in; used for testing deb package when not installed
- if(getenv("YADE_PREFIX")){
- pluginDirs.push_back(getenv("YADE_PREFIX")+string("/lib/yade" SUFFIX "/plugins"));
- pluginDirs.push_back(getenv("YADE_PREFIX")+string("/lib/yade" SUFFIX "/gui"));
- pluginDirs.push_back(getenv("YADE_PREFIX")+string("/lib/yade" SUFFIX "/extra"));
- } else {
- pluginDirs.push_back(PREFIX+string("/lib/yade" SUFFIX "/plugins"));
- pluginDirs.push_back(PREFIX+string("/lib/yade" SUFFIX "/gui"));
- pluginDirs.push_back(PREFIX+string("/lib/yade" SUFFIX "/extra"));
- }
- // pluginDirs.push_back((otherPrefix.empty() ? string(PREFIX) : otherPrefix ) + string("/lib/yade" SUFFIX "/plugins"));
- //pluginDirs.push_back((otherPrefix.empty() ? string(PREFIX) : otherPrefix ) + string("/lib/yade" SUFFIX "/gui"));
- //pluginDirs.push_back((otherPrefix.empty() ? string(PREFIX) : otherPrefix ) + string("/lib/yade" SUFFIX "/extra"));
+ pluginDirs.push_back(prefix+string("/lib/yade" SUFFIX "/plugins"));
+ pluginDirs.push_back(prefix+string("/lib/yade" SUFFIX "/gui"));
+ pluginDirs.push_back(prefix+string("/lib/yade" SUFFIX "/extra"));
Omega::instance().scanPlugins(pluginDirs);
Omega::instance().init();
=== modified file 'core/main/main.py.in'
--- core/main/main.py.in 2010-01-26 09:54:16 +0000
+++ core/main/main.py.in 2010-02-02 08:51:30 +0000
@@ -18,7 +18,7 @@
# handle command-line options first
import optparse
par=optparse.OptionParser(usage='%prog [options] [ simulation.xml[.bz2] | script.py [script options]]',prog='Yade',version='%s (%s)'%(version,','.join(features)))
-par.add_option('-j','--threads',help='Number of OpenMP threads to run; defaults to number of cores.',dest='threads',type='int')
+par.add_option('-j','--threads',help='Number of OpenMP threads to run; defaults to number of cores. Equivalent to setting OMP_NUM_THREADS environment variable.',dest='threads',type='int')
par.add_option('--nice',help='Increase nice level (i.e. decrease priority) by given number.',dest='nice',type='int')
par.add_option('-x',help='Exit when the script finishes',dest='exitAfter',action='store_true')
if 'log4cxx' in features:
=== modified file 'gui/py/PythonUI.cpp'
--- gui/py/PythonUI.cpp 2009-12-03 20:57:11 +0000
+++ gui/py/PythonUI.cpp 2010-02-02 08:51:30 +0000
@@ -1,3 +1,7 @@
+/******
+deprecated file, will be removed
+*******/
+
//#include<Python.h>
#include<boost/thread/thread.hpp>
#include<boost/python.hpp>
@@ -82,9 +86,10 @@
LOG_DEBUG("Got Global Interpreter Lock, good.");
/* import yade (for startUI()) and yade.runtime (initially empty) namespaces */
string prefix=getenv("YADE_PREFIX")?getenv("YADE_PREFIX"):PREFIX;
- PyRun_SimpleString(("import sys; sys.path.insert(0,'"+prefix+"/lib/yade" SUFFIX "/py')").c_str());
- PyRun_SimpleString("import yade");
- PyRun_SimpleString("from __future__ import division");
+ // already done in main
+ //PyRun_SimpleString(("import sys; sys.path.insert(0,'"+prefix+"/lib/yade" SUFFIX "/py')").c_str());
+ //PyRun_SimpleString("import yade");
+ //PyRun_SimpleString("from __future__ import division");
std::string features("[");
#ifdef YADE_OPENMP
=== modified file 'pkg/common/Engine/PartialEngine/CinemCNCEngine.cpp'
--- pkg/common/Engine/PartialEngine/CinemCNCEngine.cpp 2010-02-01 15:20:54 +0000
+++ pkg/common/Engine/PartialEngine/CinemCNCEngine.cpp 2010-02-02 08:51:30 +0000
@@ -5,7 +5,7 @@
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
-
+YADE_REQUIRE_FEATURE(physpar)
#include "CinemCNCEngine.hpp"
// #include<yade/pkg-common/RigidBodyParameters.hpp> , remplace par :
=== modified file 'pkg/common/Engine/PartialEngine/CinemKNCEngine.cpp'
--- pkg/common/Engine/PartialEngine/CinemKNCEngine.cpp 2010-01-10 09:09:32 +0000
+++ pkg/common/Engine/PartialEngine/CinemKNCEngine.cpp 2010-02-02 08:51:30 +0000
@@ -5,6 +5,7 @@
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
+YADE_REQUIRE_FEATURE(physpar)
#include "CinemKNCEngine.hpp"