digitalmars.D.learn - how to install the new dmd on Mac M1?
- MichaelBi (2/2) Aug 25 2022 I downloaded the new dmd 2.1 on Mac, but with fail message of
- Steven Schveighoffer (5/7) Aug 25 2022 DMD is x86 only. M1 macs can run x86 via rosetta.
- MichaelBi (5/12) Aug 25 2022 it's simple as following:
- Steven Schveighoffer (17/33) Aug 25 2022 So install.sh is checking the architecture, and failing because the OS
- Ben Jones (8/12) Aug 25 2022 Is there a reason you want to use DMD specifically? If you use
- MichaelBi (3/15) Aug 25 2022 when using ldc2, has this error "ld: library not found for -lssl"
- Nicholas Wilson (3/5) Aug 25 2022 So where is your ssl library located and how (if at all) are you
- MichaelBi (3/8) Aug 25 2022 I installed openssl and also export the path of lib, but still
- MichaelBi (5/31) Aug 25 2022 you are right, the package install is OK. but after running dub
- Steven Schveighoffer (7/11) Aug 26 2022 I've not had problems since updating to the M1, but my system was
- Johan (5/7) Aug 27 2022 I've fixed this quite some time ago:
- Guillaume Piolat (19/21) Aug 29 2022 ## Step 1
I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks.
Aug 25 2022
On 8/25/22 10:19 AM, MichaelBi wrote:I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks.DMD is x86 only. M1 macs can run x86 via rosetta. I haven't had this specific problem. Can you list the actual commands you are running, and the output from the system? -Steve
Aug 25 2022
On Thursday, 25 August 2022 at 14:37:01 UTC, Steven Schveighoffer wrote:On 8/25/22 10:19 AM, MichaelBi wrote:it's simple as following: -iMac ~ % curl -fsS https://dlang.org/install.sh | bash -s dmd Unsupported Arch arm64I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks.DMD is x86 only. M1 macs can run x86 via rosetta. I haven't had this specific problem. Can you list the actual commands you are running, and the output from the system? -Steve
Aug 25 2022
On 8/25/22 10:44 AM, MichaelBi wrote:On Thursday, 25 August 2022 at 14:37:01 UTC, Steven Schveighoffer wrote:So install.sh is checking the architecture, and failing because the OS reports it as arm64. ```sh case $(uname -m) in x86_64|amd64) ARCH=x86_64; MODEL=64;; aarch64) ARCH=aarch64; MODEL=64;; i*86) ARCH=x86; MODEL=32;; *) fatal "Unsupported Arch $(uname -m)" ;; ``` You could change the line that starts with `aarch64` to `aarch64|arm64` That might work. I'm not sure, because really you want x86_64 for dmd (there is no aarch64 or arm64 build of dmd). Have you tried using the dmg package? -SteveOn 8/25/22 10:19 AM, MichaelBi wrote:it's simple as following: -iMac ~ % curl -fsS https://dlang.org/install.sh | bash -s dmd Unsupported Arch arm64I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks.DMD is x86 only. M1 macs can run x86 via rosetta. I haven't had this specific problem. Can you list the actual commands you are running, and the output from the system? -Steve
Aug 25 2022
On Thursday, 25 August 2022 at 15:19:56 UTC, Steven Schveighoffer wrote:On 8/25/22 10:44 AM, MichaelBi wrote:Is there a reason you want to use DMD specifically? If you use homebrew then `brew install ldc dub` will just works for dub projects, and to explicitly run the compiler just use `ldc2` instead of `dmd`. LDC is actually an ARM executable and outputs ARM executables. I assume it's easy to install ldc without homebrew, but I haven' tried.On Thursday, 25 August 2022 at 14:37:01 UTC, Steven Schveighoffer wrote:On 8/25/22 10:19 AM, MichaelBi wrote:
Aug 25 2022
On Thursday, 25 August 2022 at 16:06:49 UTC, Ben Jones wrote:On Thursday, 25 August 2022 at 15:19:56 UTC, Steven Schveighoffer wrote:when using ldc2, has this error "ld: library not found for -lssl" after dub build --compiler=ldc2On 8/25/22 10:44 AM, MichaelBi wrote:Is there a reason you want to use DMD specifically? If you use homebrew then `brew install ldc dub` will just works for dub projects, and to explicitly run the compiler just use `ldc2` instead of `dmd`. LDC is actually an ARM executable and outputs ARM executables. I assume it's easy to install ldc without homebrew, but I haven' tried.On Thursday, 25 August 2022 at 14:37:01 UTC, Steven Schveighoffer wrote:On 8/25/22 10:19 AM, MichaelBi wrote:
Aug 25 2022
On Friday, 26 August 2022 at 00:34:30 UTC, MichaelBi wrote:when using ldc2, has this error "ld: library not found for -lssl" after dub build --compiler=ldc2So where is your ssl library located and how (if at all) are you telling the compiler/linker where to find it?
Aug 25 2022
On Friday, 26 August 2022 at 00:55:05 UTC, Nicholas Wilson wrote:On Friday, 26 August 2022 at 00:34:30 UTC, MichaelBi wrote:I installed openssl and also export the path of lib, but still got that errors...when using ldc2, has this error "ld: library not found for -lssl" after dub build --compiler=ldc2So where is your ssl library located and how (if at all) are you telling the compiler/linker where to find it?
Aug 25 2022
On Thursday, 25 August 2022 at 15:19:56 UTC, Steven Schveighoffer wrote:On 8/25/22 10:44 AM, MichaelBi wrote:you are right, the package install is OK. but after running dub build --compiler=dmd, the error of "ld: library not found for - lssl" is still there...On Thursday, 25 August 2022 at 14:37:01 UTC, Steven Schveighoffer wrote:So install.sh is checking the architecture, and failing because the OS reports it as arm64. ```sh case $(uname -m) in x86_64|amd64) ARCH=x86_64; MODEL=64;; aarch64) ARCH=aarch64; MODEL=64;; i*86) ARCH=x86; MODEL=32;; *) fatal "Unsupported Arch $(uname -m)" ;; ``` You could change the line that starts with `aarch64` to `aarch64|arm64` That might work. I'm not sure, because really you want x86_64 for dmd (there is no aarch64 or arm64 build of dmd). Have you tried using the dmg package? -Steve[...]it's simple as following: -iMac ~ % curl -fsS https://dlang.org/install.sh | bash -s dmd Unsupported Arch arm64
Aug 25 2022
On 8/25/22 11:50 PM, MichaelBi wrote:you are right, the package install is OK. but after running dub build --compiler=dmd, the error of "ld: library not found for - lssl" is still there...I've not had problems since updating to the M1, but my system was upgraded through many years, so I don't know if it's because I just have old cruft leftover. I'd try installing the dev tools from apple, probably you'd get the ssl library then? -Steve
Aug 26 2022
On Thursday, 25 August 2022 at 14:44:22 UTC, MichaelBi wrote:-iMac ~ % curl -fsS https://dlang.org/install.sh | bash -s dmd Unsupported Arch arm64I've fixed this quite some time ago: https://github.com/dlang/installer/pull/491 Apparently it was never released? -Johan
Aug 27 2022
On Thursday, 25 August 2022 at 14:19:47 UTC, MichaelBi wrote:I downloaded the new dmd 2.1 on Mac, but with fail message of "unsupported Arch arm64". how can I do? thanks.Get LDC here: https://github.com/ldc-developers/ldc/releases - If you are running on Apple Silicon, be sure to use the Universal LDC package (for LDC version >= 1.30). - If the "Universal" build is not available, use the x86_64 LDC package instead. (for LDC version < 1.30). Those builds are cross-compilers, able to target both x86_64 and arm64, with flags -a x86_64-apple-macos and -a arm64-apple-macos respectively. Make sure you are using the dub and ldc2 executable from those builds. Please install Xcode 12.2+ to. $ sudo ln -s /my/absolute/path/to/ldc-xxx/bin/ldc2 /usr/local/bin/ldc2 $ sudo ln -s /my/absolute/path/to/ldc-xxx/bin/dub /usr/local/bin/dub - build a x86_64 program with: `dub -a x86_64-apple-macos` - build an arm64 program with: `dub -a arm64-apple-macos`
Aug 29 2022