cornell-zhang / allo

Allo: A Programming Model for Composable Accelerator Design
https://cornell-zhang.github.io/allo
Apache License 2.0
122 stars 14 forks source link

[BUG] Installation Issue #131

Closed lab-ascent closed 7 months ago

lab-ascent commented 7 months ago

Describe the bug Installation fails with CMake error

To Reproduce bash build.sh at checkout hash e2f1e16802a46ec9b4a150fd29a23f3022bc3670.

Buggy output

-- Targeting X86
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION                                      
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Success                            
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS                                                    
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed                                           
-- Found Python3: /tools/Tools/MiniConda/envs/allo/bin/python3 (found suitable version "3.12.1", minimum
required is "3.6") found components: Interpreter Development Development.Module Development.Embed       
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):              
  Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found                             
  suitable version "3.12.1", minimum required is "3.6")                                                 
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)             
  /usr/share/cmake/Modules/FindPython/Support.cmake:3766 (find_package_handle_standard_args)            
  /usr/share/cmake/Modules/FindPython3.cmake:551 (include)                                              
  /tools/ToolSource/allo/externals/hcl_mlir/externals/llvm-project/mlir/cmake/modules/MLIRDetectPythonEnv.cmake:21 (find_package)
  /tools/ToolSource/allo/externals/hcl_mlir/externals/llvm-project/mlir/CMakeLists.txt:156 (mlir_configure_python_dev_packages)

-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.                                            
LLVM build directory: /tools/ToolSource/allo/externals/hcl_mlir/externals/llvm-project/build            
Building hcl dialect ...
-- The CXX compiler identification is GNU 8.5.0
-- The C compiler identification is GNU 8.5.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
-- 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
CMake Error at CMakeLists.txt:16 (find_package):
  Could not find a package configuration file provided by "MLIR" with any of                            
  the following names:

    MLIRConfig.cmake
    mlir-config.cmake

  Add the installation prefix of "MLIR" to CMAKE_PREFIX_PATH or set                                     
  "MLIR_DIR" to a directory containing one of the above files.  If "MLIR"                               
  provides a separate development package or SDK, be sure it has been                                   
  installed.

-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.                                            
build.sh: line 48: cd: tools/hcl/python_packages/hcl_core: No such file or directory                    
Obtaining file:///tools/ToolSource/allo/externals/hcl_mlir/build                                        
ERROR: file:///tools/ToolSource/allo/externals/hcl_mlir/build does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
Installation completed!

Additional context Add any other context about the problem here.

Created conda virtual environment using conda from Miniconda (https://docs.conda.io/projects/miniconda/en/latest/).

(allo) [dpal2@pal-achieve-01 allo]$ which python
/tools/Tools/MiniConda/envs/allo/bin/python
(allo) [dpal2@pal-achieve-01 allo]$ python --version
Python 3.12.1
(allo) [dpal2@pal-achieve-01 allo]$ 

GCC = 8.5.0 (Red Hat 8.5)

zzzDavid commented 7 months ago

Hi Debjit,

I have repeated this issue. This is caused by missing numpy headers. Try install the python dependencies before running the build script:

python -m pip install -r requirements.txt

I'm making a PR to update the build script.