From ddd3a022a2ff5f1469eb100af96daea072b5b24c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Wed, 26 Oct 2011 18:46:12 +0200 Subject: [PATCH 1/5] Add .gitignore file Currently Python bytecode files (.pyc) and the compiled Waf executable are ignored. This cleans up 'git status' output a lot. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..26283617 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +waf From 665fa4294cabd7894eb1d5df009cc74452753a17 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 26 Oct 2011 21:57:58 +0200 Subject: [PATCH 2/5] #1062 --- waflib/Configure.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/waflib/Configure.py b/waflib/Configure.py index 92799733..eb1e4d4b 100644 --- a/waflib/Configure.py +++ b/waflib/Configure.py @@ -111,7 +111,8 @@ class ConfigurationContext(Context.Context): def setenv(self, name, env=None): """ - Set a new config set for conf.env + Set a new config set for conf.env. If a config set of that name already exists, + recall it without modification. The name is the filename prefix to save to ``c4che/NAME_cache.py``, and it is also used as *variants* by the build commands. @@ -130,12 +131,13 @@ class ConfigurationContext(Context.Context): :param env: ConfigSet to copy, or an empty ConfigSet is created :type env: :py:class:`waflib.ConfigSet.ConfigSet` """ - if not env: - env = ConfigSet.ConfigSet() - self.prepare_env(env) - else: - env = env.derive() - self.all_envs[name] = env + if name not in self.all_envs or env: + if not env: + env = ConfigSet.ConfigSet() + self.prepare_env(env) + else: + env = env.derive() + self.all_envs[name] = env self.variant = name def get_env(self): From bf2584d4055c493b9b3bfe4a75bff4ffd3c2dfdb Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 26 Oct 2011 21:58:36 +0200 Subject: [PATCH 3/5] docs --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 497ba9ad..66382bdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ NEW IN WAF 1.6.9 * Added a workaround to avoid creating include folders not under the build directory #1049 * Added a default virtual folder structure for out-of-tree build files #1053 * Added a way to set variants containing /, for example linux/debug +* Added a more intuitive behaviour for conf.setenv() #1062 NEW IN WAF 1.6.8 ---------------- From 9fbfadd6d88dcf87184dfe69a0dc94ae708498aa Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 26 Oct 2011 22:04:34 +0200 Subject: [PATCH 4/5] #1063 --- waflib/Tools/ifort.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/waflib/Tools/ifort.py b/waflib/Tools/ifort.py index b999efb2..75884167 100644 --- a/waflib/Tools/ifort.py +++ b/waflib/Tools/ifort.py @@ -19,6 +19,14 @@ def find_ifort(conf): def ifort_modifier_cygwin(conf): raise NotImplementedError("Ifort on cygwin not yet implemented") +@conf +def ifort_modifier_win32(conf): + fc_config.fortran_modifier_win32(conf) + +@conf +def ifort_modifier_darwin(conf): + fc_config.fortran_modifier_darwin(conf) + @conf def ifort_modifier_platform(conf): dest_os = conf.env['DEST_OS'] or Utils.unversioned_sys_platform() @@ -47,3 +55,4 @@ def configure(conf): conf.find_ar() conf.fc_flags() conf.ifort_modifier_platform() + From 3f0b96ee7afaa4011a122e8c13a91062f9b9ada6 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 26 Oct 2011 22:09:30 +0200 Subject: [PATCH 5/5] #1063 --- waflib/Tools/fc_config.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/waflib/Tools/fc_config.py b/waflib/Tools/fc_config.py index 0fd06bc8..3b460349 100644 --- a/waflib/Tools/fc_config.py +++ b/waflib/Tools/fc_config.py @@ -441,3 +441,21 @@ def set_lib_pat(self): """Set the fortran flags for linking with the python library""" self.env['fcshlib_PATTERN'] = self.env['pyext_PATTERN'] +@conf +def detect_openmp(self): + for x in ['-fopenmp','-openmp','-mp','-xopenmp','-omp','-qsmp=omp']: + try: + conf.check_fc( + msg='Checking for OpenMP flag %s' % x, + fragment='program main\n call omp_get_num_threads()\nend program main', + fcflags=x, + linkflags=x, + uselib_store='OPENMP' + ) + except conf.errors.ConfigurationError: + pass + else: + break + else: + conf.fatal('Could not find OpenMP') +