Hello everyone,
Many of the issues discussed here seem to be directly related to macOS Sonoma and Xcode 15 and are not specific to Ring.
Below are instructions for installing Ring on macOS, both from a ready-made package and by compiling the source code, both of which have worked for me and I have done on macOS Sonoma and Xcode 15 .
## Installation from a ready-made package
1. **Download**: Go to the official Ring website ([
https://ring-lang.github.io](
https://ring-lang.github.io)), visit the download section ([
https://ring-lang.github.io/download.html](https://ring-lang.github.io/download.html)) and download the macOS package.
2 **Installation**: Open the downloaded package and follow the installation instructions.
3 **Configure path**: To be able to use Ring system-wide, add the installation path in your shell configuration file (e.g. `.zprofile` for Zsh) with:
```
export PATH=$PATH:/path/to/ring/bin
```
Replace `/Path/to/ring/bin` with the installation path of Ring.
## Installation by compiling the source code
**Prerequisites**: Make sure that Git and Homebrew are installed on your system. If not, install Git ([
https://git-scm.com](
https://git-scm.com)) and Homebrew ([
https://brew.sh](
https://brew.sh)).
1. **Clone source code**: Clone the ring repository via the terminal with:
```
git clone
https://github.com/ring-lang/ring.git ```
2 **Install dependencies**: Change to the `~/ring/language/src` directory and run `installdepmac.sh` to install required libraries.
3. compile **Ring Compiler/VM**: In the same directory, compile the ring compiler and VM with `buildclang.sh`.
4 **Compile additional components**: Follow similar steps to compile additional tools and extensions such as Ring2EXE and RingNotepad.
5 **Make Ring globally available**: Make Ring available system-wide by running `install.sh` in the `~/ring/bin` directory.
6 **Start Ring Notepad**: To start Ring Notepad, navigate to the `~/ring/tools/ringnotepad` directory and start it with Ring or via the Ring Package Manager.
These steps will successfully install and configure Ring on your MacOS system, either by downloading the finished package or by compiling the source code.
**Important**: Perform each step individually and check the console output carefully. Mistakes, such as working in the wrong directory, can lead to tools or libraries being created incorrectly. Therefore, check each step carefully. Initially, I simply copied the commands into the terminal and executed them. Later, when troubleshooting, I realized that I was not in the correct directories when executing them, so some necessary steps were not executed correctly.
Under macOS Sonoma and Xcode 15, I was able to build Ring from source code without any problems. However, my experience with different compilers might be unique, as I had already solved many environment issues that might also be relevant for Ring.
The introduction of macOS Sonoma and Xcode 15 brought challenges, especially with the new linker in Xcode 15. Without the ability to revert to Xcode 14.3.1, a recommended workaround is to increase the minimum deployment target or add `-Wl,-ld_classic` to the build settings to revert to the classic linker.
In my `.zprofile` I have made appropriate settings to deal with these challenges, including reverting to the classic linker and customizing the library paths for Dlang. Translated with
www.DeepL.com/Translator (free version).
To further clarify the installation and configuration of Ring under macOS Sonoma and Xcode 15, here is an example of the settings in the `.zprofile` that can help solve potential problems:
```shell
# Settings for the clang linker
export LDFLAGS="$LDFLAGS -Wl,-ld_classic -Wl,-no_warn_duplicate_libraries"
# Settings for Dlang (see dmd configuration file)
export DFLAGS="$DFLAGS -L-ld_classic"
# Path information for Dlang to find libraries under macOS
export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
# Set the minimum deployment target for macOS
export MACOSX_DEPLOYMENT_TARGET=11
```
The entries for D-Lang are only to be understood as an example and are not relevant for Ring.
These settings make it possible to use the classic linker and suppress the warnings for duplicate libraries, which can be relevant under macOS Sonoma and with Xcode 15. Specific adjustments are also made for the use of Dlang, including the configuration of paths to find libraries correctly.
By customizing the `.zprofile` you can ensure that your development environment is properly configured to work with the latest versions of macOS and Xcode. It is recommended to check these settings carefully and adjust them if necessary to avoid compatibility issues.
The setting OTHER_LDFLAGS = -Wl,-no_warn_duplicate_libraries is specifically intended for the configuration of build settings in Xcode projects. To use this setting effectively, you should be integrating it into the Xcode project settings or into an Xcode configuration file (.xcconfig). This allows you to make specific build configurations for your projects, including suppressing warnings about duplicate libraries when linking.
However, if you want similar settings to be available system-wide for compiles outside of Xcode, you could set equivalent flags in the LDFLAGS environment variable in your .zprofile. However, it is important to understand that such changes could affect the compilation of all C or C++ projects that use this environment variable.
Greetings
Stefan