アプリ版:「スタンプのみでお礼する」機能のリリースについて

GPLで、makefile,configure,configure.inなどのある
linux用のC++ソースファイル(一部perlあり)を
minGWでコンパイルしようとすると
perlの方でエラーが出ます。
lang,LC_ALLなどがおかしいと出てきますが
どうしたらいいのでしょうか。
Visual C++ Express Editionでは、
nmakeを使おうとすると区切り記号が
ないというエラーがでます。
強引にGUI(IDE)上でコンパイルしよう
とすると、includeファイルがないと
いうエラーが出ます。

A 回答 (4件)

VC++, gccどちらでやるのが手間かからないか、確実性が高いかというと gccの方が向いている。



VC++ + gmakeという組み合わせでもできるのでVC++使う場合でもnmakeを使う必要はない。
※ CC=CLでVC++のコンパイラを指定すれば十分。
※ makeを勉強して知識増やしたいなら良い事だとは思いますが。(Makefileをnmake用に書き換えるのも)

localeについては、警告でてるけど下記のメッセージがでてるので標準環境に変えてくれてるのでそれ自体には問題ない。

perl: warning: Falling back to the standard locale ("C").


オフィシャルページに書かれている下記から(その下の内容も含めてだけど)

# Implementation
# * C++ with a few C and FORTRAN 77 functions
# * Object-oriented designed throughout

Cygwinでgmake c/c++ fortran(g77) flex bison 等を選択して導入した環境で構築するのが良いかと思う。

※ CygwinかSFU ( Cygwin環境で動作したという報告はもらってると書かれてます[下記ページ])
※ flex bison gmake等は必要(Makefile作り変えるからgmakeの代わりにnmakeなどツールの変更を修正して行なう事は可能)。

http://www.mpqc.org/talks/compile/img2.html


http://www.mpqc.org/talks/compile/index.html

この回答への補足

./configure
でかなり進みましたが
blasがないという警告が出ます。
atlasやlapackのダウンロードは
可能なのですが、
ビルドして実行するとcygwin1.dllがない
というエラーが出てcygwin1.dllを
入れても別のエラーが出ます。lapackはビルドすらできません。
(プロシージャが見つからないといったものです)
また、ビルドが成功したら、libフォルダに
入れればいいのでしょうか。
unixに関する知識が少ないため基本的なことが
分からなくて申し訳ありません。

WARNING: Could not link to the BLAS library. It can be obtained at
http://www.netlib.org/blas. Use --with-libdirs and/or --with-libs
to specify the name of the library.
configure: error: BLAS is required to complete the build

補足日時:2010/12/09 00:06
    • good
    • 0
この回答へのお礼

BLASはインストールできましたが、次のようなエラーが出ます。
messshm.cc: In member function ‘void sc::ShmMessageGrp::initialize(int)’:
messshm.cc:173: error: ‘SHM_R’ was not declared in this scope
messshm.cc:173: error: ‘SHM_W’ was not declared in this scope
make[4]: *** [messshm.o] Error 1
make[4]: Leaving directory `/cygdrive/d/mpqc-2.3.1/src/lib/util/group'
make[3]: *** [default] Error 1
make[3]: Leaving directory `/cygdrive/d/mpqc-2.3.1/src/lib/util'
make[2]: *** [default] Error 1
make[2]: Leaving directory `/cygdrive/d/mpqc-2.3.1/src/lib'
make[1]: *** [default] Error 1
make[1]: Leaving directory `/cygdrive/d/mpqc-2.3.1/src'
make: *** [default] Error 1

あと、ATLASもGPLなのですか。

f77を持っていないので強引にgfortranを使いました。

お礼日時:2010/12/09 19:25

・make configure が必要かどうか、若干疑問。


大抵は ./configure で十分

・「perl: warning: Setting locale failed.」で検索かければ、理由も対策もわかる。
MinGW上のPerlを実行しているのだから、Linux/bashでのやり方がそのまま使えるはず

・後半の警告は autoconfを使用しての configure.inからconfigureを作成する際に出ている警告。
autoconfのバージョンとconfigure.inの対応が合ってないか、configure.inの記述に問題があるのかは調べてないのでわからない。
警告を読むと、キャッシュに関するものなので、無視してもよさそう。

・ ./configure で設定したり調査した結果に合わせてMakefileが作成される。
この時に、必要なオプションやファイルを指定してコンパイルを行うようにMakefileが作られる。
(コンパイラのコマンド名、依存するincludeファイルの場所を指定する-Iや、リンク時のライブラリを指定する-l 等)

Makefileの文法を勉強してGNU Make→nmakeに単純に変換したところで、上のような設定がそのままでは意味がない。
nmake用、あるいはVisual Studioのプロジェクトを作成する configure相当のプログラムが無いと。
    • good
    • 0
この回答へのお礼

ありがとうございます。

お礼日時:2010/12/08 15:17

> mpqcというGPLの量子化学計算ソフトです。


> エラーメッセージは、minGWでは、
> 以下のものです、長いので、お礼の方と
> 分けて書きます。

警告とエラーは違いますよ。
環境変数はWindowsでも設定できますので設定すれば良いかと。

ただし、minGWでコンパイルしても動かない可能性が大きいです。

http://www.mpqc.org/

上記ページに下記の通り書かれています。

Platforms
* Unix Workstations (Intel/Linux, RS/6000, SGI/IRIX)
* Symmetric multi-processors (Intel/Linux, SGI/IRIX)
* Massively parallel (IBM SP, Intel Paragon)

Windows上で動かすなら、CygwinかSFU上(Windows上のUNIXサービスが使える環境)で行わないとUNIX系のシステムを使おうとして動かない可能性が非常に高いかと思います。


> Visual C++ Express Editionでは、

GNU makeの書式はかなり独特(独自の拡張多し)なので、他のmakeで動くようにするにはMakefileの修正は必須です。
また、MS VCは基本的にC89なのでgcc使って(C99)るソースだと書き換えが必要となる部分もありそうです。
    • good
    • 0
この回答へのお礼

ありがとうございました。
Cygwinでやってみますが
その前にMakefileの
書き方を勉強します。

GNU MAKEは書籍になってしまう
ほど内容が多いので。

お礼日時:2010/12/08 08:07

せめて


・その「Linux 用の C++ ソースファイル」とは何なのか
・エラーメッセージは正確にどうなっているのか
くらい書いてほしい.

この回答への補足

mpqcというGPLの量子化学計算ソフトです。
エラーメッセージは、minGWでは、
以下のものです、長いので、お礼の方と
分けて書きます。
$ make configure
aclocal -I lib/autoconf
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "ja"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "ja"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspcious cache-id, must contain _cv_ to be cached
/usr/src/packages/autoconf/26/autoconf2.5-2.67-1/src/autoconf-2.67/lib/autoconfgeneral.m4:2019: AC_CACHE_VAL is expanded from...
/usr/src/packages/autoconf/26/autoconf2.5-2.67-1/src/autoconf-2.67/lib/autoconfgeneral.m4:2040: AC_CACHE_CHECK is expanded from...
lib/autoconf/libtool.m4:658: AC_LIBTOOL_COMPILER_OPTION is expanded from...
lib/autoconf/libtool.m4:4895: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
lib/autoconf/libtool.m4:2731: _LT_AC_LANG_C_CONFIG is expanded from...
lib/autoconf/libtool.m4:2730: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
lib/autoconf/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from...
lib/autoconf/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from...
lib/autoconf/libtool.m4:25: AC_PROG_LIBTOOL is expanded from...
続きます。

補足日時:2010/12/07 06:55
    • good
    • 0
この回答へのお礼

続きです。
configure.in:1751: the top level
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): sspicious cache-id, must contain _cv_ to be cached
lib/autoconf/libtool.m4:703: AC_LIBTOOL_LINKER_OPTION is expanded from...
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): uspicious cache-id, must contain _cv_ to be cached
lib/autoconf/libtool.m4:2812: _LT_AC_LANG_CXX_CONFIG is expanded from...
lib/autoconf/libtool.m4:2811: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
lib/autoconf/libtool.m4:1867: _LT_AC_TAGCONFIG is expanded from...
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_static_works_CXX, ...: suspicious cache-id, must contain _cv_ to be cached
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_F77, ...): uspicious cache-id, must contain _cv_ to be cached
lib/autoconf/libtool.m4:3979: _LT_AC_LANG_F77_CONFIG is expanded from...
lib/autoconf/libtool.m4:3978: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_static_works_F77, ...: suspicious cache-id, must contain _cv_ to be cached
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_GCJ, ...): uspicious cache-id, must contain _cv_ to be cached
lib/autoconf/libtool.m4:4081: _LT_AC_LANG_GCJ_CONFIG is expanded from...
lib/autoconf/libtool.m4:4080: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_static_works_GCJ, ...: suspicious cache-id, must contain _cv_ to be cached
autoconf
configure.in:1751: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspcious cache-id, must contain _cv_ to be cached
/usr/src/packages/autoconf/26/autoconf2.5-2.67-1/src/autoconf-2.67/lib/autoconfgeneral.m4:2019: AC_CACHE_VAL is expanded from...
/usr/src/packages/autoconf/26/autoconf2.5-2.67-1/src/autoconf-2.67/lib/autoconfgeneral.m4:2040: AC_CACHE_CHECK is expanded from...
lib/autoconf/libtool.m4:658: AC_LIBTOOL_COMPILER_OPTION i

お礼日時:2010/12/07 06:56

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!