[h5py] 215/455: Fix compilation on Mac OS

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit aeb4aea76b054e073d79732a4ca0c0d7222d07e9
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Sun Feb 1 04:11:44 2009 +0000

    Fix compilation on Mac OS
---
 lzf/lzf/lzf_d.c | 2 ++
 setup.py        | 9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lzf/lzf/lzf_d.c b/lzf/lzf/lzf_d.c
index 562e188..5897580 100644
--- a/lzf/lzf/lzf_d.c
+++ b/lzf/lzf/lzf_d.c
@@ -44,6 +44,7 @@
 #endif
 
 #ifndef __STRICT_ANSI__
+#ifndef H5PY_DISABLE_LZF_ASM
 #if (__i386 || __amd64) && __GNUC__ >= 3
 # define lzf_movsb(dst, src, len)                \
    asm ("rep movsb"                              \
@@ -51,6 +52,7 @@
         :  "0" (dst),  "1" (src),  "2" (len));
 #endif
 #endif
+#endif
 
 unsigned int 
 lzf_decompress (const void *const in_data,  unsigned int in_len,
diff --git a/setup.py b/setup.py
index 5c68d01..a521619 100644
--- a/setup.py
+++ b/setup.py
@@ -198,7 +198,7 @@ class ExtensionCreator(object):
     """
 
     def __init__(self, hdf5_loc=None):
-        if os.name == 'nt':
+        if sys.platform == 'win32':
             if hdf5_loc is None:
                 fatal("On Windows, HDF5 directory must be specified.")
 
@@ -218,6 +218,9 @@ class ExtensionCreator(object):
                 self.include_dirs = [numpy.get_include(), 
                                      '/usr/include', '/usr/local/include']
                 self.library_dirs = ['/usr/lib/', '/usr/local/lib']
+                if sys.platform == 'darwin':
+                    self.include_dirs += ['/opt/local/include']
+                    self.library_dirs += ['/opt/local/lib']
             else:
                 self.include_dirs = [numpy.get_include(), op.join(hdf5_loc, 'include')]
                 self.library_dirs = [op.join(hdf5_loc, 'lib')]
@@ -225,7 +228,9 @@ class ExtensionCreator(object):
             self.runtime_dirs = self.library_dirs
             self.extra_compile_args = ['-DH5_USE_16_API', '-Wno-unused', '-Wno-uninitialized']
             self.extra_link_args = []
-
+            
+            if sys.platform == 'darwin':
+                self.extra_compile_args += ['-DH5PY_DISABLE_LZF_ASM']
     
     def create_extension(self, name, extra_src=None):
         """ Create a distutils Extension object for the given module.  A list

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list