Unable to determine OS

五迷三道 提交于 2019-12-22 01:35:13

问题


When I go on terminal (i installed smlnj) and i type sml it gives me the error sml: unable to determine architecture/operating system. What does this mean??? I installed sml like this at this website, but I'm not sure -- are the instructions wrong?


回答1:


If you're using OSX 10.8 or later (uname -r gives you something starting with 12 or higher), SML/NJ pre 110.75 doesn't work too well without some extra tweaking. It's a known issue that can be fixed by adding the 10.8 choice (see the 12 line below) to the OS detection code in .arch-n-opsys:

    :
    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;;



回答2:


The problem with recent OS X binary installers still persist just the focus moved to 10.9 Mavericks and 10.10 Yosemite versions of OS X. Although the root cause is solved in the recent source code version.

That is why from some time now solving this issue is just about having a freshly compiled binary package. And for that you might be better of installing smlnj through homebrew. You can do it with these commands:

brew update
brew install smlnj

This will compile the package for you so you can spare the trouble of checking out the source code and doing the compilation yourself.

Just to clean up your system and avoid duplication you can remove the previous installation simply by doing the following:

sudo rm -rf /usr/local/smlnj*

For the asterisk: I had one bare smlnj folder with the 110.76 inside it and one smlnj-110.75 folder I guess I had tried to install two different versions earlier...

You might need to remove any softlinks that you created yourself that point to the older smlnj folder directly under /usr/local/ removed in the previous step.




回答3:


As an update to paxdiablo's answer, if you're running macOS Sierra (version 10.12) you need to input the following line to get sml running:

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

So with more context it will look like this:

      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 version 110.79 had the OS X up to El Capitan configured, but Sierra was still missing.




回答4:


Sierra 10.12.6

Install SML through Homebrew brew install smlnj

Edit your .bash_profile and add export PATH=/usr/local/Cellar/smlnj/110.81/bin:$PATH to the end of the file.

After that source ~/.bash_profile to apply the new path so your system adds the new locations and then knows where to find the file it needs when you type sml




回答5:


I ran into this issue after I accidentally installed an older version of SML/NJ. I removed my previous install by trashing /usr/local/smlnj and reinstalled using the pre-built system of OS X for SML/NJ 110.78. The most recent download is available under Downloads here, which is what future seekers should consult, as the particulars of my solution will likely be out of date by the time they come around.




回答6:


I was struggling with this for hours after upgrading my Macbook. Previously I was on OSX 10.8 Maverick on Macbook Air for which the distribution https://www.smlnj.org/dist/working/current/index.html#macos-installer actually worked fine.

After upgrading to a Macbook Pro running OSX 10.14 Mojave, running sml after installing and adding to PATH would give me OP's error message.

After struggling to find some solution including the one marked as accepted here, what ended up working was brew cask install smlnj.



来源:https://stackoverflow.com/questions/14410879/unable-to-determine-os

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!