Skip to content

Compilation broken on windows #76

Open
@handdara

Description

@handdara

Environment:

  • Windows 10
  • CUDA toolkit 11.4
  • cabal 3.10.2.1
  • ghc 9.4.8

Steps to reproduce:

  1. Install CUDA toolkit 11.4, and make sure PATH has the mingw/bin folder on it for the mingw packaged w ghcup
  2. make a new temp executable project with cabal init (.cabal is below)
  3. add cuda haskell library to dependencies in the cabal file
  4. run cabal configure and cabal build

Details

Cabal file
cabal-version:      3.0
name:               hs-cuda-test
version:            0.1.0.0
license:            GPL-3.0-only
license-file:       LICENSE
build-type:         Simple

common warnings
    ghc-options: -Wall

executable hs-cuda-test
    import:           warnings
    main-is:          Main.hs
    build-depends:    	
          base ^>=4.17.2.1,
          cuda,
    hs-source-dirs:   app
    default-language: Haskell2010
Error readout
[41 of 44] Compiling Foreign.CUDA.Driver.Graph.Build ( dist\build\Foreign\CUDA\Driver\Graph\Build.hs, dist\build\Foreign\CUDA\Driver\Graph\Build.o )

src\Foreign\CUDA\Driver\Graph\Build.chs:183:48: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `cuGraphAddChildGraphNode'_', namely
        `a3'2'
      In the first argument of `(>>=)', namely
        cuGraphAddChildGraphNode'_ a1' a2' a3'1 a3'2 a4'
      In the expression:
        cuGraphAddChildGraphNode'_ a1' a2' a3'1 a3'2 a4'
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
183 |       , withNodeArrayLen* `[Node]'&
    |                                                ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:209:46: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `cuGraphAddDependencies'_', namely
        `a3'2'
      In the first argument of `(>>=)', namely
        `cuGraphAddDependencies'_ a1' a2' a3'1 a3'2'
      In the expression:
        cuGraphAddDependencies'_ a1' a2' a3'1 a3'2
          >>= \ res -> checkStatus res >> return ()
    |
209 |       , withNodeArray*    `[Node]'
    |                                              ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:235:49: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `cuGraphRemoveDependencies'_', namely
        `a3'2'
      In the first argument of `(>>=)', namely
        `cuGraphRemoveDependencies'_ a1' a2' a3'1 a3'2'
      In the expression:
        cuGraphRemoveDependencies'_ a1' a2' a3'1 a3'2
          >>= \ res -> checkStatus res >> return ()
    |
235 |       , withNodeArray*    `[Node]'
    |                                                 ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:256:28: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `addEmpty'_', namely `a3'2'
      In the first argument of `(>>=)', namely
        `addEmpty'_ a1' a2' a3'1 a3'2'
      In the expression:
        addEmpty'_ a1' a2' a3'1 a3'2
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
256 |   { alloca-           `Node' peekNode*
    |                            ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:280:27: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `addHost'_', namely `a3'2'
      In the first argument of `(>>=)', namely
        addHost'_ a1' a2' a3'1 a3'2 a4' a5'
      In the expression:
        addHost'_ a1' a2' a3'1 a3'2 a4' a5'
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
280 |   , withNodeArrayLen* `[Node]'&
    |                           ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:341:51: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `cuGraphAddKernelNode_simple'_', namely
        `a3'2'
      In the first argument of `(>>=)', namely
        cuGraphAddKernelNode_simple'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12'
      In the expression:
        cuGraphAddKernelNode_simple'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12'
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
341 |       ,                   `Int'
    |                                                   ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:400:29: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `addMemcpy'_', namely `a3'2'
      In the first argument of `(>>=)', namely
        addMemcpy'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14'
          a15' a16' a17' a18' a19' a20' a21' a22' a23'
      In the expression:
        addMemcpy'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10' a11' a12' a13' a14'
          a15' a16' a17' a18' a19' a20' a21' a22' a23'
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
400 |     => Graph
    |                             ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:433:51: error:
    * Couldn't match expected type `CULLong' with actual type `CULong'
    * In the fourth argument of `cuGraphAddMemsetNode_simple'_', namely
        `a3'2'
      In the first argument of `(>>=)', namely
        cuGraphAddMemsetNode_simple'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10'
      In the expression:
        cuGraphAddMemsetNode_simple'_
          a1' a2' a3'1 a3'2 a4' a5' a6' a7' a8' a9' a10'
          >>=
            \ res
              -> checkStatus res >> peekNode a1' >>= \ a1'' -> return (a1'')
    |
433 |       ,                   `Word32'
    |                                                   ^^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:513:37: error:
    * Couldn't match type `CULong' with `CULLong'
      Expected: Ptr CULLong
        Actual: Ptr CULong
    * In the fourth argument of `cuGraphGetEdges'_', namely a4'
      In the first argument of `(>>=)', namely
        cuGraphGetEdges'_ a1' a2' a3' a4'
      In the expression:
        cuGraphGetEdges'_ a1' a2' a3' a4'
          >>= \ res -> checkStatus res >> return ()
    |
513 |       , castPtr      `Ptr Node'
    |                                     ^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:543:33: error:
    * Couldn't match type `CULong' with `CULLong'
      Expected: Ptr CULLong
        Actual: Ptr CULong
    * In the third argument of `cuGraphGetNodes'_', namely a3'
      In the first argument of `(>>=)', namely
        cuGraphGetNodes'_ a1' a2' a3'
      In the expression:
        cuGraphGetNodes'_ a1' a2' a3'
          >>= \ res -> checkStatus res >> return ()
    |
543 |       , castPtr  `Ptr Node'
    |                                 ^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:573:37: error:
    * Couldn't match type `CULong' with `CULLong'
      Expected: Ptr CULLong
        Actual: Ptr CULong
    * In the third argument of `cuGraphGetRootNodes'_', namely a3'
      In the first argument of `(>>=)', namely
        cuGraphGetRootNodes'_ a1' a2' a3'
      In the expression:
        cuGraphGetRootNodes'_ a1' a2' a3'
          >>= \ res -> checkStatus res >> return ()
    |
573 |       , castPtr  `Ptr Node'
    |                                     ^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:603:44: error:
    * Couldn't match type `CULong' with `CULLong'
      Expected: Ptr CULLong
        Actual: Ptr CULong
    * In the third argument of `cuGraphNodeGetDependencies'_', namely
        a3'
      In the first argument of `(>>=)', namely
        cuGraphNodeGetDependencies'_ a1' a2' a3'
      In the expression:
        cuGraphNodeGetDependencies'_ a1' a2' a3'
          >>= \ res -> checkStatus res >> return ()
    |
603 |       , castPtr `Ptr Node'
    |                                            ^^^

src\Foreign\CUDA\Driver\Graph\Build.chs:633:46: error:
    * Couldn't match type `CULong' with `CULLong'
      Expected: Ptr CULLong
        Actual: Ptr CULong
    * In the third argument of `cuGraphNodeGetDependentNodes'_', namely
        a3'
      In the first argument of `(>>=)', namely
        cuGraphNodeGetDependentNodes'_ a1' a2' a3'
      In the expression:
        cuGraphNodeGetDependentNodes'_ a1' a2' a3'
          >>= \ res -> checkStatus res >> return ()
    |
633 |       , castPtr `Ptr Node'
    |                                              ^^^
[42 of 44] Compiling Foreign.CUDA.Driver ( src\Foreign\CUDA\Driver.hs, dist\build\Foreign\CUDA\Driver.o )
[43 of 44] Compiling Foreign.CUDA.Analysis.Occupancy ( src\Foreign\CUDA\Analysis\Occupancy.hs, dist\build\Foreign\CUDA\Analysis\Occupancy.o )
[44 of 44] Compiling Foreign.CUDA.Analysis ( src\Foreign\CUDA\Analysis.hs, dist\build\Foreign\CUDA\Analysis.o )
Error: cabal-3.10.2.1.exe: Failed to build cuda-0.11.0.1 (which is required by
exe:hs-cuda-test from hs-cuda-test-0.1.0.0). See the build log above for
details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions