在 Mac OSX 10.6.8 上安装 f2c

发布于 2024-12-19 07:07:15 字数 2104 浏览 1 评论 0原文

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

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


  1. 创建并安装 f2c 头文件 f2c.h……

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

完成。

  1. 创建并安装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)

完成。

  1. 创建并安装 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

完成。

  1. 安装fc脚本……

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

完成。

  1. 安装手册页……

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

完成。

  1. 清理……

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:


  1. 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.

  1. 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.

  1. 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.

  1. Installing fc script ...

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

... done.

  1. Installing man pages ...

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

... done.

  1. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡忘如思 2024-12-26 07:07:15

权限被拒绝并不意味着安装成功...

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

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

通常:

./configure
make
sudo make install

注意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:

./configure
make
sudo make install

Note the sudo before make install

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文