MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

h5py error when installing MHKiT on clean install #192

Closed b0ndman closed 1 year ago

b0ndman commented 1 year ago

Describe the bug:

When installing a fresh install of MHKiT on a fresh environment, which includes all dependencies, this error is shown. Installation is with pip. This is before any other dependencies like h5py are installed and dependencies are installed according to mhkit

UserWarning: h5py is running against HDF5 1.12.1 when it was built against 1.12.2, this may cause problems
  '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.12.2, library is 1.12.1
        SUMMARY OF THE HDF5 CONFIGURATION
        =================================

General Information:
-------------------
                   HDF5 Version: 1.12.1
                  Configured on: 2022-03-04
                  Configured by: Ninja
                    Host system: Windows-*******
              Uname information: Windows
                       Byte sex: little-endian
             Installation point: ***********

Compiling Options:
------------------
                     Build Mode: RELEASE
              Debugging Symbols: OFF
                        Asserts: OFF
                      Profiling: OFF
             Optimization Level: OFF

Linking Options:
----------------
                      Libraries: 
  Statically Linked Executables: OFF
                        LDFLAGS: /machine:x64
                     H5_LDFLAGS: 
                     AM_LDFLAGS: 
                Extra libraries: ***
                       Archiver: ***
                         Ranlib: :

Languages:
----------
                              C: YES
                     C Compiler: ***
                       CPPFLAGS: 
                    H5_CPPFLAGS: 
                    AM_CPPFLAGS: 
                         CFLAGS:   /DWIN32 /D_WINDOWS 
                      H5_CFLAGS: /W3;/wd4100;/wd4706;/wd4127
                      AM_CFLAGS: 
               Shared C Library: YES
               Static C Library: YES

                        Fortran: OFF
               Fortran Compiler:  
                  Fortran Flags: 
               H5 Fortran Flags: 
               AM Fortran Flags: 
         Shared Fortran Library: YES
         Static Fortran Library: YES

                            C++: ON
                   C++ Compiler: ***
                      C++ Flags:   
                   H5 C++ Flags: /W3;/wd4100;/wd4706;/wd4127
                   AM C++ Flags: 
             Shared C++ Library: YES
             Static C++ Library: YES

                            JAVA: OFF
                 JAVA Compiler:  

Features:
---------
                   Parallel HDF5: OFF
Parallel Filtered Dataset Writes: 
              Large Parallel I/O: 
              High-level library: ON
                Build HDF5 Tests: ON
                Build HDF5 Tools: ON
                    Threadsafety: ON (recursive RW locks: ) 
             Default API mapping: v112
  With deprecated public symbols: ON
          I/O filters (external):  DEFLATE
                             MPE: 
                      Direct VFD: 
                      Mirror VFD: 
              (Read-Only) S3 VFD: 1
            (Read-Only) HDFS VFD: 
                         dmalloc: 
  Packages w/ extra debug output: 
                     API Tracing: OFF
            Using memory checker: OFF
 Memory allocation sanity checks: OFF
          Function Stack Tracing: OFF
                Use file locking: best-effort
       Strict File Format Checks: OFF
    Optimization Instrumentation: 
Bye...

To Reproduce:

From fresh install with no dependencies previously installed:

import mhkit as mhk

print('hello world')
ssolson commented 1 year ago

@b0ndman are you running Py 3.7?

b0ndman commented 1 year ago

I normally run Py 3.9. There could be some funk going on with the IDE I'm using (pycharm) but my coworker was seeing a similar error. I'm not sure what version they're running

ssolson commented 1 year ago

Windows and Py 3.7 were having issues in our integration tests. I temporarily fixed it by switching to conda install in #181. My plan is to close the current PRs and circle back to get pip working with 3.7 and windows, or if I can not then either deprecate 3.7 or switch our installation instructions to use conda instead of pip.

b0ndman commented 1 year ago

I was able to reproduce the error with py 3.10 and latest update of pip 22.2.2. I'll try switching to conda instead of pip

ssolson commented 1 year ago

We currently do not support 3.10. That is also on the To Do not mentioned in the previous plan for CI testing..

b0ndman commented 1 year ago

I tried a clean environment with py 3.9 and was still getting the error with pip. Conda & Pycharm weren't talking to each other so I reverted back to mhkit v0.3.

b0ndman commented 1 year ago

temporary fix is to force h5py version to 3.6.0 before installing the rest of mhkit.