在 Mac OSX 10.6.8 上安装 f2c
我使用了 http://hpc.sourceforge.net/buildf2c 和 http://hamishrickerby.com/2009/02/20/installing-f2c-on-a-mac/#disqus_thread,但它们都不起作用。
我按照安装说明进行操作。一切顺利,直到第 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
完成。
- 创建并安装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)
完成。
- 创建并安装 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
完成。
- 安装fc脚本……
cp: /usr/local/bin/fc: Permission denied
ln: /bin/fc: Permission denied
ln: /bin/f77: Permission denied
完成。
- 安装手册页……
cp: /usr/share/man/man1/f2c.1: Permission denied
完成。
- 清理……
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。后者效果很好。
我的问题似乎与另一个线程中描述的问题类似 新手问题f2c编译问题:cc1plus错误:/ include:不是目录这是什么意思? 正如在提到的线程中一样,我明白了
--with-gxx-include-dir=/include/c++/4.2.1
,但我不知道如何解决这个问题。难道是Xcode和f2c不兼容?
I used f2c builds from http://hpc.sourceforge.net/buildf2c and http://hamishrickerby.com/2009/02/20/installing-f2c-on-a-mac/#disqus_thread, but none of them worked.
I followed the installation instructions. All goes well until step 4:
- Creating and installing f2c header file f2c.h ...
make: `f2c.h' is up to date.
mkdir: /usr/local/include: File exists
cp: /usr/local/include is not a directory
... done.
- Creating and installing f2c library 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)
... done.
- Creating and installing f2c translator ...
/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
... done.
- Installing fc script ...
cp: /usr/local/bin/fc: Permission denied
ln: /bin/fc: Permission denied
ln: /bin/f77: Permission denied
... done.
- Installing man pages ...
cp: /usr/share/man/man1/f2c.1: Permission denied
... done.
- Cleaning up ...
rm -f *.o f2c sysdep.hd tokdefs.h f2c.t
rm -f libf2c.a *.o arith.h signal1.h sysdep1.h
... All done!
The results is of course:
-bash: f2c: command not found
I repaired disk permissions before trying another time, but this had no effect. I don't understand what went wrong. I previously installed Xcode 4 and Intel fortran. The latter works well.
My problem seems similar to one that was described in another thread
Newbie question f2c compilation problem: cc1plus error: /include: not a directory What does this mean?
As in the mentioned thread, I get
--with-gxx-include-dir=/include/c++/4.2.1
but I don't know how to fix this. Could it be an incompatibility between Xcode and f2c?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
权限被拒绝
并不意味着安装成功...它实际上意味着您的用户无法在特定位置安装。
安装时,使用
sudo
,这样您就可以使用管理员权限进行安装。通常:
注意
make install
之前的sudo
Permission denied
doesn't mean the installation was successful...It actually means your user can't install in the specific location.
When installing, use
sudo
, so you'll install with admin privileges.Usually:
Note the
sudo
beforemake install