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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jul 8 06:16:37 PDT 2013


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/a022794fbc22/
Changeset:   a022794fbc22
Branch:      yt
User:        xarthisius
Date:        2013-07-04 12:59:50
Summary:     Sanitize library searching to take into account multiarch. Always rely on deps installed via script if YT_DEST is installed
Affected #:  1 file

diff -r 1b51d03f4df7744e1bf44c0d429dd876785164a0 -r a022794fbc224507781e06a8ed7a66773f4d8b7b yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -3,6 +3,7 @@
 import sys
 import os.path
 import glob
+import platform
 
 
 # snatched from PyTables
@@ -23,6 +24,8 @@
 # snatched from PyTables
 def get_default_dirs():
     default_header_dirs = []
+    default_library_dirs = []
+
     add_from_path("CPATH", default_header_dirs)
     add_from_path("C_INCLUDE_PATH", default_header_dirs)
     add_from_flags("CPPFLAGS", "-I", default_header_dirs)
@@ -30,12 +33,17 @@
         ['/usr/include', '/usr/local/include', '/usr/X11']
     )
 
-    default_library_dirs = []
+    _archs = ['lib64', 'lib']
+    if platform.system() == 'Linux':
+        distname, version, did = platform.linux_distribution()
+        if distname in ('Ubuntu', 'Debian'):
+            _archs.extend(['lib/x86_64-linux-gnu', 'lib/i686-linux-gnu'])
+
     add_from_flags("LDFLAGS", "-L", default_library_dirs)
     default_library_dirs.extend(
         os.path.join(_tree, _arch)
-        for _tree in ('/', '/usr', '/usr/local', '/usr/X11')
-        for _arch in ('lib64', 'lib')
+        for _tree in ('/usr', '/usr/local', '/usr/X11', '/')
+        for _arch in _archs
     )
     return default_header_dirs, default_library_dirs
 
@@ -59,6 +67,14 @@
 
 
 def check_prefix(inc_dir, lib_dir):
+    if platform.system() == 'Linux':
+        distname, version, did = platform.linux_distribution()
+        if distname in ('Ubuntu', 'Debian'):
+            print("Since you are using multiarch distro it's hard to detect")
+            print("whether library mathes the header file. We will assume")
+            print("it does. If you encounter any build failures please use")
+            print("proper cfg files to provide path to the dependencies")
+            return (inc_dir, lib_dir)
     prefix = os.path.commonprefix([inc_dir, lib_dir]).rstrip('/\\')
     if prefix is not '' and prefix == os.path.dirname(inc_dir):
         return (inc_dir, lib_dir)
@@ -69,20 +85,29 @@
 
 
 def get_location_from_ctypes(header, library):
+    yt_inst = os.environ.get('YT_DEST')
+    if yt_inst is not None:
+        # since we preffer installation via scirpt, make sure
+        # that YT_DEST path take precedence above all else
+        return (os.path.join(yt_inst, 'include'), os.path.join(yt_inst, 'lib'))
+
     try:
         import ctypes
         import ctypes.util
     except ImportError:
         return (None, None)
 
+    target_inc, target_libdir = None, None
     default_header_dirs, default_library_dirs = get_default_dirs()
-    target_inc, target_libdir = None, None
     for inc_prefix in default_header_dirs:
         if os.path.isfile(os.path.join(inc_prefix, header)):
             target_inc = inc_prefix
 
     target_libfile = ctypes.util.find_library(library)
-    if target_libfile is not None and os.path.isfile(target_libfile):
+    if None in (target_inc, target_libfile):
+        # either header or lib was not found, abort now
+        return (None, None)
+    if os.path.isfile(target_libfile):
         return check_prefix(target_inc, os.path.dirname(target_libfile))
     for lib_dir in default_library_dirs:
         try:


https://bitbucket.org/yt_analysis/yt/commits/7239377a88f8/
Changeset:   7239377a88f8
Branch:      yt
User:        xarthisius
Date:        2013-07-04 20:32:35
Summary:     Add multiarch default dir for i386
Affected #:  1 file

diff -r a022794fbc224507781e06a8ed7a66773f4d8b7b -r 7239377a88f83e148a55dd3c0208b12ac6e47678 yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -37,7 +37,8 @@
     if platform.system() == 'Linux':
         distname, version, did = platform.linux_distribution()
         if distname in ('Ubuntu', 'Debian'):
-            _archs.extend(['lib/x86_64-linux-gnu', 'lib/i686-linux-gnu'])
+            _archs.extend(
+                ['lib/x86_64-linux-gnu', 'lib/i686-linux-gnu', 'lib/i386-linux-gnu'])
 
     add_from_flags("LDFLAGS", "-L", default_library_dirs)
     default_library_dirs.extend(


https://bitbucket.org/yt_analysis/yt/commits/389d3baba45a/
Changeset:   389d3baba45a
Branch:      yt
User:        xarthisius
Date:        2013-07-05 08:35:24
Summary:     Fix spelling errors, pep8
Affected #:  1 file

diff -r 7239377a88f83e148a55dd3c0208b12ac6e47678 -r 389d3baba45a79bf07638f072589ef8f63370968 yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -38,7 +38,10 @@
         distname, version, did = platform.linux_distribution()
         if distname in ('Ubuntu', 'Debian'):
             _archs.extend(
-                ['lib/x86_64-linux-gnu', 'lib/i686-linux-gnu', 'lib/i386-linux-gnu'])
+                ['lib/x86_64-linux-gnu',
+                 'lib/i686-linux-gnu',
+                 'lib/i386-linux-gnu']
+            )
 
     add_from_flags("LDFLAGS", "-L", default_library_dirs)
     default_library_dirs.extend(
@@ -72,7 +75,7 @@
         distname, version, did = platform.linux_distribution()
         if distname in ('Ubuntu', 'Debian'):
             print("Since you are using multiarch distro it's hard to detect")
-            print("whether library mathes the header file. We will assume")
+            print("whether library matches the header file. We will assume")
             print("it does. If you encounter any build failures please use")
             print("proper cfg files to provide path to the dependencies")
             return (inc_dir, lib_dir)
@@ -88,7 +91,7 @@
 def get_location_from_ctypes(header, library):
     yt_inst = os.environ.get('YT_DEST')
     if yt_inst is not None:
-        # since we preffer installation via scirpt, make sure
+        # since we prefer installation via script, make sure
         # that YT_DEST path take precedence above all else
         return (os.path.join(yt_inst, 'include'), os.path.join(yt_inst, 'lib'))
 


https://bitbucket.org/yt_analysis/yt/commits/432d2a1883d2/
Changeset:   432d2a1883d2
Branch:      yt
User:        MatthewTurk
Date:        2013-07-08 15:16:33
Summary:     Merged in xarthisius/yt (pull request #543)

Sanitize library searching to take into account multiarch. Always rely on deps installed via script if YT_DEST is installed
Affected #:  1 file

diff -r c3e296975053621f936fba611bea53b714fa2ae5 -r 432d2a1883d262ad9ada8d98dd36fbe638fa45b1 yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -3,6 +3,7 @@
 import sys
 import os.path
 import glob
+import platform
 
 
 # snatched from PyTables
@@ -23,6 +24,8 @@
 # snatched from PyTables
 def get_default_dirs():
     default_header_dirs = []
+    default_library_dirs = []
+
     add_from_path("CPATH", default_header_dirs)
     add_from_path("C_INCLUDE_PATH", default_header_dirs)
     add_from_flags("CPPFLAGS", "-I", default_header_dirs)
@@ -30,12 +33,21 @@
         ['/usr/include', '/usr/local/include', '/usr/X11']
     )
 
-    default_library_dirs = []
+    _archs = ['lib64', 'lib']
+    if platform.system() == 'Linux':
+        distname, version, did = platform.linux_distribution()
+        if distname in ('Ubuntu', 'Debian'):
+            _archs.extend(
+                ['lib/x86_64-linux-gnu',
+                 'lib/i686-linux-gnu',
+                 'lib/i386-linux-gnu']
+            )
+
     add_from_flags("LDFLAGS", "-L", default_library_dirs)
     default_library_dirs.extend(
         os.path.join(_tree, _arch)
-        for _tree in ('/', '/usr', '/usr/local', '/usr/X11')
-        for _arch in ('lib64', 'lib')
+        for _tree in ('/usr', '/usr/local', '/usr/X11', '/')
+        for _arch in _archs
     )
     return default_header_dirs, default_library_dirs
 
@@ -59,6 +71,14 @@
 
 
 def check_prefix(inc_dir, lib_dir):
+    if platform.system() == 'Linux':
+        distname, version, did = platform.linux_distribution()
+        if distname in ('Ubuntu', 'Debian'):
+            print("Since you are using multiarch distro it's hard to detect")
+            print("whether library matches the header file. We will assume")
+            print("it does. If you encounter any build failures please use")
+            print("proper cfg files to provide path to the dependencies")
+            return (inc_dir, lib_dir)
     prefix = os.path.commonprefix([inc_dir, lib_dir]).rstrip('/\\')
     if prefix is not '' and prefix == os.path.dirname(inc_dir):
         return (inc_dir, lib_dir)
@@ -69,20 +89,29 @@
 
 
 def get_location_from_ctypes(header, library):
+    yt_inst = os.environ.get('YT_DEST')
+    if yt_inst is not None:
+        # since we prefer installation via script, make sure
+        # that YT_DEST path take precedence above all else
+        return (os.path.join(yt_inst, 'include'), os.path.join(yt_inst, 'lib'))
+
     try:
         import ctypes
         import ctypes.util
     except ImportError:
         return (None, None)
 
+    target_inc, target_libdir = None, None
     default_header_dirs, default_library_dirs = get_default_dirs()
-    target_inc, target_libdir = None, None
     for inc_prefix in default_header_dirs:
         if os.path.isfile(os.path.join(inc_prefix, header)):
             target_inc = inc_prefix
 
     target_libfile = ctypes.util.find_library(library)
-    if target_libfile is not None and os.path.isfile(target_libfile):
+    if None in (target_inc, target_libfile):
+        # either header or lib was not found, abort now
+        return (None, None)
+    if os.path.isfile(target_libfile):
         return check_prefix(target_inc, os.path.dirname(target_libfile))
     for lib_dir in default_library_dirs:
         try:

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.



More information about the yt-svn mailing list