【问题标题】:Unable to determine OS无法确定操作系统
【发布时间】:2013-01-02 20:51:31
【问题描述】:

当我进入终端(我安装了 smlnj)并输入 sml 时,它给了我错误 sml: unable to determine architecture/operating system。这是什么意思??? 我像这样at this website 安装了sml,但我不确定 -- 说明有误吗?

【问题讨论】:

    标签: smlnj


    【解决方案1】:

    如果您使用的是 OSX 10.8 或更高版本(uname -r 为您提供从 12 或更高版本开始的内容),如果没有一些额外的调整,SML/NJ pre 110.75 就不能很好地工作。这是一个known issue,可以通过在.arch-n-opsys 中的操作系统检测代码中添加10.8 选项(参见下面的12 行)来修复:

        :
        10*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.6
        11*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.7
        12*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.8
        13*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.9 Mavericks
        14*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.10 Yosemite
        15*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.11 El Capitan
        16*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.12 Sierra
        17*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.13 High Sierra
    
        *)   exit 1;;
    esac;;
    

    【讨论】:

    • 3.x linux 内核存在/曾经存在同样的问题:s
    • 具体需要添加到/usr/local/smlnj/bin/.arch-n-opsys。 (在这里提到它是因为链接已损坏,并且问题仍然存在于 110.79 和 10.11 El Capitan ...)
    【解决方案2】:

    最近的 OS X 二进制安装程序的问题仍然存在,只是焦点转移到了 OS X 的 10.9 Mavericks 和 10.10 Yosemite 版本。尽管在最近的源代码版本中解决了根本原因。

    这就是为什么从现在开始解决这个问题只是需要一个新编译的二进制包。为此,您最好通过homebrew 安装 smlnj。您可以使用以下命令来完成:

    brew update
    brew cask install smlnj
    

    截至 2021 年,使用 cask 安装的命令是

    brew install --cask smlnj
    

    这将为您编译包,这样您就可以省去检查源代码和自己编译的麻烦。

    只是为了清理您的系统并避免重复,您只需执行以下操作即可删除以前的安装:

    sudo rm -rf /usr/local/smlnj*
    

    对于星号:我有一个包含 110.76 的裸 smlnj 文件夹和一个 smlnj-110.75 文件夹,我想我之前曾尝试安装两个不同的版本...

    您可能需要删除您自己创建的任何指向旧 smlnj 文件夹的软链接,这些软链接直接位于上一步中删除的 /usr/local/ 下。

    【讨论】:

    • 我尝试了 brew install,但收到以下信息:/usr/local/Cellar/smlnj/110.77/SMLNJ_HOME/bin/.run/run.x86-darwin: Fatal error -- Uncaught exception SysErr with <unknown> raised at <sysconf.c> config/install.sh !!! Boot code failed, no heap image (sml.x86-darwin). 这显然是一个已知问题。 github.com/Homebrew/homebrew/issues/32915(另外,您能否提醒人们在安装之前更新他们的 brew 公式?如果您不是经常使用 brew 的用户,很容易忘记)。
    • 为特异性获得了 10 次投票。太糟糕了偶像投票规则不适用。 ;-)
    【解决方案3】:

    我不小心安装了旧版本的 SML/NJ 后遇到了这个问题。我通过删除/usr/local/smlnj 删除了我之前的安装并使用the pre-built system of OS X for SML/NJ 110.78 重新安装。最新下载可在 Downloads here 下获得,这是未来寻求者应该咨询的内容,因为我的解决方案的细节在他们出现时可能已经过时了。

    【讨论】:

      【解决方案4】:

      作为对 paxdiablo 答案的更新,如果您运行的是 macOS Sierra(版本 10.12),则需要输入以下行以使 sml 运行:

      16*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # macOS 10.12 Sierra
      

      因此,如果有更多上下文,它将如下所示:

            11*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # MacOS X 10.7 Lion
            12*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # MacOS X 10.8 Mountain Lion
            13*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # MacOS X 10.9 Mavericks
            14*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # MacOS X 10.10 Yosemite
            15*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # MacOS X 10.11 El Capitan
            16*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # macOS 10.12 Sierra
            17*) OPSYS=darwin;  HEAP_OPSYS=darwin ;; # macOS 10.13 High Sierra
            *) exit 1;;
          esac;;
      

      SML/NJ 版本 110.79 配置了 OS X 到 El Capitan,但 Sierra 仍然缺失。

      【讨论】:

      • 救了我的培根。在工作会话之间更新了操作系统。一切都崩溃了。多哈。感谢您的救助。
      【解决方案5】:

      塞拉利昂 10.12.6

      通过 Homebrew brew install smlnj 安装 SML

      编辑您的.bash_profile 并将export PATH=/usr/local/Cellar/smlnj/110.81/bin:$PATH 添加到文件末尾。

      source ~/.bash_profile 之后应用新路径,以便您的系统添加新位置,然后在您键入sml 时知道在哪里可以找到所需的文件

      【讨论】:

        【解决方案6】:

        升级我的 Macbook 后,我为此苦苦挣扎了好几个小时。以前我在 Macbook Air 上使用 OSX 10.8 Maverick,https://www.smlnj.org/dist/working/current/index.html#macos-installer 的发行版实际上运行良好。

        升级到运行 OSX 10.14 Mojave 的 Macbook Pro 后,在安装并添加到 PATH 后运行 sml 会给我 OP 的错误消息。

        在努力找到一些解决方案(包括此处标记为接受的解决方案)之后,最终工作的是brew cask install smlnj

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-07-01
          • 2016-12-11
          相关资源
          最近更新 更多