Skip to content

Instantly share code, notes, and snippets.

@Reetok3
Last active September 9, 2019 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Reetok3/e56ece54757bd23f503f8746d6af8d65 to your computer and use it in GitHub Desktop.
Save Reetok3/e56ece54757bd23f503f8746d6af8d65 to your computer and use it in GitHub Desktop.

課題1.2のmakeで失敗してしまいます。

以下にバージョン、エラーを記載しました。

どのように対処すればいいのか教えていただけると嬉しいです。

環境、バージョン

環境、バージョンは以下のとおりです。

$uname -a                                                                                                                     20:41:07
Linux ubuntu-vaio-pc 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$cat /etc/lsb-release                                                                                                         20:40:39
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

$make --version                                                                                                               20:41:16
GNU Make 4.1
このプログラムは x86_64-pc-linux-gnu 用にビルドされました
Copyright (C) 1988-2014 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 以降 <http://gnu.org/licenses/gpl.html>
これはフリーソフトウェアです: 自由に変更および配布できます.
法律の許す限り、 無保証 です.

$clang --version                                                                                                              20:42:46
clang version 10.0.0 (trunk 371331) (llvm/trunk 371329)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

また、clangのビルドとインストールは、下のサイトを参考にしました。

https://www.hiroom2.com/2016/05/08/ubuntu-16-04にリポジトリのllvm-clangをビルドしてインストールする/

エラー

エラーは以下のとおりです。

$pwd
/home/xxxxxxxxxx/Dev/github.com/yamaguchi1024/mc-lang-1
$make
clang++ `llvm-config --cxxflags --ldflags --system-libs --libs all` src/mc.cpp -o mc
In file included from src/mc.cpp:44:
src/parser.h:113:19: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
    auto Result = llvm::make_unique<NumberAST>(lexer.getNumVal());
                  ^~~~~~~~~~~~~~~~~
                  std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:44:
src/parser.h:113:19: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
    auto Result = llvm::make_unique<NumberAST>(lexer.getNumVal());
                  ^~~~~~~~~~~~~~~~~
                  std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:44:
src/parser.h:197:22: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
        auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
                     ^~~~~~~~~~~~~~~~~
                     std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:44:
src/parser.h:197:22: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
        auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
                     ^~~~~~~~~~~~~~~~~
                     std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:44:
src/parser.h:199:16: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
        return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
               ^~~~~~~~~~~~~~~~~
               std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:44:
src/parser.h:199:16: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
        return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
               ^~~~~~~~~~~~~~~~~
               std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:46:
src/codegen.h:123:12: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
myModule = llvm::make_unique<Module>("my cool jit", Context);
           ^~~~~~~~~~~~~~~~~
           std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
In file included from src/mc.cpp:46:
src/codegen.h:123:12: error: no template named 'make_unique' in namespace 'llvm'; did you mean 'std::make_unique'?
myModule = llvm::make_unique<Module>("my cool jit", Context);
           ^~~~~~~~~~~~~~~~~
           std::make_unique
/usr/lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/unique_ptr.h:824:5: note: 'std::make_unique' declared here
    make_unique(_Args&&... __args)
    ^
8 errors generated.
Makefile:7: recipe for target 'mc' failed
make: *** [mc] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment