xcode - 在 Mac OSX 10.6.8 上安装 f2c

标签 xcode macos gcc compiler-construction fortran

我使用了来自 http://hpc.sourceforge.net/buildf2c 的 f2c 版本和 http://hamishrickerby.com/2009/02/20/installing-f2c-on-a-mac/#disqus_thread , 但它们都不起作用。

我按照安装说明进行操作。一切顺利,直到第 4 步:


4。创建并安装f2c头文件f2c.h ...

make: `f2c.h' is up to date.
mkdir: /usr/local/include: File exists
cp: /usr/local/include is not a directory

...完成。

5。创建和安装 f2c 库 libf2c.a ...

cp signal1.h0 signal1.h
cp sysdep1.h0 sysdep1.h
/usr/bin/cc -c f77vers.c
cc1: error: /usr/local/include: not a directory
make: *** [f77vers.o] Error 1
cp: libf2c.a: No such file or directory
ranlib: can't open file: /usr/local/lib/libf2c.a (Permission denied)

...完成。

6。创建和安装 f2c 转换器 ...

/usr/bin/cc -O -o xsum xsum.c
cc1: error: /usr/local/include: not a directory
make: *** [xsum] Error 1
cp: f2c: No such file or directory
ln: /bin/f2c: Permission denied

...完成。

7.正在安装 fc 脚本 ...

cp: /usr/local/bin/fc: Permission denied
ln: /bin/fc: Permission denied
ln: /bin/f77: Permission denied

...完成。

8。安装手册页 ...

cp: /usr/share/man/man1/f2c.1: Permission denied

...完成。

9。正在清理......

rm -f *.o f2c sysdep.hd tokdefs.h f2c.t
rm -f libf2c.a *.o arith.h signal1.h sysdep1.h

...全部完成!

结果当然是: -bash: f2c: 找不到命令

我在下次尝试之前修复了磁盘权限,但这没有效果。我不明白出了什么问题。我之前安装了 Xcode 4 和 Intel fortran。后者效果很好。

我的问题似乎与另一个线程中描述的问题相似 Newbie question f2c compilation problem: cc1plus error: /include: not a directory What does this mean? 正如在提到的线程中,我得到

--with-gxx-include-dir=/include/c++/4.2.1

但我不知道如何解决这个问题。会不会是Xcode和f2c不兼容?

感谢您的帮助:-)

最佳答案

Permission denied 并不意味着安装成功...

这实际上意味着您的用户无法在特定位置安装。

安装时,使用 sudo,这样您将以管理员权限进行安装。

通常:

./configure
make
sudo make install

注意 make install 之前的 sudo

关于xcode - 在 Mac OSX 10.6.8 上安装 f2c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8352393/

相关文章:

ios - 反序列化 SIL 全局 "UIEdgeInsetsZero"时遇到 fatal error

objective-c - 如何使用 NSNumberFormatter 显示货币?

ios - 如何使用 react-native cli 构建 react-native 应用程序?

ios - 视频未在 iOS 5 中加载(使用无法识别的键调用)

iphone - 如何在 iOS 中求解条件方程

ios - Xcode:使用不同的选项运行两次测试

c - 英特尔和 GNU C 编译器在向量化方面自相矛盾

objective-c - 为什么我的 CATransaction 不遵守我设置的持续时间?

gcc - MinGW 的 ld 无法对非 PE 输出文件执行 PE 操作

c++ - 在 Mac OS X .framework 中包含 GLEW 的正确方法是什么?