
Ubuntu日本語フォーラム

ログインしていません。
CVS-1.11.23 (http://www.nongnu.org/cvs/)を私のUbuntu 11.04 (64-bit)にインストールしたいと思っています。ホストマシンはHP Z800ワークステーションで、OSはUbuntu 11.04とWindows 7が半々のパーティションで入っており、それらのデュアルブートシステムを構築しました。
このワークステーションを用いて、CMAQという化学物質の大気輸送モデル(Linux環境下で動くように設計されている)を運用したいと思っているのですが、そのモデルのマニュアルに、モデルの一連のプログラムをインストールする前に、上記のCVSをインストールする必要があると書かれています。
上記のwebサイトからCVS-1.11.23の圧縮アーカイブをダウンロードし、Ubuntu 11.04のホーム・ディレクトリ上で展開しました。そして、環境変数CCをgccに設定(export CC=gcc)し、configureスクリプトを実行した後続けてmakeを実行したのですが、下記のエラーログが表示され、コンパイルがうまくできませんでした。どのように解決すれば良いか、どなたか教えて頂けませんでしょうか?
configureスクリプトとmakeを実行した時のログを、以下に示します。
jesc@jesc-HP-Z800-Workstation:~/cvs-1.11.23$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for prefix by checking for cvs... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking for library containing strerror... none required
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking whether ln -s works... yes
checking for perl... /usr/bin/perl
checking for csh... no
checking for mktemp... /bin/mktemp
checking for sendmail... no
checking for pr... /usr/bin/pr
checking for groff... /usr/bin/groff
checking for ps2pdf... /usr/bin/ps2pdf
checking for texi2dvi... /home/jesc/cvs-1.11.23/missing texi2dvi
checking whether #! works in shell scripts... yes
checking for BSD VPATH bug in make... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking direct.h usability... no
checking direct.h presence... no
checking for direct.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking fnmatch.h usability... yes
checking fnmatch.h presence... yes
checking for fnmatch.h... yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for memory.h... (cached) yes
checking ndbm.h usability... no
checking ndbm.h presence... no
checking for ndbm.h... no
checking process.h usability... no
checking process.h presence... no
checking for process.h... no
checking for string.h... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking sys/bsdtypes.h usability... no
checking sys/bsdtypes.h presence... no
checking for sys/bsdtypes.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking sys/utime.h usability... no
checking sys/utime.h presence... no
checking for sys/utime.h... no
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking whether stat file-mode macros are broken... no
checking whether time.h and sys/time.h may both be included... yes
checking for an ANSI C-conforming const... yes
checking for uid_t in sys/types.h... yes
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for struct stat.st_blksize... yes
checking for struct stat.st_rdev... yes
checking for dup2... yes
checking for ftruncate... yes
checking for gethostname... yes
checking for memmove... yes
checking for mkdir... yes
checking for rename... yes
checking for strerror... yes
checking for strstr... yes
checking for strtoul... yes
checking for valloc... yes
checking for waitpid... yes
checking for stdint.h... (cached) yes
checking for SIZE_MAX... yes
checking for inline... inline
checking for stdint.h... (cached) yes
checking for fchdir... yes
checking for fchmod... yes
checking for fsync... yes
checking for ftime... yes
checking for geteuid... yes
checking for getgroups... yes
checking for getopt... yes
checking for getpagesize... yes
checking for getpid... yes
checking for gettimeofday... yes
checking for initgroups... yes
checking for login... no
checking for logout... no
checking for mknod... yes
checking for mkstemp... yes
checking for mktemp... yes
checking for putenv... yes
checking for readlink... yes
checking for regcomp... yes
checking for regerror... yes
checking for regexec... yes
checking for regfree... yes
checking for sigaction... yes
checking for sigblock... yes
checking for sigprocmask... yes
checking for sigsetmask... yes
checking for sigvec... yes
checking for tempnam... yes
checking for timezone... yes
checking for tzset... yes
checking for vprintf... yes
checking for wait3... yes
checking for nanosleep... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether closedir returns void... no
checking for library containing getspnam... none required
checking for utime.h... (cached) yes
checking whether utime accepts a null argument... yes
checking for long file names... yes
checking for working POSIX fnmatch... yes
checking for main in -lnsl... yes
checking for library containing connect... none required
checking for library containing gethostbyname... none required
checking for KRB4 in /usr/kerberos...
checking for krb.h...
checking for krb_get_err_text... no
checking for GSSAPI...
checking gssapi.h usability... no
checking gssapi.h presence... no
checking for gssapi.h... no
checking gssapi/gssapi.h usability... no
checking gssapi/gssapi.h presence... no
checking for gssapi/gssapi.h... no
checking krb5.h usability... no
checking krb5.h presence... no
checking for krb5.h... no
checking for GSSAPI in /usr/kerberos...
checking gssapi.h usability... no
checking gssapi.h presence... no
checking for gssapi.h... no
checking gssapi/gssapi.h usability... no
checking gssapi/gssapi.h presence... no
checking for gssapi/gssapi.h... no
checking krb5.h usability... no
checking krb5.h presence... no
checking for krb5.h... no
checking for GSSAPI in /usr/cygnus/kerbnet...
checking gssapi.h usability... no
checking gssapi.h presence... no
checking for gssapi.h... no
checking gssapi/gssapi.h usability... no
checking gssapi/gssapi.h presence... no
checking for gssapi/gssapi.h... no
checking krb5.h usability... no
checking krb5.h presence... no
checking for krb5.h... no
checking for GSSAPI... no
checking for vim... no
checking for vi... vi
checking for ssh... ssh
checking for remsh... no
checking for rsh... rsh
checking for temporary directory... /tmp
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... yes
checking for library containing crypt... -lcrypt
checking for a case sensitive file system... yes
checking for cygwin32... no
configure: creating ./config.status
config.status: creating contrib/check_cvs
config.status: creating contrib/clmerge
config.status: creating contrib/cln_hist
config.status: creating contrib/commit_prep
config.status: creating contrib/cvs_acls
config.status: creating contrib/log
config.status: creating contrib/log_accum
config.status: creating contrib/mfpipe
config.status: creating contrib/pvcs2rcs
config.status: creating contrib/rcs2log
config.status: creating contrib/rcslock
config.status: creating contrib/sccs2rcs
config.status: creating doc/mkman
config.status: creating src/cvsbug
config.status: creating windows-NT/fix-msvc-mak
config.status: creating Makefile
config.status: creating contrib/Makefile
config.status: creating cvs.spec
config.status: creating diff/Makefile
config.status: creating doc/Makefile
config.status: creating emx/Makefile
config.status: creating lib/Makefile
config.status: creating man/Makefile
config.status: creating os2/Makefile
config.status: creating src/Makefile
config.status: creating tools/Makefile
config.status: creating vms/Makefile
config.status: creating windows-NT/Makefile
config.status: creating windows-NT/SCC/Makefile
config.status: creating zlib/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
jesc@jesc-HP-Z800-Workstation:~/cvs-1.11.23$ make
make all-recursive
make[1]: Entering directory `/home/jesc/cvs-1.11.23'
Making all in lib
make[2]: Entering directory `/home/jesc/cvs-1.11.23/lib'
gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O2 -MT getline.o -MD -MP -MF .deps/getline.Tpo -c -o getline.o getline.c
In file included from getline.c:25:0:
getline.h:15:3: error: conflicting types for ‘getline'
/usr/include/stdio.h:671:20: note: previous declaration of ‘getline' was here
getline.c:158:1: error: conflicting types for ‘getline'
/usr/include/stdio.h:671:20: note: previous declaration of ‘getline' was here
make[2]: *** [getline.o] Error 1
make[2]: Leaving directory `/home/jesc/cvs-1.11.23/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jesc/cvs-1.11.23'
make: *** [all] Error 2
jesc@jesc-HP-Z800-Workstation:~/cvs-1.11.23$
オフライン
In file included from getline.c:25:0:
getline.h:15:3: error: conflicting types for ‘getline'
/usr/include/stdio.h:671:20: note: previous declaration of ‘getline' was here
ヒントになりそうなことが以下に書かれています。
http://djlab.sakura.ne.jp/mydiary/?p=993
cvsのコード中にあるgetline関数がlinux(POSIX標準)のgetline関数(/usr/include/stdio.h内)と衝突しているようです。
http://archive.linux.or.jp/JM/html/LDP_man-pages/man3/getline.3.html
ただし、リンク先にあるようなPOSIX標準となっている関数をコメントアウトしてしまうことは、今後別のソフトウェアをコンパイルするときの支障となるのでやめたほうがいいです。
CVSはUbuntuのリポジトリに含まれているので、そちらをインストールしてはどうでしょうか?
CVSのバージョンが指定されていたり、何かフラグを付けてコンパイルする場合以外は、パッケージ管理システムからインストールすることを勧めます。
オフライン
vbkさん、アドバイス頂き、大変ありがとうございます。
Ubuntu Packages SearchのサイトからCVSのパッケージをダウンロードし、Ubuntuソフトウェアセンターでインストールしたら、難なくインストールを完了することができました。
使用する大気輸送モデルのマニュアルに、CVSのウェブサイトから圧縮アーカイブをダウンロードし、それを展開してからインストールする方法が書かれていて、それしかやり方がないものと思っていました。Linix初心者のため、一つ一つ学んでいきたいと思います。
どうもありがとうございました!
オフライン
「Ubuntuソフトウェアセンター」や「Synapticパッケージマネージャ」に適切なパッケージをダウンロードする機能が含まれているので、基本的にはこれらのみを使って(debファイルを手動でダウンロードせずに)インストールすべきです。
https://wiki.ubuntulinux.jp/UbuntuTips/Application/PackageManagementSystem
手動でパッケージをダウンロードすることは、色々な意味で危険です。
オフライン