質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Q&A

0回答

1642閲覧

utunbu上で、vcpkgのライブラリをインストールできない

退会済みユーザー

退会済みユーザー

総合スコア0

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

0グッド

0クリップ

投稿2020/08/20 13:39

前提・実現したいこと

・Windows10上のOracle VirtualBox6.1から、utunbu18.04を使用して、
Mecab+ipadic+neopadsをインストールした後、sentencepieceを使えるようにすることが目的。

ここに質問の内容を詳しく書いてください。
・Mecab+ipadic-neopadsをインストールした後、以下のようにsourceディレクトリを作成し、
root@dlp:/home/tgoh# mkdir source

・Vcpkgのレポジトリを以下のようにcloneし、
root@dlp:/home/tgoh/source# git clone htts://github.com/Microsoft/vcpkg.git

・この後、vcpkgディレクトリを作成し、Source ~/.profileで /home/tgoh/source/vcpkgのパスを通してから、中にあるbootstrap-vcpkg.shを実行しました。
root@dlp:/home/tgoh/source/vcpkg# ./bootstrap-vcpkg.sh

・この後、vcpkgのライブラリを作成するため、付属のREADME.mdに従って、[build directory]をmkdir buildにして、cd buildで移動し、下記cmakeコマンドを実行すると、
root@dlp:/home/tgoh/source/vcp/build# cmake -B /home/tgoh/source/vcp/build -S . -DCMAKE_TOOLCHAIN_FILE=/home/tgoh/source/vcpkg/scripts/buildsystems/vcpkg.cmake

・以下のエラーが発生しました。

発生している問題・エラーメッセージ

root@dlp:/home/tgoh/source/vcpkg/build# cmake -B /home/tgoh/source/vcpkg/build -S . -DCMAKE_TOOLCHAIN_FILE=/home/tgoh/source/vcpkg/scripts/buildsystems/vcpkg.cmake
CMake Error: The source directory "/home/tgoh/source/vcpkg/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

該当のソースコード

試したこと

ここに問題に対して試したことを記載してください。

・TOOLCHAINなのでバッチ処理みたいに一括でライブラリを作成することは推測でき、またCMakeLists.txtが必要なことは解っていましたが、find -name CmakeLists.txtを実行して適切なものがどれか解らず、visual C++に関するライブラリの作成方法は多く見られましたが、linux、64ビット用の文献は少なく、
Vcpkg searchを実行して必要なライブラリを探して、vcpkg install ライブラリ名で、インストールする方法も探しましたが、sentencepieceで使用するライブラリがどれか解らないので、
やはり、全部をバッチ処理みたいにするしかないと考え、

「Cmakeプロジェクトの場合は、CMAKE_TOOLCHAIN_FILEを使用して、ライブラリをfind_package()で使用できるようにします。たとえば、LinuxまたはmacOSの場合は次のようになります。
Cmake .. -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake」

とのウェブ上のアドバイスも実施しましたが、やはりCmakeLists.txtの作成は必須のようで、
なおかつ下記のQ&Aを読むと、toolchainも作成する必要があるようで、この辺りで完全に行き詰ってしまいました。

・試しに、README.mdに記載の下記のCmakeLists.txtの内容を作成して、
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")

・下記コマンドを実行してみましたが、エラーになります。
root@dlp:/home/tgoh/source/vcpkg# cmake -B build -S .
CMake Error: The source "/home/tgoh/source/vcpkg/CMakeLists.txt" does not match the source "/home/tgoh/source/vcpkg/build/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.

・まだ基本的なことを理解していないからですが、何かしらのアドバイスを頂ければ誠に幸いです。
よろしくお願いいたします。

・以下は、参考にしたQ&Aの投稿です。
How to integrate vcpkg in linux with cross build toolchain, as well as sysroot?
My question is, how to integrate vcpkg in linux with cross build toolchain, as well as sysroot? example:
• build machine is fedora30
• cross build toolchain is x86_64-centos7-gnu
from https://github.com/microsoft/vcpkg quickstart says:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg

PS> .\bootstrap-vcpkg.bat
Linux:~/$ ./bootstrap-vcpkg.sh
On my machine I have gcc 9.1 installed which is detected by vcpkg's bootstrap.sh and work fine;
Meanwhile, I built a toolchain for crossbuilding, which sits in $HOME/cross/x64_86-centos7-linux-gnu/
How can I setup another vcpkg dir tree which uses that perticular toolchain?
By 'use', I mean vcpkg and all its packages should be compiled by that toolchain, and my projects which use vcpkg's toolchain_file '$vcpkg_home/scripts/buildsystems/vcpkg.cmake' should all have that toolchain as $CC and build toolset?
linux cmake vcpkg
share improve this question follow
edited Nov 9 '19 at 16:30
asked Nov 9 '19 at 9:02
Michaelzh
18211 silver badge1010 bronze badges
• Did you follow all the steps from the Quickstart? Did you get errors? Which steps worked, or didn't work? Please add these details to your question post! – squareskittles Nov 9 '19 at 14:49
• edit: On my machine I have gcc 9.1 installed which is detected by vcpkg's bootstrap.sh and work fine; Meanwhile, I built a toolchain for crossbuilding, which sits in $HOME/cross/x64_86-centos7-linux-gnu/ How can I setup another vcpkg dir tree which uses that perticular toolchain? By 'use', I mean vcpkg and all its packages should be compiled by that toolchain, and my projects which use vcpkg's toolchain_file '$vcpkg_home/scripts/buildsystems/vcpkg.cmake' should all have that toolchain as $CC and build toolset? – Michaelzh Nov 9 '19 at 16:32
• Please add all this information to your question post – squareskittles Nov 9 '19 at 16:38
• Quick start: all steps to me work fine, compiled and runned a program with some vcpkg's packages; Non-quickstart: problem is no cmake-ish xxx-toolchain.cmake in my cross compile toolchain dir tree to try as a -DCMAKE_TOOLCHAIN_FILE list item. – Michaelzh Nov 9 '19 at 16:43
• Not to mention that wish to compile vcpkg downloaded packages to install with that toolchain which I think is obviously a requirement to build projects. – Michaelzh Nov 9 '19 at 16:47
show 1 more comment

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

unoSSkR

2020/08/21 08:46

Afraid it could be because you didn't follow the README. Where is the subdirectory named vcp in the /home/tgoh/source/vcp/build directory? README tells you to execute ./vcpkg/bootstrap-vcpkg.sh, not ./bootstrap-vcpkg.sh. Also tells you to execute cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=... without moving any other directory. Read carefully.
dameo

2020/08/21 22:20

英語でもちゃんと読みましょうってことね https://github.com/microsoft/vcpkg 最初に https://github.com/microsoft/vcpkg#installing-linux-developer-tools を読んでubuntuで必要なパッケージ入れたら、適当なディレクトリ作ってそこで git clone https://github.com/microsoft/vcpkg ./vcpkg/bootstrap-vcpkg.sh ./vcpkg/vcpkg install sentencepiece で終わり。パッケージ検索するならinstallの代わりにsearchとかそういうのがあるよ。 一体何を読んでそんなことをしてるのか他人には理解できないですよ。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問