Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1276 fix build macos micromamba #1277

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILDING_Linux.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Linux
# Building on Linux

- You can also see [ccpp.yml](https://github.com/nelson-lang/nelson/blob/master/.github/workflows/ccpp.yml) file to help you to see dependencies. This file is up-to-date about how to build Nelson on each platform.

Expand Down
81 changes: 70 additions & 11 deletions BUILDING_Macos.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
### MacOs X
# Building on macOS

- You can also see [ccpp.yml](https://github.com/nelson-lang/nelson/blob/master/.github/workflows/ccpp.yml) file to help you to see dependencies. This file is up-to-date about how to build Nelson on each platform.
To build this project on macOS, follow the steps below.

- Prerequirements:
## Prerequisites

- install xcode 6.1 or above and command line version
- install homebrew for mac
```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
```
1. **Install Xcode**
Xcode is required for compiling code on macOS.

See [Building with Linux](BUILDING_Linux.md) for more information about available compilation options.
2. **Install Homebrew**
Homebrew is a package manager for macOS that simplifies the installation of software.

[Previous (Building)](BUILDING.md)
```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
```

3. **Install Micromamba**
Micromamba is used to manage environments for this project. Follow the [Micromamba installation guide](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html) for detailed instructions on macOS.

Alternatively, install it with Homebrew:

```bash
brew install micromamba
```

## Building the Project with micromamba

1. Navigate to the root directory of the project:

```bash
cd /path/to/nelson/
```

2. Create and activate the environment:

```bash
micromamba env create -f environment-macos-dev.yml
micromamba activate nelson
```

3. Create a build directory and run CMake with the following options:

```bash
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DFORCE_LIBGFORTRAN_LINK=ON \
-DWITHOUT_SLICOT_MODULE=ON \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_INSTALL_LIBDIR=lib
```

4. Build the project:

```bash
cmake --build .
cmake --build . --target buildhelp
cmake --build . --target install
```

5. Run the application:

```bash
nelson
```

## Additional Information

- See [ccpp.yml](https://github.com/nelson-lang/nelson/blob/master/.github/workflows/ccpp.yml) for an up-to-date list of dependencies and build instructions across platforms.
- Refer to [Building with Linux](BUILDING_Linux.md) for further information on compilation options.

[Previous: Building](BUILDING.md)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `title`: `Visible` property is inherited from the parent if not explicitly defined.

### Fixed

- [#1276](http://github.com/nelson-lang/nelson/issues/1276) micromamba macos build.

## 1.9.0 (2024-10-26)

### Added
Expand Down
34 changes: 19 additions & 15 deletions CMake/PortAudioConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@
# ==============================================================================
if(PORTAUDIO_FOUND)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# workaround for github CI with catalina
if(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/include")
set(PORTAUDIO_INCLUDE_DIRS $ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/include)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/include")
set(PORTAUDIO_INCLUDE_DIRS $ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/include)
endif()
if(DEFINED ENV{CONDA_PREFIX})
set(PORTAUDIO_LIBRARIES $ENV{CONDA_PREFIX}/lib/libportaudio.dylib)
set(PORTAUDIO_INCLUDE_DIRS $ENV{CONDA_PREFIX}/include)
else()
# workaround for github CI with catalina
if(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/include")
set(PORTAUDIO_INCLUDE_DIRS $ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/include)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/include")
set(PORTAUDIO_INCLUDE_DIRS $ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/include)
endif()

if(EXISTS "$ENV{HOMEBREW_PREFIX}/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES $ENV{HOMEBREW_PREFIX}/lib/libportaudio.dylib)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES
$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/lib/libportaudio.dylib)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES
$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/lib/libportaudio.dylib)
if(EXISTS "$ENV{HOMEBREW_PREFIX}/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES $ENV{HOMEBREW_PREFIX}/lib/libportaudio.dylib)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES
$ENV{HOMEBREW_CELLAR}/portaudio/19.7.0/lib/libportaudio.dylib)
elseif(EXISTS "$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/lib/libportaudio.dylib")
set(PORTAUDIO_LIBRARIES
$ENV{HOMEBREW_CELLAR}/portaudio/19.6.0/lib/libportaudio.dylib)
endif()
endif()

message(STATUS "Found portaudio (MacOs): ${PORTAUDIO_LIBRARIES}")
endif()
endif()
Expand Down