Macos 在High Sierra上安装/编译gfortran时出现问题
在安装了High Sierra的新Mac mini上使用gfortran进行编译时遇到了很多问题 我用自制软件安装了gcc,没有错误消息。如果我试图编译一个基本的hello world代码或一段代码,该代码已在我的其他计算机上成功编译并使用gfortran运行,则每次我都会收到此错误(编译Macos 在High Sierra上安装/编译gfortran时出现问题,macos,gcc,gfortran,binutils,macos-high-sierra,Macos,Gcc,Gfortran,Binutils,Macos High Sierra,在安装了High Sierra的新Mac mini上使用gfortran进行编译时遇到了很多问题 我用自制软件安装了gcc,没有错误消息。如果我试图编译一个基本的hello world代码或一段代码,该代码已在我的其他计算机上成功编译并使用gfortran运行,则每次我都会收到此错误(编译gfortran helloworld.f90-o hw产生的完整错误) 我不理解这个错误,但是由于我可以在Sierra上编译和运行相同的代码,我不得不假设这在gfortran/gcc和High Sierra之
gfortran helloworld.f90-o hw
产生的完整错误)
我不理解这个错误,但是由于我可以在Sierra上编译和运行相同的代码,我不得不假设这在gfortran/gcc和High Sierra之间不起作用
我真的很想知道是否有其他人也有同样的问题,或者认为这是由其他原因引起的,并且知道如何解决它
编辑:
编译一个基本的hello world C代码,效果很好。没有错误
对于gcc-v
:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin17.0.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin17.0.0
Configured with: ../configure --build=x86_64-apple-darwin17.0.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)
Apple Inc version cctools-895, GNU assembler version 1.38
对于gfortran-v
:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin17.0.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin17.0.0
Configured with: ../configure --build=x86_64-apple-darwin17.0.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)
Apple Inc version cctools-895, GNU assembler version 1.38
对于as-v
:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/7.2.0/libexec/gcc/x86_64-apple-darwin17.0.0/7.2.0/lto-wrapper
Target: x86_64-apple-darwin17.0.0
Configured with: ../configure --build=x86_64-apple-darwin17.0.0 --prefix=/usr/local/Cellar/gcc/7.2.0 --libdir=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 7.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 7.2.0 (Homebrew GCC 7.2.0)
Apple Inc version cctools-895, GNU assembler version 1.38
但这会被挂起,必须用ctrl+c取消
我正在运行OS X 10.13.1,并使用自制软件安装了gcc v7.2(使用自制网页上的标准说明安装)。Xcode是v9.1并且是最新的。我在tcsh窗口中工作,但在bash中进行测试时也会出现相同的错误。根据前面提到的另一个网页上的内容,我成功地使gfortran的早期版本正常工作 我通过macports导入了
GCC6.4
,macports的gfortran显然目前在High Sierra上运行
它没有解决gcc v7.2和High Sierra的问题,但它提供了一个临时解决方案。错误由GNU Binutils的一部分
报告,而不是由gfortran报告。请尝试编译一些非常besic的C代码,并告诉我们您的确切细节。用于编译的命令A和完整输出,以及错误、as-v
、gcc-v
和gfortran-v
输出和您能想到的任何其他详细信息。请准确地告诉我们您安装的软件的确切版本。(对评论中的所有编码问题表示抱歉…我是论坛的新手!)啊,谢谢。我会的。