[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed May 11 11:21:07 PDT 2016


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/940c06b1103b/
Changeset:   940c06b1103b
Branch:      yt
User:        atmyers
Date:        2016-05-05 21:49:34+00:00
Summary:     Print out some useful diagnostic information if check_for_openmp() fails. Closes Issue #1089.
Affected #:  1 file

diff -r 2f2c9e84c335e5d4be9c4eac86b1f67aed7e752f -r 940c06b1103bfc21fc209cee02ca31c282ad0fc7 setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -1,10 +1,12 @@
 import os
 from pkg_resources import resource_filename
 import shutil
-import subprocess
+from subprocess import Popen, PIPE, call
 import sys
 import tempfile
 
+from yt.utilities.exceptions import YTException
+
 def check_for_openmp():
     """Returns True if local setup supports OpenMP, False otherwise"""
 
@@ -37,13 +39,21 @@
             "}"
         )
         file.flush()
-        with open(os.devnull, 'w') as fnull:
-            exit_code = subprocess.call(compiler + ['-fopenmp', filename],
-                                        stdout=fnull, stderr=fnull)
+        p = Popen(compiler + ['-fopenmp', filename],
+                  stdin=PIPE, stdout=PIPE, stderr=PIPE)
+        output, err = p.communicate()
+        exit_code = p.returncode
+        
+        if exit_code != 0:
+            print("Compilation of OpenMP test code failed with the error: ")
+            print(err)
+            print("Disabling OpenMP support. ")
 
         # Clean up
         file.close()
     except OSError:
+        print("check_for_openmp() could not find your C compiler. "
+              "Attempted to use '%s'. " % compiler)
         return False
     finally:
         os.chdir(curdir)
@@ -111,7 +121,7 @@
         )
         file.flush()
         with open(os.devnull, 'w') as fnull:
-            exit_code = subprocess.call(compiler + ['-I%s/include/' % rd, filename],
+            exit_code = call(compiler + ['-I%s/include/' % rd, filename],
                              stdout=fnull, stderr=fnull)
 
         # Clean up


https://bitbucket.org/yt_analysis/yt/commits/79f736c0006c/
Changeset:   79f736c0006c
Branch:      yt
User:        atmyers
Date:        2016-05-05 22:25:27+00:00
Summary:     remove unused import.
Affected #:  1 file

diff -r 940c06b1103bfc21fc209cee02ca31c282ad0fc7 -r 79f736c0006ca0d4af9493d2899d43910b06c340 setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -5,7 +5,6 @@
 import sys
 import tempfile
 
-from yt.utilities.exceptions import YTException
 
 def check_for_openmp():
     """Returns True if local setup supports OpenMP, False otherwise"""


https://bitbucket.org/yt_analysis/yt/commits/618a4db28084/
Changeset:   618a4db28084
Branch:      yt
User:        atmyers
Date:        2016-05-10 03:44:08+00:00
Summary:     also catch error messgae when we try to compile Embree test code.
Affected #:  1 file

diff -r 79f736c0006ca0d4af9493d2899d43910b06c340 -r 618a4db280849d07011211c749c1c920baa97c2f setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -1,7 +1,7 @@
 import os
 from pkg_resources import resource_filename
 import shutil
-from subprocess import Popen, PIPE, call
+from subprocess import Popen, PIPE
 import sys
 import tempfile
 
@@ -91,12 +91,11 @@
         except IOError:
             rd = '/usr/local'
 
-    fail_msg = ("Pyembree is installed, but I could not compile Embree test code. \n"
-               "I attempted to find Embree headers in %s. \n"
+    fail_msg = ("I attempted to find Embree headers in %s. \n"
                "If this is not correct, please set your correct embree location \n"
                "using EMBREE_DIR environment variable or your embree.cfg file. \n"
                "Please see http://yt-project.org/docs/dev/visualizing/unstructured_mesh_rendering.html "
-                "for more information." % rd)
+                "for more information. \n" % rd)
 
     # Create a temporary directory
     tmpdir = tempfile.mkdtemp()
@@ -119,23 +118,29 @@
             '}'
         )
         file.flush()
-        with open(os.devnull, 'w') as fnull:
-            exit_code = call(compiler + ['-I%s/include/' % rd, filename],
-                             stdout=fnull, stderr=fnull)
+        p = Popen(compiler + ['-I%s/include/' % rd, filename], 
+                  stdin=PIPE, stdout=PIPE, stderr=PIPE)
+        output, err = p.communicate()
+        exit_code = p.returncode
+
+        if exit_code != 0:
+            print("Pyembree is installed, but I could not compile Embree test code.")
+            print("The error message was: ")
+            print(err)
+            print fail_msg
 
         # Clean up
         file.close()
 
     except OSError:
-        print(fail_msg)
+        print("read_embree_location() could not find your C compiler. "
+              "Attempted to use '%s'. " % compiler)
+        return False
 
     finally:
         os.chdir(curdir)
         shutil.rmtree(tmpdir)
 
-    if exit_code != 0:
-        print(fail_msg)
-
     return rd
 
 


https://bitbucket.org/yt_analysis/yt/commits/0027fec5dda5/
Changeset:   0027fec5dda5
Branch:      yt
User:        atmyers
Date:        2016-05-10 14:21:55+00:00
Summary:     use correct form of print()
Affected #:  1 file

diff -r 618a4db280849d07011211c749c1c920baa97c2f -r 0027fec5dda502d32416f47304838cefc36117c5 setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -127,7 +127,7 @@
             print("Pyembree is installed, but I could not compile Embree test code.")
             print("The error message was: ")
             print(err)
-            print fail_msg
+            print(fail_msg)
 
         # Clean up
         file.close()


https://bitbucket.org/yt_analysis/yt/commits/0b86fcb15765/
Changeset:   0b86fcb15765
Branch:      yt
User:        ngoldbaum
Date:        2016-05-11 18:20:59+00:00
Summary:     Merged in atmyers/yt (pull request #2160)

Print out some useful diagnostic information if check_for_openmp() fails. Closes Issue #1089.
Affected #:  1 file

diff -r 6db4d26078e523630af50bde111952bbee7a1018 -r 0b86fcb157653daf6f3abafcb65518cec55b5a50 setupext.py
--- a/setupext.py
+++ b/setupext.py
@@ -1,10 +1,11 @@
 import os
 from pkg_resources import resource_filename
 import shutil
-import subprocess
+from subprocess import Popen, PIPE
 import sys
 import tempfile
 
+
 def check_for_openmp():
     """Returns True if local setup supports OpenMP, False otherwise"""
 
@@ -37,13 +38,21 @@
             "}"
         )
         file.flush()
-        with open(os.devnull, 'w') as fnull:
-            exit_code = subprocess.call(compiler + ['-fopenmp', filename],
-                                        stdout=fnull, stderr=fnull)
+        p = Popen(compiler + ['-fopenmp', filename],
+                  stdin=PIPE, stdout=PIPE, stderr=PIPE)
+        output, err = p.communicate()
+        exit_code = p.returncode
+        
+        if exit_code != 0:
+            print("Compilation of OpenMP test code failed with the error: ")
+            print(err)
+            print("Disabling OpenMP support. ")
 
         # Clean up
         file.close()
     except OSError:
+        print("check_for_openmp() could not find your C compiler. "
+              "Attempted to use '%s'. " % compiler)
         return False
     finally:
         os.chdir(curdir)
@@ -82,12 +91,11 @@
         except IOError:
             rd = '/usr/local'
 
-    fail_msg = ("Pyembree is installed, but I could not compile Embree test code. \n"
-               "I attempted to find Embree headers in %s. \n"
+    fail_msg = ("I attempted to find Embree headers in %s. \n"
                "If this is not correct, please set your correct embree location \n"
                "using EMBREE_DIR environment variable or your embree.cfg file. \n"
                "Please see http://yt-project.org/docs/dev/visualizing/unstructured_mesh_rendering.html "
-                "for more information." % rd)
+                "for more information. \n" % rd)
 
     # Create a temporary directory
     tmpdir = tempfile.mkdtemp()
@@ -110,23 +118,29 @@
             '}'
         )
         file.flush()
-        with open(os.devnull, 'w') as fnull:
-            exit_code = subprocess.call(compiler + ['-I%s/include/' % rd, filename],
-                             stdout=fnull, stderr=fnull)
+        p = Popen(compiler + ['-I%s/include/' % rd, filename], 
+                  stdin=PIPE, stdout=PIPE, stderr=PIPE)
+        output, err = p.communicate()
+        exit_code = p.returncode
+
+        if exit_code != 0:
+            print("Pyembree is installed, but I could not compile Embree test code.")
+            print("The error message was: ")
+            print(err)
+            print(fail_msg)
 
         # Clean up
         file.close()
 
     except OSError:
-        print(fail_msg)
+        print("read_embree_location() could not find your C compiler. "
+              "Attempted to use '%s'. " % compiler)
+        return False
 
     finally:
         os.chdir(curdir)
         shutil.rmtree(tmpdir)
 
-    if exit_code != 0:
-        print(fail_msg)
-
     return rd

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160511/06f58c3c/attachment-0002.htm>


More information about the yt-svn mailing list