sbip-sg / tsll

Tsll is a Typescript-to-LLVM-IR compiler frontend authored by Singapore Blockchain Innovation Programme (SBIP).

Home Page:https://www.comp.nus.edu.sg/~dbsystem/discover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node installation issue

taquangtrung opened this issue · comments

Hi @lung21,

I encountered this error when trying to run npm install

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@lungchen%2fllvm-node - Not found
npm ERR! 404
npm ERR! 404  '@lungchen/llvm-node@^0.0.4' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Can you help to check?

@taquangtrung I already set @lungchen/llvm-node visible to the public. Now you should be able to install the package. Before npm install again, please fetch the latest main branch to update the package version.

Thanks @lung21!

I can continue the installation of npm install, but face another issue.

It might due to the reason that I used a newer LLVM version: LLVM 13.

npm ERR! -- Detecting CXX compile features - done
npm ERR! -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
npm ERR! -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10")
npm ERR! -- Found LLVM 13.0.0
npm ERR! -- Using LLVMConfig.cmake in: /home/trungtq/llvm/llvm-13/lib/cmake/llvm
npm ERR! -- Configuring done
npm ERR! -- Generating done
npm ERR! -- Build files have been written to: /home/trungtq/workspace/sbip/typescriptllvm/node_modules/@lungchen/llvm-node/build
npm ERR! [1/51] Building CXX object CMakeFiles/llvm-node.dir/src/config/llvm-config.cc.o
npm ERR! [2/51] Building CXX object CMakeFiles/llvm-node.dir/src/config/config.cc.o
npm ERR! [3/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/array-type.cc.o
npm ERR! [4/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/argument.cc.o
npm ERR! [5/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/attribute.cc.o
npm ERR! [6/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/calling-conv.cc.o
npm ERR! [7/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/atomic-rmw-inst.cc.o
npm ERR! [8/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/basic-block.cc.o
npm ERR! [9/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/alloca-inst.cc.o
npm ERR! [10/51] Building CXX object CMakeFiles/llvm-node.dir/src/ir/call-inst.cc.o
npm ERR! [11/51] Building CXX object CMakeFiles/llvm-node.dir/src/bitcode/bitcode.cc.o
npm ERR! [12/51] Building CXX object CMakeFiles/llvm-node.dir/src/bitcode/bitcode-writer.cc.o
npm ERR! FAILED: CMakeFiles/llvm-node.dir/src/bitcode/bitcode-writer.cc.o
npm ERR! /usr/bin/c++  -DNOMINMAX -Dllvm_node_EXPORTS -I/home/trungtq/.cmake-js/node-x64/v12.22.6/include/node -I/home/trungtq/workspace/sbip/typescriptllvm/node_modules/nan -I.././node_modules/nan -I/home/trungtq/llvm/llvm-13/include -O3 -DNDEBUG -fPIC   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++14 -MD -MT CMakeFiles/llvm-node.dir/src/bitcode/bitcode-writer.cc.o -MF CMakeFiles/llvm-node.dir/src/bitcode/bitcode-writer.cc.o.d -o CMakeFiles/llvm-node.dir/src/bitcode/bitcode-writer.cc.o -c ../src/bitcode/bitcode-writer.cc
npm ERR! ../src/bitcode/bitcode-writer.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE WriteBitcodeToFile(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/bitcode/bitcode-writer.cc:24:77: error: ‘F_None’ is not a member of ‘llvm::sys::fs’; did you mean ‘OF_None’?
npm ERR!    24 |     llvm::raw_fd_ostream byteCodeFile { fileName, errorCode, llvm::sys::fs::F_None };
npm ERR!       |                                                                             ^~~~~~
npm ERR!       |                                                                             OF_None
npm ERR! ../src/bitcode/bitcode-writer.cc:24:84: error: no matching function for call to ‘llvm::raw_fd_ostream::raw_fd_ostream(<brace-enclosed initializer list>)’
npm ERR!    24 |     llvm::raw_fd_ostream byteCodeFile { fileName, errorCode, llvm::sys::fs::F_None };
npm ERR!       |                                                                                    ^
npm ERR! In file included from ../src/bitcode/bitcode-writer.cc:5:
npm ERR! /home/trungtq/llvm/llvm-13/include/llvm/Support/raw_ostream.h:504:3: note: candidate: ‘llvm::raw_fd_ostream::raw_fd_ostream(int, bool, bool, llvm::raw_ostream::OStreamKind)’
npm ERR!   504 |   raw_fd_ostream(int fd, bool shouldClose, bool unbuffered = false,
npm ERR!       |   ^~~~~~~~~~~~~~
npm ERR! /home/trungtq/llvm/llvm-13/include/llvm/Support/raw_ostream.h:504:22: note:   no known conversion for argument 1 from ‘std::__cxx11::basic_string<char>’ to ‘int’
npm ERR!   504 |   raw_fd_ostream(int fd, bool shouldClose, bool unbuffered = false,
npm ERR!       |                  ~~~~^~
npm ERR! /home/trungtq/llvm/llvm-13/include/llvm/Support/raw_ostream.h:497:3: note: candidate: ‘llvm::raw_fd_ostream::raw_fd_ostream(llvm::StringRef, std::error_code&, llvm::sys::fs::CreationDisposition, llvm::sys::fs::FileAccess, llvm::sys::fs::OpenFlags)’

@taquangtrung
The build failed as you have realized so you may proceed with LLVM 11 for now. I will make the bindings compatible with LLVM 13 later. Thanks 👍🏼

@taquangtrung
Typescriptllvm should be compatible with LLVM 13 now.

Great! Thanks @lung21! I'll test your compiler :)