Skip to content
New issue

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

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

Already on GitHub? # to your account

Add macOS target #16

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019 ]
os: [ ubuntu-20.04, windows-2019, macos-12 ]
runs-on: ${{matrix.os}}
timeout-minutes: 40
steps:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
publish:
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019 ]
os: [ ubuntu-20.04, windows-2019, macos-12 ]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -51,3 +51,10 @@ jobs:
releaseMingwX64 --build-cache --no-daemon -Ppublishing.enabled=true
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
- if: matrix.os == 'macos-12'
uses: gradle/gradle-build-action@v2.3.3
with:
arguments: >
releaseMacosX64 --build-cache --no-daemon -Ppublishing.enabled=true
-Ppublishing.space.user=${{ secrets.PUBLISHING_SPACE_USER }}
-Ppublishing.space.token=${{ secrets.PUBLISHING_SPACE_TOKEN }}
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
- [matrix-contexts](src/nativeMain/kotlin/GslLinearSpace.kt) : LinearSpace implementations for Double, Float, and Complex matrices and vectors implemented with GSL


## Artifact:

The Maven coordinates of this project are `space.kscience:kmath-gsl:0.3.0-dev-5`.

**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-gsl:0.3.0-dev-5'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-gsl:0.3.0-dev-5")
}
## Artifact:
The Maven coordinates of this project are `space.kscience:kmath-gsl:0.3.0-dev-5`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:kmath-gsl:0.3.0-dev-5'
}
```
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}
dependencies {
implementation("space.kscience:kmath-gsl:0.3.0-dev-5")
}
```

## Additional requirements
Expand Down
13 changes: 11 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ plugins {
alias(libs.plugins.download)
alias(kscienceLibs.plugins.gradle.project)
alias(kscienceLibs.plugins.kotlin.multiplatform)
id("org.jetbrains.dokka") version "1.7.20"
}

group = "space.kscience"
Expand All @@ -33,6 +32,7 @@ kotlin {
val nativeTargets = setOf(
linuxX64(),
mingwX64(),
macosX64(),
)

val downloadLinks = when (HostManager.hostOs()) {
Expand All @@ -42,6 +42,10 @@ kotlin {

"windows" -> DownloadLinks(gsl = null)

"osx" -> DownloadLinks(
gsl = "https://anaconda.org/conda-forge/gsl/2.7/download/osx-64/gsl-2.7-h93259b0_0.tar.bz2"
)

else -> {
logger.warn("Current OS cannot build any of kmath-gsl targets.")
return@kotlin
Expand Down Expand Up @@ -87,6 +91,11 @@ kotlin {
staticLibraries.linux=libgsl.a libgslcblas.a
compilerOpts.linux=-I${thirdPartyDir}/include/
libraryPaths.linux=${thirdPartyDir}/lib/

linkerOpts.osx=-L/opt/local/lib -L/usr/local/lib -lblas
staticLibraries.osx=libgsl.a libgslcblas.a
compilerOpts.osx=-I${thirdPartyDir}/include/
libraryPaths.osx=${thirdPartyDir}/lib/

linkerOpts.mingw=-LC:/msys64/mingw64/lib/ -LC:/msys64/mingw64/bin/
staticLibraries.mingw=libgsl.a libgslcblas.a
Expand All @@ -113,7 +122,7 @@ kotlin {

commonMain {
dependencies {
api("space.kscience:kmath-complex:0.3.1-dev-5")
api("space.kscience:kmath-complex:0.3.0")
}
}

Expand Down