Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install pyklb #11

Open
jmmuncie opened this issue Sep 21, 2023 · 5 comments
Open

Unable to install pyklb #11

jmmuncie opened this issue Sep 21, 2023 · 5 comments

Comments

@jmmuncie
Copy link

Hi,

I am trying to install pyklb using pip install git+https://github.com/bhoeckendorf/pyklb.git@skbuild

And get a very long error message:

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmpo5afmvxp build_wheel /tmp/tmpzqhqd1ms                                                                                       
       cwd: /tmp/pip-req-build-78gyc6eh                                                                                                                          
  Complete output (310 lines):                                                                                                                                   
                                                                                                                                                                 
                                                                                                                                                                 
  --------------------------------------------------------------------------------                                                                               
  -- Trying 'Ninja' generator                                                                                                                                    
  --------------------------------                                                                                                                               
  ---------------------------                                                                                                                                    
  ----------------------                                                                                                                                         
  -----------------                                                                                                                                              
  ------------                                                                                                                                                   
  -------                                                                                                                                                        
  --                                                                                                                                                             
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):                                                                                        
    Compatibility with CMake < 3.5 will be removed from a future version of                                                                                      
    CMake.                                                                                                                                                       
                                                                                                                                                                 
    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                     
    CMake that the project does not need compatibility with older versions.                                                                                      
                                                                                                                                                                 
  Not searching for unused variables given on the command line.                                                                                                  
                                                                                                                                                                 
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.                                                                                                                                                            
  -- Configuring incomplete, errors occurred!                                                                                                                    
  --                                                                                                                                                             
  -------                                                                                                                                                        
  ------------                                                                                                                                                   
  -----------------                                                                                                                                              
  ----------------------                                                                                                                                         
  ---------------------------                                                                                                                                    
  --------------------------------                                                                                                                               
  -- Trying 'Ninja' generator - failure                                                                                                                          
  --------------------------------------------------------------------------------                                                                               
                                                                                                                                                                 
                                                                                                                                                                 
                                                                                                                                                                 
  --------------------------------------------------------------------------------                                                                               
  -- Trying 'Unix Makefiles' generator                                                                                                                           
  --------------------------------                                                                                                                               
  ---------------------------                                                                                                                                    
  ----------------------                                                                                                                                         
  -----------------                                                                                                                                              
  ------------                                                                                                                                                   
  -------                                                                                                                                                        
  --                                                                                                                                                             
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):                                                                                        
    Compatibility with CMake < 3.5 will be removed from a future version of                                                                                      
    CMake.                                                                                                                                                       
                                                                                                                                                                 
    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                     
    CMake that the project does not need compatibility with older versions.                                                                                      
                                                                                                                                                                 
  Not searching for unused variables given on the command line.                                                                                                  
                                                                                                                                                                 
  -- The C compiler identification is GNU 9.4.0                                                                                                                  
  -- Detecting C compiler ABI info                                                                                                                               
  -- Detecting C compiler ABI info - done                                                                                                                        
  -- Check for working C compiler: /usr/bin/cc - skipped                                                                                                         
  -- Detecting C compile features                                                                                                                                
  -- Detecting C compile features - done                                                                                                                         
  -- The CXX compiler identification is GNU 9.4.0                                                                                                                
  -- Detecting CXX compiler ABI info                                                                                                                             
  -- Detecting CXX compiler ABI info - done                                                                                                                      
  -- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                      
  -- Detecting CXX compile features                                                                                                                              
  -- Detecting CXX compile features - done                                                                                                                       
  -- Configuring done (0.2s)                                                                                                                                     
  -- Generating done (0.0s)                                                                                                                                      
  -- Build files have been written to: /tmp/pip-req-build-78gyc6eh/_cmake_test_compile/build                                                                     
  --                                                                                                                                                             
  -------                                                                                                                                                        
  ------------                                                                                                                                                   
  -----------------                                                                                                                                              
  ----------------------                                                                                                                                         
  ---------------------------                                                                                                                                    
  --------------------------------                                                                                                                               
  -- Trying 'Unix Makefiles' generator - success                                                                                                                 
  --------------------------------------------------------------------------------                                                                               
                                                                                                                                                                 
  Configuring Project                                                                                                                                            
    Working directory:                                                                                                                                           
      /tmp/pip-req-build-78gyc6eh/_skbuild/linux-x86_64-3.8/cmake-build                                                                                          
    Command:                                                                                                                                                     
      /tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/cmake/data/bin/cmake /tmp/pip-req-build-78gyc6eh -G 'Unix Makefiles' --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-req-build-78gyc6eh/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_VERSION_STRING:STRING=3.8.10 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:PATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DPython_EXECUTABLE:PATH=/usr/bin/python3 -DPython_ROOT_DIR:PATH=/usr -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPython_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.8/dist-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/usr/bin/python3 -DPython3_ROOT_DIR:PATH=/usr -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPython3_NumPy_INCLUDE_DIRS:PATH=/usr/local/lib/python3.8/dist-packages/numpy/core/include -DCMAKE_BUILD_TYPE:STRING=Release           
                                                                                                                                                                 
  Not searching for unused variables given on the command line.                                                                                                  
  -- The C compiler identification is GNU 9.4.0                                                                                                                  
  -- The CXX compiler identification is GNU 9.4.0                                                                                                                
  -- Detecting C compiler ABI info                                                                                                                               
  -- Detecting C compiler ABI info - done                                                                                                                        
  -- Check for working C compiler: /usr/bin/cc - skipped                                                                                                         
  -- Detecting C compile features                                                                                                                                
  -- Detecting C compile features - done                                                                                                                         
  -- Detecting CXX compiler ABI info                                                                                                                             
  -- Detecting CXX compiler ABI info - done                                                                                                                      
  -- Check for working CXX compiler: /usr/bin/c++ - skipped                                                                                                      
  -- Detecting CXX compile features                                                                                                                              
  -- Detecting CXX compile features - done                                                                                                                       
  CMake Warning (dev) at /tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:245 (find_package):  
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules                                                                                   
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use                                                                                     
    the cmake_policy command to set the policy and suppress this warning.                                                                                        
                                                                                                                                                                 
  Call Stack (most recent call first):                                                                                                                           
    CMakeLists.txt:4 (find_package)                                                                                                                              
  This warning is for project developers.  Use -Wno-dev to suppress it.                                                                                          
                                                                                                                                                                 
  -- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")                                                                                               
  CMake Warning (dev) at /tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:252 (find_package):  
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules                                                                                   
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use                                                                                     
    the cmake_policy command to set the policy and suppress this warning.                                                                                        
                                                                                                                                                                 
  Call Stack (most recent call first):                                                                                                                           
    CMakeLists.txt:4 (find_package)                                                                                                                              
  This warning is for project developers.  Use -Wno-dev to suppress it.                                                                                          
                                                                                                                                                                 
  -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found version "3.8.10")                                                                        
  -- Found Cython: /tmp/pip-build-env-grd4v2am/overlay/bin/cython                                                                                                
  -- Found NumPy: /usr/local/lib/python3.8/dist-packages/numpy/core/include (found version "1.24.4")                                                             
  -- Found Git: /usr/bin/git (found version "2.25.1")                                                                                                            
  -- Submodule update                                                                                                                                            
  -- Performing Test Weak Link MODULE -> SHARED (gnu_ld_ignore) - Success                                                                                        
  _modinit_prefix:PyInit_                                                                                                                                        
  CMake Deprecation Warning at libklb/CMakeLists.txt:2 (cmake_minimum_required):                                                                                 
    Compatibility with CMake < 3.5 will be removed from a future version of                                                                                      
    CMake.                                                                                                                                                       
                                                                                                                                                                 
    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                     
    CMake that the project does not need compatibility with older versions.                                                                                      
                                                                                                                                                                 
                                                                                                                                                                 
  Version v0.3.4-18-gd475543 d475543                                                                                                                             
  CMake Deprecation Warning at libklb/src/external/zlib-1.2.8/CMakeLists.txt:1 (cmake_minimum_required):                                                         
    Compatibility with CMake < 3.5 will be removed from a future version of                                                                                      
    CMake.                                                                                                                                                       
                                                                                                                                                                 
    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                     
    CMake that the project does not need compatibility with older versions.                                                                                      
                                                                                                                                                                 
                                                                                                                                                                 
  CMake Deprecation Warning at libklb/src/external/zlib-1.2.8/CMakeLists.txt:2 (cmake_policy):                                                                   
    The OLD behavior for policy CMP0002 will be removed from a future version                                                                                    
    of CMake.                                                                                                                                                    
                                                                                                                                                                 
    The cmake-policies(7) manual explains that the OLD behaviors of all                                                                                          
    policies are deprecated and that a policy should be set to OLD only under                                                                                    
    specific short-term circumstances.  Projects should be ported to the NEW                                                                                     
    behavior and not rely on setting a policy to OLD.                                                                                                            
                                                                                                                                                                 
                                                                                                                                                                 
  CMake Deprecation Warning at libklb/src/external/zlib-1.2.8/CMakeLists.txt:3 (cmake_policy):                                                                   
    The OLD behavior for policy CMP0026 will be removed from a future version                                                                                    
    of CMake.                                                                                                                                                    
                                                                                                                                                                 
    The cmake-policies(7) manual explains that the OLD behaviors of all                                                                                          
    policies are deprecated and that a policy should be set to OLD only under                                                                                    
    specific short-term circumstances.  Projects should be ported to the NEW                                                                                     
    behavior and not rely on setting a policy to OLD.                                                                                                            
                                                                                                                                                                 
                                                                                                                                                                 
  CMake Deprecation Warning at libklb/src/external/zlib-1.2.8/CMakeLists.txt:4 (cmake_policy):                                                                   
    The OLD behavior for policy CMP0054 will be removed from a future version                                                                                    
    of CMake.                                                                                                                                                    
                                                                                                                                                                 
    The cmake-policies(7) manual explains that the OLD behaviors of all                                                                                          
    policies are deprecated and that a policy should be set to OLD only under                                                                                    
    specific short-term circumstances.  Projects should be ported to the NEW                                                                                     
    behavior and not rely on setting a policy to OLD.                                                                                                            
                                                                                                                                                                 
                                                                                                                                                                 
  -- Looking for sys/types.h                                                                                                                                     
  -- Looking for sys/types.h - found                                                                                                                             
  -- Looking for stdint.h                                                                                                                                        
  -- Looking for stdint.h - found                                                                                                                                
  -- Looking for stddef.h                                                                                                                                        
  -- Looking for stddef.h - found                                                                                                                                
  -- Check size of off64_t                                                                                                                                       
  -- Check size of off64_t - done                                                                                                                                
  -- Looking for fseeko                                                                                                                                          
  -- Looking for fseeko - found                                                                                                                                  
  -- Looking for unistd.h                                                                                                                                        
  -- Looking for unistd.h - found                                                                                                                                
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD                                                                                                                     
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed                                                                                                            
  -- Looking for pthread_create in pthreads                                                                                                                      
  -- Looking for pthread_create in pthreads - not found                                                                                                          
  -- Looking for pthread_create in pthread                                                                                                                       
  -- Looking for pthread_create in pthread - found                                                                                                               
  -- Found Threads: TRUE                                                                                                                                         
  Not installing klb libraries. CMAKE_PROJECT_NAME is pyklb                                                                                                      
  -- Configuring done (1.3s)                                                                                                                                     
  -- Generating done (0.0s)                                                                                                                                      
  -- Build files have been written to: /tmp/pip-req-build-78gyc6eh/_skbuild/linux-x86_64-3.8/cmake-build                                                         
  [  2%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/adler32.o                                                                    
  [  4%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/compress.o                                                                   
  [  7%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/crc32.o                                                                      
  [  9%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/deflate.o                                                                    
  [ 12%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/gzclose.o                                                                    
  [ 14%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/gzlib.o                                                                      
  [ 17%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/gzread.o                                                                     
  [ 19%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/gzwrite.o                                                                    
  [ 21%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/inflate.o                                                                    
  [ 24%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/infback.o                                                                    
  [ 26%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/inftrees.o                                                                   
  [ 29%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/inffast.o                                                                    
  [ 31%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/trees.o                                                                      
  [ 34%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/uncompr.o                                                                    
  [ 36%] Building C object libklb/src/external/zlib-1.2.8/CMakeFiles/zlibstatic.dir/zutil.o                                                                      
  [ 39%] Linking C static library libz.a                                                                                                                         
  [ 39%] Built target zlibstatic                                                                                                                                 
  [ 41%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/crctable.c.o                                                                     
  [ 43%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/randtable.c.o                                                                    
  [ 46%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/compress.c.o                                                                     
  [ 48%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/decompress.c.o                                                                   
  [ 51%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/bzlib.c.o                                                                        
  [ 53%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/blocksort.c.o                                                                    
  [ 56%] Building C object libklb/src/external/bzip2-1.0.6/CMakeFiles/bzip2.dir/huffman.c.o                                                                      
  [ 58%] Linking C static library libbzip2.a                                                                                                                     
  [ 58%] Built target bzip2                                                                                                                                      
  [ 60%] Building CXX object libklb/src/CMakeFiles/klb_static.dir/klb_Cwrapper.cpp.o                                                                             
  [ 63%] Building CXX object libklb/src/CMakeFiles/klb_static.dir/klb_ROI.cpp.o                                                                                  
  [ 65%] Building CXX object libklb/src/CMakeFiles/klb_static.dir/klb_circularDequeue.cpp.o                                                                      
  [ 68%] Building CXX object libklb/src/CMakeFiles/klb_static.dir/klb_imageHeader.cpp.o                                                                          
  [ 70%] Building CXX object libklb/src/CMakeFiles/klb_static.dir/klb_imageIO.cpp.o                                                                              
  /tmp/pip-req-build-78gyc6eh/libklb/src/klb_imageIO.cpp: In member function ‘void klb_imageIO::blockUncompressor(char*, std::atomic<long unsigned int>*, const klb_ROI*, int*)’:                                                                                                                                                 
  /tmp/pip-req-build-78gyc6eh/libklb/src/klb_imageIO.cpp:590:8: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]                                                                                                                      
    590 |   fread(bufferFile, 1, sizeCompressed, fid);//read compressed block                                                                                    
        |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                            
  /tmp/pip-req-build-78gyc6eh/libklb/src/klb_imageIO.cpp: In member function ‘void klb_imageIO::blockUncompressorImageFull(char*, std::atomic<long unsigned int>*, int*)’:                                                                                                                                                        
  /tmp/pip-req-build-78gyc6eh/libklb/src/klb_imageIO.cpp:997:8: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]                                                                                                                      
    997 |   fread(bufferFile, 1, sizeCompressed, fid);                                                                                                           
        |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                            
  [ 73%] Linking CXX static library libklb_static.a                                                                                                              
  [ 73%] Built target klb_static                                                                                                                                 
  [ 75%] Generating C source pyklb/_pyklb.c                                                                                                                      
  /usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py:384: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-78gyc6eh/pyklb/_pyklb.pyx                                                                            
    tree = Parsing.p_module(s, pxd, full_module_name)                                                                                                            
  Traceback (most recent call last):                                                                                                                             
    File "/tmp/pip-build-env-grd4v2am/overlay/bin/cython", line 8, in <module>                                                                                   
      sys.exit(setuptools_main())                                                                                                                                
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 757, in setuptools_main                                                          
      return main(command_line = 1)                                                                                                                              
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 785, in main                                                                     
      result = compile(sources, options)                                                                                                                         
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 676, in compile                                                                  
      return compile_multiple(source, options)                                                                                                                   
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 650, in compile_multiple                                                         
      result = run_pipeline(source, options,                                                                                                                     
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 542, in run_pipeline                                                             
      err, enddata = Pipeline.run_pipeline(pipeline, source)                                                                                                     
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 398, in run_pipeline                                                         
      data = run(phase, data)                                                                                                                                    
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 375, in run                                                                  
      return phase(data)                                                                                                                                         
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 52, in generate_pyx_code_stage                                               
      module_node.process_implementation(options, result)                                                                                                        
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ModuleNode.py", line 222, in process_implementation                                             
      self.generate_c_code(env, options, result)                                                                                                                 
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ModuleNode.py", line 516, in generate_c_code                                                    
      self.body.generate_function_definitions(env, code)                                                                                                         
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_function_definitions                                           
      stat.generate_function_definitions(env, code)                                                                                                              
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_function_definitions                                           
      stat.generate_function_definitions(env, code)                                                                                                              
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 3499, in generate_function_definitions                                          
      self.defaults_getter.generate_function_definitions(env.global_scope(), code)                                                                               
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 3506, in generate_function_definitions                                          
      FuncDefNode.generate_function_definitions(self, env, code)                                                                                                 
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 2200, in generate_function_definitions                                          
      self.generate_function_body(env, code)                                                                                                                     
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 1953, in generate_function_body                                                 
      self.body.generate_execution_code(code)                                                                                                                    
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 6861, in generate_execution_code                                                
      value.generate_evaluation_code(code)                                                                                                                       
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 831, in generate_evaluation_code                                            
      self.generate_subexpr_evaluation_code(code)                                                                                                                
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 846, in generate_subexpr_evaluation_code                                    
      node.generate_evaluation_code(code)                                                                                                                        
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 837, in generate_evaluation_code                                            
      self.generate_result_code(code)                                                                                                                            
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8023, in generate_result_code                                               
      self.generate_operation_code(code)                                                                                                                         
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8582, in generate_operation_code                                            
      self.generate_sequence_packing_code(code)                                                                                                                  
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8090, in generate_sequence_packing_code                                     
      code.put_incref(arg.result(), arg.ctype())                                                                                                                 
    File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 10120, in result                                                            
      self.defaults_struct.lookup(self.arg.name).cname)                                                                                                          
  AttributeError: 'NoneType' object has no attribute 'cname'                                                                                                     
  make[2]: *** [pyklb/CMakeFiles/_pyklb.dir/build.make:75: pyklb/_pyklb.c] Error 1                                                                               
  make[1]: *** [CMakeFiles/Makefile2:185: pyklb/CMakeFiles/_pyklb.dir/all] Error 2                                                                               
  make: *** [Makefile:156: all] Error 2                                                                                                                          
  Traceback (most recent call last):                                                                                                                             
    File "/tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 674, in setup                                        
      cmkr.make(make_args, install_target=cmake_install_target, env=env)                                                                                         
    File "/tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 697, in make                                                  
      self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)                                                
    File "/tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/skbuild/cmaker.py", line 742, in make_impl                                             
      raise SKBuildError(msg)                                                                                                                                    
                                                                                                                                                                 
  An error occurred while building with CMake.                                                                                                                   
    Command:                                                                                                                                                     
      /tmp/pip-build-env-grd4v2am/overlay/lib/python3.8/site-packages/cmake/data/bin/cmake --build . --target install --config Release --                        
    Install target:                                                                                                                                              
      install                                                                                                                                                    
    Source directory:                                                                                                                                            
      /tmp/pip-req-build-78gyc6eh                                                                                                                                
    Working directory:                                                                                                                                           
      /tmp/pip-req-build-78gyc6eh/_skbuild/linux-x86_64-3.8/cmake-build                                                                                          
  Please check the install target is valid and see CMake's output for more information.                                                                          
                                                                                                                                                                 
  ----------------------------------------                                                                                                                       
  ERROR: Failed building wheel for pyklb
Failed to build pyklb
ERROR: Could not build wheels for pyklb which use PEP 517 and cannot be installed directly

Any help would be greatly appreciated!

@jmmuncie
Copy link
Author

I've also tried installing by cloning the repository, and then running python3 setup.py bdist_wheel from the top level folder, and in that case, I get this error:

Compiling src/pyklb.pyx because it changed.
[1/1] Cythonizing src/pyklb.pyx
/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py:384: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/jmmuncie/Gitclones/pyklb/src/pyklb.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
Traceback (most recent call last):
  File "setup.py", line 85, in <module>
    ext_modules = cythonize([
  File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
    cythonize_one(*args)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Build/Dependencies.py", line 1280, in cythonize_one
    result = compile_single(pyx_file, options, full_module_name=full_module_name)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 618, in compile_single
    return run_pipeline(source, options, full_module_name)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py", line 542, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 398, in run_pipeline
    data = run(phase, data)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 375, in run
    return phase(data)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Pipeline.py", line 52, in generate_pyx_code_stage
    module_node.process_implementation(options, result)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ModuleNode.py", line 222, in process_implementation
    self.generate_c_code(env, options, result)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ModuleNode.py", line 516, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 3499, in generate_function_definitions
    self.defaults_getter.generate_function_definitions(env.global_scope(), code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 3506, in generate_function_definitions
    FuncDefNode.generate_function_definitions(self, env, code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 2200, in generate_function_definitions
    self.generate_function_body(env, code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 1953, in generate_function_body
    self.body.generate_execution_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Nodes.py", line 6861, in generate_execution_code
    value.generate_evaluation_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 831, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 846, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 837, in generate_evaluation_code
    self.generate_result_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8023, in generate_result_code
    self.generate_operation_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8582, in generate_operation_code
    self.generate_sequence_packing_code(code)
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 8090, in generate_sequence_packing_code
    code.put_incref(arg.result(), arg.ctype())
  File "/usr/local/lib/python3.8/dist-packages/Cython/Compiler/ExprNodes.py", line 10120, in result
    self.defaults_struct.lookup(self.arg.name).cname)
AttributeError: 'NoneType' object has no attribute 'cname'

@mkcor
Copy link

mkcor commented Jan 23, 2024

Hi @jmmuncie,

I'm facing the same issue today. What's your setup (OS, version, ...)? From your log, it looks like you're running Python 3.8.

Frustratingly enough, back in July 2023, the installation instruction (pip install git+https://github.com/bhoeckendorf/pyklb.git@skbuild) 'just worked' for me! I even shared the good news with @bhoeckendorf over email (Jul 19, 2023, @ana42742 Cc'd).

I had to create a fresh new virtual environment for pyklb; I couldn't install it in any of my existing environments. It was okay for our needs, since NumPy is already installed in Python venvs, and as long as we can load KLB data files into Python, we can always save the NumPy arrays and load them elsewhere for processing (see, e.g., code at the end of this section).

May I ask what your use case is for installing pyklb?

Back in July 2023, I was running Python 3.9 system-wide. In October 2023, I upgraded my setup to 3.10 because of (thanks to) SPEC 0. Aww, I should have expected problems with research code, which is typically (regrettably but understandably) not really maintained... Nonsense, you will say, since virtual environments are precisely meant to pin package versions.

Of course, I think I messed up: I remember 'forcing' Python 3.10 'everywhere' because, even after it was properly installed, my default (system-wide) Python would still point to some Python 3.9; I believe that's because I have Conda, Miniconda, Mamba, and too much clutter in my paths, symlinks, ... There must be conflicts somewhere with all these Python layers.

For example, here's something weird:

(base) marianne@mkcor:~/Work$ python --version
Python 3.10.0
(base) marianne@mkcor:~/Work$ which python
/home/marianne/mambaforge/bin/python
(base) marianne@mkcor:~/Work$ python3.9 --version
Python 3.9.15
(base) marianne@mkcor:~/Work$ which python3.9
/home/marianne/mambaforge/bin/python3.9
(base) marianne@mkcor:~/Work$ python3.9 -m venv ~/.virtualenv/pyklb/
(base) marianne@mkcor:~/Work$ source ~/.virtualenv/pyklb/bin/activate
(pyklb) (base) marianne@mkcor:~/Work$ python --version  # WHAT???
Python 3.10.0
(pyklb) (base) marianne@mkcor:~/Work$ which python
/home/marianne/.virtualenv/pyklb/bin/python
(pyklb) (base) marianne@mkcor:~/Work$ /home/marianne/.virtualenv/pyklb/bin/python --version
Python 3.9.15

Now it makes me pretty anxious to realize that venvs are not as isolated as they 'should' be(?); today, when I activated my "Jul 19, 2023" venv, I couldn't import pyklb anymore (ModuleNotFoundError). I nuked the venv; I regret doing so now, because I can't inspect it anymore, but I know that it was running Python 3.9.15 back in July.

In my normal practice, I create and re-create venvs whenever, since all I need is the requirements file... From the error log, it looks like this project (pyklb) is just missing the new style of source tree based around pyproject.toml as defined by PEP 517 -- but how come did it work for me back in July?

Thanks for reading my rant,
Marianne

@lagru
Copy link

lagru commented Jan 25, 2024

I think I managed it. Here's what I did:

micromamba create -n trypyklb python=3.9
micromamba activate trypyklb
git clone https://github.com/bhoeckendorf/pyklb.git
cd pyklb
git switch skbuild

I'm using micromamba to get access to Python 3.9 but use pip from then on.

There's a pyproject.toml with dependencies in this branch. Unfortunately they aren't pinned and it seems that the build setup is broken for new releases. I remember that Cython changed significant things for the 3.0 release. But might be other stuff too. So I backtracked on PyPI and pinned the dependencies to before Jul 2, 2021.

Patch

Safe below to file.patch and apply with git am < file.patch or do so manually

From a3319dec03aa7997b107d217a336d10779e6aa15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lars=20Gr=C3=BCter?= <[email protected]>
Date: Thu, 25 Jan 2024 13:14:02 +0100
Subject: [PATCH] Pin dependencies

---
 pyproject.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyproject.toml b/pyproject.toml
index 3d25ae5..e60aca5 100755
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,2 +1,2 @@
 [build-system]
-requires = ["cmake", "cython", "numpy", "setuptools", "scikit-build", "wheel"]
+requires = ["cmake==3.20.4", "cython==0.29.23", "numpy==1.21.0", "setuptools==57.0.0", "scikit-build==0.11.1", "wheel"]
-- 
2.43.0

Then I simply ran pip install -v . inside the directory. I checked the resulting install with python test/test_pyklb.py which succeeds. Hope that works out for you. Note I'm on Arch Linux; I'm not sure whether my system gcc or one from the mamba env was used (it seems to install _libgcc_mutex by default, so good chance).

@mkcor
Copy link

mkcor commented Jan 25, 2024

Thank you so much, genius @lagru! 🙏

I just used mamba instead of micromamba and ran python with its prefix (to avoid my own issue with Python 3.10 overriding all other Python aliases).

I hope this can be helpful to @jmmuncie as well!

@jmmuncie
Copy link
Author

Thanks a lot @lagru! In the meantime, I had been able to use pre-compiled libraries from a collaborator that worked with my system, but it's great to have a more generalizable solution. Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants