PMunch / futhark

Automatic wrapping of C headers in Nim
MIT License
355 stars 19 forks source link

installing futhark is erroring out #70

Closed rishavs closed 1 year ago

rishavs commented 1 year ago

I did nimble install futhark on both windows & wsl and hit the same error. Adding the trace text here;

C:\Users\risharan\Documents\Dev\nim\mirana>nimble install futhark
Downloading https://github.com/PMunch/futhark using git
   Warning: Package 'futhark' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'futhark.nim', but a file named 'opir.nim' was found. This will be an error in the future.
      Hint: If this is the primary source file in the package, rename it to 'futhark.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'futhark', then move it into a 'futhark\' subdirectory. If it's a test file or otherwise not required to build the the package 'futhark.nim', prevent its installation by adding `skipFiles = @["opir.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.
  Verifying dependencies for futhark@0.9.1
 Installing https://github.com/PMunch/libclang-nim@#head
Downloading https://github.com/PMunch/libclang-nim using git
   Warning: Package 'clang' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'clang', but file 'BuildSystem.nim' is in a directory named 'clangpkg' instead. This will be an error in the future.
      Hint: If 'clangpkg' contains source files for building 'clang', rename it to 'clang'. Otherwise, prevent its installation by adding `skipDirs = @["clangpkg"]` to the .nimble file.
  Verifying dependencies for clang@#head
 Installing clang@#head
   Success: clang installed successfully.
 Installing termstyle@any version
Downloading https://github.com/PMunch/termstyle using git
  Verifying dependencies for termstyle@0.1.0
 Installing termstyle@0.1.0
   Success: termstyle installed successfully.
 Installing macroutils@any version
Downloading https://github.com/PMunch/macroutils using git
  Verifying dependencies for macroutils@1.2.0
 Installing macroutils@1.2.0
   Success: macroutils installed successfully.
 Installing futhark@0.9.1
   Building futhark/opir.exe using c backend
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(158, 1) Warning: catch a more precise Exception deriving from CatchableError or Defect. [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(357, 39) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(359, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(360, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(361, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(362, 55) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(364, 38) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\src\opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
c:/users/risharan/scoop/apps/mingw-winlibs/current/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang: No such file or directory
collect2.exe: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc.exe   -o C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark\opir.exe  C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sstd@sprivate@sdigitsutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sassertions.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sformatfloat.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sdollars.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@swidestrs.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sio.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sparseutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@smath.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@salgorithm.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sstrutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@spathnorm.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sdynlib.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@swindows@swinlean.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@soptions.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@stimes.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sstd@sprivate@swin_setenv.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sos.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@shashes.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@scollections@stables.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sjson.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sposix@sposix.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@s.nimble@spkgs@sclang-@hhead@sclangpkg@sIndex.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@s.nimble@spkgs@stermstyle-0.1.0@stermstyle.nim.c.o C:\Users\risharan\nimcache\opir_r\@mopir.nim.c.o   -lclang  '
    Prompt: Build failed for 'futhark@0.9.1', would you like to try installing 'futhark@#head' (latest unstable)? [y/N]
    Answer: y
Downloading https://github.com/PMunch/futhark using git
  Verifying dependencies for futhark@#head
      Info: Dependency on https://github.com/PMunch/libclang-nim@#head already satisfied
  Verifying dependencies for clang@#head
      Info: Dependency on termstyle@any version already satisfied
  Verifying dependencies for termstyle@0.1.0
      Info: Dependency on macroutils@any version already satisfied
  Verifying dependencies for macroutils@1.2.0
 Installing https://github.com/PMunch/nimbleutils@>= 0.3.0
Downloading https://github.com/PMunch/nimbleutils using git
  Verifying dependencies for nimbleutils@0.3.0
 Installing nimbleutils@0.3.0
   Success: nimbleutils installed successfully.
 Installing futhark@#head
   Building futhark/opir.exe using c backend
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(161, 1) Warning: catch a more precise Exception deriving from CatchableError or Defect. [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(360, 39) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(362, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(363, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(364, 35) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(365, 55) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(367, 38) template/generic instantiation of `parseReturn` from here
C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim(356, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
c:/users/risharan/scoop/apps/mingw-winlibs/current/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang: No such file or directory
collect2.exe: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc.exe   -o C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\opir.exe  C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sstd@sprivate@sdigitsutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sassertions.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sformatfloat.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sdollars.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@swidestrs.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem@sio.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@ssystem.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sparseutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@smath.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@salgorithm.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sstrutils.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@spathnorm.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sdynlib.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@swindows@swinlean.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@soptions.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@stimes.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sstd@sprivate@swin_setenv.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sos.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@shashes.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@scollections@stables.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@spure@sjson.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@sscoop@sapps@snim@scurrent@slib@sposix@sposix.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@s.nimble@spkgs@sclang-@hhead@sclangpkg@sIndex.nim.c.o C:\Users\risharan\nimcache\opir_r\@m..@s..@s..@s..@s..@s..@s.nimble@spkgs@stermstyle-0.1.0@stermstyle.nim.c.o C:\Users\risharan\nimcache\opir_r\@mopir.nim.c.o   -lclang  '
       Tip: 48 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: futhark
        ... Execution failed with exit code 1
        ... Command: C:\Users\risharan\scoop\shims\nim.exe c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.9.1 --path:C:\Users\risharan\.nimble\pkgs\clang-#head --path:C:\Users\risharan\.nimble\pkgs\termstyle-0.1.0 --path:C:\Users\risharan\.nimble\pkgs\macroutils-1.2.0 --path:C:\Users\risharan\.nimble\pkgs\nimbleutils-0.3.0 --hints:off -o:C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\opir.exe C:\Users\risharan\AppData\Local\Temp\nimble_89316\githubcom_PMunchfuthark_#head\src\opir.nim

C:\Users\risharan\Documents\Dev\nim\mirana>clang -v
clang version 16.0.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\risharan\scoop\apps\llvm\current\bin

C:\Users\risharan\Documents\Dev\nim\mirana>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/users/risharan/scoop/apps/mingw-winlibs/current/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/R/winlibs64_stage/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --enable-libstdcxx-pch --with-mpc=/d/Prog/winlibs64_stage/custombuilt --with-mpfr=/d/Prog/winlibs64_stage/custombuilt --with-gmp=/d/Prog/winlibs64_stage/custombuilt --with-isl=/d/Prog/winlibs64_stage/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/R/winlibs64_stage/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/d/Prog/winlibs64_stage/custombuilt/include/libdl-win32 -Wno-int-conversion' CXXFLAGS=-Wno-int-conversion LDFLAGS='-pthread -Wl,--dynamicbase -Wl,--high-entropy-va -Wl,--nxcompat -Wl,--tsaware'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-msvcrt-posix-seh, built by Brecht Sanders) 

C:\Users\risharan\Documents\Dev\nim\mirana>
PMunch commented 1 year ago

c:/users/risharan/scoop/apps/mingw-winlibs/current/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lclang: No such file or directory

You don't appear to have libclang installed correctly

rishavs commented 1 year ago

I did try with wsl. Here is the error;

rishav@Rishav-SB3:/mnt/c/Users/risharan/Documents/Dev/nim/mirana/linux$ nimble install futhark
    Prompt: No local packages.json found, download it from internet? [y/N]
y
    Answer: Downloading Official package list
    Success Package list downloaded.
Downloading https://github.com/PMunch/futhark using git
   Warning: Package 'futhark' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'futhark.nim', but a file named 'opir.nim' was found. This will be an error in the future.
      Hint: If this is the primary source file in the package, rename it to 'futhark.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'futhark', then move it into a 'futhark/' subdirectory. If it's a test file or otherwise not required to build the the package 'futhark.nim', prevent its installation by adding `skipFiles = @["opir.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.
  Verifying dependencies for futhark@0.9.1
 Installing https://github.com/PMunch/libclang-nim@#head
Downloading https://github.com/PMunch/libclang-nim using git
   Warning: Package 'clang' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'clang', but file 'CXErrorCode.nim' is in a directory named 'clangpkg' instead. This will be an error in the future.
      Hint: If 'clangpkg' contains source files for building 'clang', rename it to 'clang'. Otherwise, prevent its installation by adding `skipDirs = @["clangpkg"]` to the .nimble file.
  Verifying dependencies for clang@#head
 Installing clang@#head
   Success: clang installed successfully.
 Installing termstyle@any version
Downloading https://github.com/PMunch/termstyle using git
  Verifying dependencies for termstyle@0.1.0
 Installing termstyle@0.1.0
   Success: termstyle installed successfully.
 Installing macroutils@any version
Downloading https://github.com/PMunch/macroutils using git
  Verifying dependencies for macroutils@1.2.0
 Installing macroutils@1.2.0
   Success: macroutils installed successfully.
 Installing futhark@0.9.1
   Building futhark/opir using c backend
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(158, 1) Warning: catch a more precise Exception deriving from CatchableError or Defect. [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(357, 39) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(359, 35) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(360, 35) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(361, 35) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(362, 55) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(364, 38) template/generic instantiation of `parseReturn` from here
/tmp/nimble_22369/githubcom_PMunchfuthark/src/opir.nim(353, 11) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
/usr/bin/ld: cannot find -lclang: No such file or directory
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc   -o /tmp/nimble_22369/githubcom_PMunchfuthark/opir  /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@sstd@sprivate@sdigitsutils.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@ssystem@sassertions.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@ssystem@sformatfloat.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@ssystem@sdollars.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@ssystem@sio.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@ssystem.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@sparseutils.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@smath.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@salgorithm.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@sstrutils.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@spathnorm.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@soptions.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@stimes.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@sos.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@shashes.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@scollections@stables.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.choosenim@stoolchains@snim-1.6.12@slib@spure@sjson.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.nimble@spkgs@sclang-@hhead@sclangpkg@sIndex.nim.c.o /home/rishav/.cache/nim/opir_r/@m..@s..@s..@s..@shome@srishav@s.nimble@spkgs@stermstyle-0.1.0@stermstyle.nim.c.o /home/rishav/.cache/nim/opir_r/@mopir.nim.c.o  -lm -lm -lrt  -lclang  -ldl'
    Prompt: Build failed for 'futhark@0.9.1', would you like to try installing 'futhark@#head' (latest unstable)? [y/N]
n
    Answer:        Tip: 33 messages have been suppressed, use --verbose to show them.
     Error: Aborting installation due to build failure
PMunch commented 1 year ago

/usr/bin/ld: cannot find -lclang: No such file or directory

Same error, you don't have libclang installed.

rishavs commented 1 year ago

That's strange. I am able to use clang on both;

C:\Users\risharan\Documents\Dev\nim\mirana>clang -v
clang version 16.0.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\risharan\scoop\apps\llvm\current\bin

and on wsl

rishav@Rishav-SB3:/mnt/c/Users/risharan/Documents/Dev/nim/mirana/linux$ clang -v
Ubuntu clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64

Could it be something related to having multiple clang version installed on the OS? Is there a way to pass the clang path to futhark so that it refers to a specific clang version?

PMunch commented 1 year ago

Clang != libclang. They are often shipped separately. You might also simply be running into path issues. Futhark tries to find libclang on its own, but if you installed it in a strange location it might not be able to.

rishavs commented 1 year ago

Thanks for your patience. Is it possible for me to specify a path to libclang library during futhank installation? I am unable to resolve this issue on my side. I do have libclang also installed but still getting the same issue.

If I can specify a path to libclang, or just have the libclang lib in the project directory for me to finish the installation of futhark , I would be unblocked.

PMunch commented 1 year ago

You should be able to specify with --passL:"-L<path to libclang.dll>" I believe

zembrowski commented 1 year ago

For people just rushing here in to get futhark running with nimlang/nim Docker image or Ubuntu 20:

ln -s libclang-10.so /usr/lib/x86_64-linux-gnu/libclang.so

@PMunch Maybe it would be a good idea to expose the Installation section or even add some OS specific hints there. For Ubuntu libclang-dev is being installed in /usr/lib/x86_64-linux-gnu and has a version specific addendum. Therefore ld fails when linking -lclang.

PMunch commented 1 year ago

@zembrowski sounds like a good idea. Since I can't verify paths and such without installing another OS I would be very happy to receive PRs with install instructions for different OSs and the Docker container.