end0tknr's kipple - 新web写経開発

http://d.hatena.ne.jp/end0tknr/ から移転しました

fuse (fuse-utils) + goofys を srcから install し、aws s3をlocalにmount

2018/11/9 追記

ここでinstall手順をあれやこれや記載していますが http://bit.ly/goofys-latest から、 linuxバイナリ( https://github.com/kahing/goofys )も配布されています。

はじめに

s3fs は知っていましたが、goofys の選択肢もあり、それが s3fs より高速らしい。 (Goで書かれていて、POSIXに完全には準拠していないせいでしょうか?)

更にこれらは、fuseという仮想?ファイルシステムを作成できる機能を利用しているらしい。

と言う訳で、今回は fuse (libspectrum) や goofys を installしてみます。

http://fuse-emulator.sourceforge.net

https://github.com/kahing/goofys

ライブラリの依存関係

goofys や fuse-utils には、以下のような依存ライブラリ(パッケージ)がありますので、 順にinstallします。

goofys
└ fuse-utils
   └ fuse (libspectrum)
      ├ libgcrypt
      │  └ libgpg-error
      └ audiofile
          └ alsa-lib

fuse の依存libraryのinstall

libgcrypt が、libgpg-error を見つけてくれない為、 それぞれの configure時に --prefix や --with-libgpg-error-prefix を 指定しています。

これらの configure optionを付けない場合、 libgcryptのmake check時に、このエントリの下部にあるエラーが表示されました。

$ wget https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.32.tar.bz2
$ tar -xvf libgpg-error-1.32.tar.bz2
$ cd libgpg-error-1.32
$ ./configure --prefix=/usr/local/libgpg-error  #### ココ
$ make
$ make check
$ make install
$ sudo make install
$ wget https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.bz2
$ tar -xvf libgcrypt-1.8.4.tar.bz2
$ cd libgcrypt-1.8.4
$ ./configure --with-libgpg-error-prefix=/usr/local/libgpg-error  #### ココ
$ make
$ make check
$ make install
$ sudo make install
$ ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.7.tar.bz2
$ tar -xvf alsa-lib-1.1.7.tar.bz2
$ cd alsa-lib-1.1.7
$ ./configure
$ make
$ make check
$ make install
$ sudo make install
# ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.1.7.tar.bz2
$ wget https://audiofile.68k.org/audiofile-0.3.6.tar.gz
$ tar -xvf audiofile-0.3.6.tar.gz
$ cd audiofile-0.3.6
$ ./configure
$ make
$ make check
$ make install
$ sudo make install

fuse (libspectrum)や fuse-utils の install

fusefuse-utilsのbuildの場合、 「use option -std=c99 or -std=gnu99 to compile your code」や 「No package 'libspectrum' found」とエラーになった為、 Makefileを編集したり、 LIBSPECTRUM_LIBS や LIBSPECTRUM_CFLAGS の環境変数を設定しています。

$ wget https://sourceforge.net/projects/fuse-emulator/files/libspectrum/1.4.4/libspectrum-1.4.4.tar.gz
$ tar -xvf libspectrum-1.4.4.tar.gz
$ cd libspectrum-1.4.4
$ ./configure --prefix=/usr/local/libspectrum
$ make
$ make check
 :
test/szx.c:135:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
       for( size_t i = expected_length; i < total_length; i++ ) {
       ^
test/szx.c:135:7: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [test/test_test-szx.o] Error 1
make[2]: Leaving directory `/home/end0tknr/tmp/libspectrum-1.4.4'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/end0tknr/tmp/libspectrum-1.4.4'
make: *** [check] Error 2

$ vi Makefile
  old) CFLAGS = -g -O2 -Wall -Wwrite-strings
  new) CFLAGS = -g -O2 -Wall -Wwrite-strings -std=c99

$ make
$ make check
$ sudo make install
$ wget https://sourceforge.net/projects/fuse-emulator/files/fuse-utils/1.4.3/fuse-utils-1.4.3.tar.gz
$ tar -xvf fuse-utils-1.4.3.tar.gz
$ cd fuse-utils-1.4.3
$ ./configure
  :
checking pkg-config is at least version 0.9.0... yes
checking for LIBSPECTRUM... no
configure: error: Package requirements (libspectrum >= 1.4.3) were not met:

No package 'libspectrum' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBSPECTRUM_CFLAGS
and LIBSPECTRUM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


$ export LIBSPECTRUM_LIBS=/usr/local/libspectrum/lib/libspectrum.so
$ export LIBSPECTRUM_CFLAGS=/usr/local/libspectrum

$ ./configure
$ make
$ make check
$ sudo make install

goofysのinstall

$ export GOPATH=/home/end0tknr/go
#### go get はプロンプトが返るまで、少々、時間を要します
$ go get github.com/kahing/goofys
$ go install github.com/kahing/goofys

goofysによるaws s3のmount

$ mkdir ~/tmp/mount_goofys
$ ~/go/bin/goofys --debug_fuse end0tknr-test-bucket ~/tmp/mount_goofys

参考 - libgcrypt における make check エラー

make[1]: Entering directory `/home/end0tknr/tmp/libgcrypt-1.8.4/tests'
make  check-TESTS
make[2]: Entering directory `/home/end0tknr/tmp/libgcrypt-1.8.4/tests'
./version: /lib64/libgpg-error.so.0: no version information available (required by ./version)
./version: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./version: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: version
./t-secmem: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-secmem: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-secmem
./mpitests: /lib64/libgpg-error.so.0: no version information available (required by ./mpitests)
./mpitests: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./mpitests: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: mpitests
./t-sexp: /lib64/libgpg-error.so.0: no version information available (required by ./t-sexp)
./t-sexp: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-sexp: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_lock_lock, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-sexp
./t-convert: /lib64/libgpg-error.so.0: no version information available (required by ./t-convert)
./t-convert: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-convert: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-convert
./t-mpi-bit: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-mpi-bit: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-mpi-bit
./t-mpi-point: /lib64/libgpg-error.so.0: no version information available (required by ./t-mpi-point)
./t-mpi-point: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-mpi-point: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-mpi-point
./curves: /lib64/libgpg-error.so.0: no version information available (required by ./curves)
./curves: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./curves: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: curves
./t-lock: /lib64/libgpg-error.so.0: no version information available (required by ./t-lock)
./t-lock: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-lock: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-lock
./prime: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./prime: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: prime
./basic: /lib64/libgpg-error.so.0: no version information available (required by ./basic)
./basic: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./basic: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: basic
./keygen: /lib64/libgpg-error.so.0: no version information available (required by ./keygen)
./keygen: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./keygen: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: keygen
./pubkey: /lib64/libgpg-error.so.0: no version information available (required by ./pubkey)
./pubkey: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./pubkey: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: pubkey
./hmac: /lib64/libgpg-error.so.0: no version information available (required by ./hmac)
./hmac: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./hmac: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: hmac
./hashtest: /lib64/libgpg-error.so.0: no version information available (required by ./hashtest)
./hashtest: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./hashtest: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: hashtest
./t-kdf: /lib64/libgpg-error.so.0: no version information available (required by ./t-kdf)
./t-kdf: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-kdf: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-kdf
./keygrip: /lib64/libgpg-error.so.0: no version information available (required by ./keygrip)
./keygrip: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./keygrip: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: keygrip
./fips186-dsa: /lib64/libgpg-error.so.0: no version information available (required by ./fips186-dsa)
./fips186-dsa: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./fips186-dsa: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: fips186-dsa
./aeswrap: /lib64/libgpg-error.so.0: no version information available (required by ./aeswrap)
./aeswrap: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./aeswrap: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: aeswrap
./pkcs1v2: /lib64/libgpg-error.so.0: no version information available (required by ./pkcs1v2)
./pkcs1v2: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./pkcs1v2: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: pkcs1v2
./random: /lib64/libgpg-error.so.0: no version information available (required by ./random)
./random: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./random: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: random
./dsa-rfc6979: /lib64/libgpg-error.so.0: no version information available (required by ./dsa-rfc6979)
./dsa-rfc6979: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./dsa-rfc6979: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: dsa-rfc6979
./t-ed25519: /lib64/libgpg-error.so.0: no version information available (required by ./t-ed25519)
./t-ed25519: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-ed25519: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-ed25519
./t-cv25519: /lib64/libgpg-error.so.0: no version information available (required by ./t-cv25519)
./t-cv25519: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./t-cv25519: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: t-cv25519
      now running 'basic' test with all hardware features disabled.
./basic: /lib64/libgpg-error.so.0: no version information available (required by ./basic)
./basic: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./basic: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: basic-disable-all-hwf
./benchmark: /lib64/libgpg-error.so.0: no version information available (required by ./benchmark)
./benchmark: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./benchmark: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: benchmark
./bench-slope: /lib64/libgpg-error.so.0: no version information available (required by ./bench-slope)
./bench-slope: /lib64/libgpg-error.so.0: no version information available (required by /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20)
./bench-slope: relocation error: /home/end0tknr/tmp/libgcrypt-1.8.4/src/.libs/libgcrypt.so.20: symbol gpgrt_get_syscall_clamp, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference
FAIL: bench-slope
SKIP: hashtest-256g
======================================
27 of 27 tests failed
(1 test was not run)
Please report to http://bugs.gnupg.org
======================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/home/end0tknr/tmp/libgcrypt-1.8.4/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/end0tknr/tmp/libgcrypt-1.8.4/tests'
make: *** [check-recursive] Error 1
$