登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
(1)在提问题之前我把本论坛156页的所有帖子快速浏览了一遍,没有找到跟我问题相关的内容,接着各种百度,各种论坛,包括centos官方论坛,g95官方网站找了,可是没有找到,最后想得到大神的指点,小弟我不胜感激。我在Linux环境的centos7.3安装G95的时候按照网上的方法如下步骤安装,安装到下列步骤时运行make命令出现了如下问题:
[root@localhost g95-0.93]# ls
aclocal.m4 BUGS configure dump.c g95-config.h.in INSTALL lang.opt match.c primary.c specs.h trans-const.c
arith.c ChangeLog configure.in entry.c g95.h install-sh lang-options.c matchexp.c README stamp-h1 trans-decl.c
array.c check.c CONTRIB error.c G95Manual.pdf interface.c libf95.a-0.93.tar.gz misc.c resolve.c st.c trans-expr.c
AUTHORS compile convert.c expr.c g95spec.c intrinsic.c macros.h missing scalarize.c symbol.c trans.h
autogen.sh config.guess COPYING f95-lang.c g95-support.h intrinsic.h Makefile mkinstalldirs scanner.c TODO trans-intrinsic.c
bbt.c config.log data.c forall.c ggc-page40.c io.c Makefile.am module.c select.c trans-array.c trans-io.c
bigint.c config.status decl.c format.c ggc-page41.c iresolve.c Makefile.in NEWS show.c trans.c trans-stmt.c
bigreal.c config.sub depcomp g95-config.h imodule.c kinds.c MANIFEST parse.c simplify.c trans-common.c trans-types. [root@localhost g95-0.93]# make
make all-am
make[1]: 进入目录“/opt/g95-0.93”
gcc -DHAVE_CONFIG_H -I. -DTARGET_NAME=\"x86_64-unknown-linux-gnu\" -DSTANDARD_EXEC_PREFIX=\"\" -DTARGET_SYSTEM_ROOT=\"\" -DDEFAULT_TARGET_VERSION=\"\" -DDEFAULT_TARGET_MACHINE=\"\" -DTOOLDIR_BASE_PREFIX=\"\" -DSTANDARD_STARTFILE_PREFIX=\"\" -DSTANDARD_STARTFILE_PREFIX_2=\"/usr/lib64\" -DSTANDARD_EXEC_PREFIX=\"\" -DSTANDARD_BINDIR_PREFIX=\"/bin\" -DSTANDARD_LIBEXEC_PREFIX=\"\" -DG95_SPEC=\"\" -g -O2 -Wall -Wmissing-prototypes -MT g95-g95spec.o -MD -MP -MF .deps/g95-g95spec.Tpo -c -o g95-g95spec.o `test -f 'g95spec.c' || echo './'`g95spec.c
g95spec.c:47:20: 致命错误:config.h:没有那个文件或目录
#include "config.h"
(2)我查找了官方安装G95原有的文章,我也没有找出问题来,真的很需要大神提示哪里没有做好导致这样的结果,再次表示感谢了。附上详细的原有官网的安装说明和我选择的网上安装说明步骤: 一、官方的安装说明
General
Platform Notes
- OSX
- MinGW
- Cygwin
- Support for the -mno-cygwin option
- Build a dll version of g95
G95 uses the 4.x release version of GCC. The 4.0.1, 4.0.2 and 4.0.3 stable versions are known to work, other versions might not.
This version is known to work, but other versions might not. - Download gcc from ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.0.3/gcc-core-4.0.3.tar.gz
- This version of GCC stores object files in a directory distinct from the source directories. G95 expects to find gcc object files and libraries in a directory named 'g95' under the main 'gcc-4.0.3' directory. Run the commands:cd gcc-4.0.3mkdir g95cd g95
- The gcc 'configure' script must be run in the directory that you expect to receive the object files. Configure gcc with../configure --enable-languages=c
- Run 'make' to build gcc. A full build isn't necessary. If you end up with libbackend.a, and libgcc.a, you've got enough to build g95. If libgcc.a isn't present, try 'make libgcc.a'.
- Download the g95 source and unpack it in some convenient directory.
- Change to the main g95 directory and configure with./configure --prefix=<installation directory> \
--with-gcc-dir=<path of your GCC directory>
- Build g95 with 'make' or 'make install' to install in the installation directory.
- Unpack the libf95.a-0.91.tgz, configure and build it to get libf95.a. Make sure --prefix is the same as with g95.
- Do 'make install' to build and install the library.
- The exact name of the executable depends on the platform. Create a convenient symbolic link to this.
- You should now be able to compile fortran 95 programs with g95.
Configure the compiler and library with --enable-F=yes to compile g95 with the F restrictions.
二、选择网上的详细安装说明如下: 二、网上我选择的详细安装说明: 根据官方说法,g95源代码编译需要gcc,可以用gcc4.0.1, gcc4.0.2, gcc4.0.3,其他的可能不行。
下载gcc ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.0.3/gcc-core-4.0.3.tar.gz 下载g95 source http://ftp.g95.org/g95_source.tgz
将gcc-core-4.0.3.tar.gz 和 g95_source.tgz拷贝到/opt目录 $cd /opt $tar xzvf gcc-core-4.0.3.tar.gz $tar xzvf g95_source.tgz $cd gcc-4.0.3 $mkdir g95 $cd g95 $../configure --enable-languages=c $make 等待 ….
开启另一个shell窗口 $cd /opt/gcc-4.0.3/g95/gcc 观察是否产生下面2个文件。 $ls libbackend.a $ls libgcc.a
如果产生后,中断gcc的编译,因为g95的编译只需要这两个库文件即可。
切换到编译gcc的shell窗口
$cd ../../g95-0.93 $./configure –prefix=/opt/g95 –with-gcc-dir=/opt/gcc4.0.3 $make $make install $tar xzvf libf95.a-0.93.tar.gz $cd libf95.a-0.93 $./configure –prefix=/opt/g95 $make $make install $ln –s /opt/g95/bin/*g95* /bin/g95
|