Skip to content

Commit

Permalink
Merge branch 'NREL:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rdamiani authored May 19, 2024
2 parents eebce19 + 7deb583 commit a541aec
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 27 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## Desired use case
_If you are able, please provide some background about your ROSCO use case. It helps guide our development and could help us better fix your issue._

## Description
_Describe the bug here_

### Steps to reproduce issue
_Please provide a minimum working example (MWE) if possible_

1.
2.
3.

### Current behavior

### Expected behavior


### Code versions
_List versions only if relevant_
- Python
-
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

# Description of feature
Describe the feature here and provide some context. Under what scenario would this be useful?

# Potential solution
Can you think of ways to implement this?
10 changes: 10 additions & 0 deletions .github/tools/cibw_repair_wheel_command_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e
set -x

WHEEL=$1
DEST_DIR=$2

python -m pip install delvewheel
python -m delvewheel show "$WHEEL" && python -m delvewheel repair -w "$DEST_DIR" "$WHEEL" --no-mangle-all
55 changes: 42 additions & 13 deletions .github/workflows/CI_rosco-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,59 @@ jobs:
strategy:
fail-fast: false #true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "macOS-13", "windows-latest"] #mac-13 intel, mac-14 arm
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Setup GNU Fortran
# if: false == contains( matrix.os, 'windows')
if: false == contains( matrix.os, 'windows')
uses: awvwgk/setup-fortran@v1 #modflowpy/install-intelfortran-action@v1 #

- name: Install compiler
if: false == contains( matrix.os, 'windows')
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang

- name: Install mingw-w64 on Windows
if: contains( matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
path-type: inherit
install: |
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-zeromq
mingw-w64-x86_64-cmake
mingw-w64-x86_64-pkg-config
- name: Install zeromq ubuntu
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt install libzmq3-dev libzmq5 libczmq-dev libczmq4
- name: Install zeromq mac
if: contains( matrix.os, 'mac')
run: |
brew install zeromq
- name: checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
id: cp
with:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Set compilers
if: false == contains( matrix.os, 'windows')
run: |
echo "CC=${{ steps.install_cc.outputs.cc }}" >> $GITHUB_ENV
echo "CXX=${{ steps.install_cc.outputs.cxx }}" >> $GITHUB_ENV
#- name: Setup tmate session
# if: contains( matrix.os, 'windows')
# uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -71,8 +106,8 @@ jobs:
strategy:
fail-fast: false #true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "macOS-13", "windows-latest"] #mac-13 intel, mac-14 arm
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: checkout repository
Expand Down Expand Up @@ -113,13 +148,7 @@ jobs:
- name: Install OpenFAST
run: |
conda install openfast==3.5.2
#- name: Check OpenFAST
# # if: contains( matrix.os, 'windows')
# run: |
# openfast -v
# which openfast
conda install openfast==3.5.3
- name: Generate Registry
run: |
Expand Down
55 changes: 45 additions & 10 deletions .github/workflows/Publish_ROSCO.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,66 @@
name: Build and upload to PyPI
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
# Best comparable example: https://github.com/pdfo/pdfo

# Build on every branch push, tag push, and pull request change:
#on: [push, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
release:
types:
- published
# Build on every pull request (no need for every push) and release change:
on: [pull_request, release]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- name: Setup GNU Fortran
if: false == contains( matrix.os, 'windows')
uses: awvwgk/setup-fortran@v1

- name: Install compiler
if: false == contains( matrix.os, 'windows')
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang

- name: Install mingw-w64 on Windows
if: contains( matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
path-type: inherit
install: |
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-zeromq
mingw-w64-x86_64-cmake
mingw-w64-x86_64-pkg-config
- name: Install zeromq ubuntu
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt install libzmq3-dev libzmq5 libczmq-dev libczmq4
- name: Install zeromq mac
if: contains( matrix.os, 'mac')
run: |
brew install zeromq
- name: Checkout
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
- name: Build wheels mac and linux
if: false == contains( matrix.os, 'windows')
uses: pypa/[email protected]
env:
CC: ${{ steps.install_cc.outputs.cc }}
CXX: ${{ steps.install_cc.outputs.cxx }}

- name: Build wheels windows
if: contains( matrix.os, 'windows')
uses: pypa/[email protected]

- uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- ninja
- numpy
- pandas
- pkg-config
- pyYAML
- pyparsing
- pytest
Expand Down
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rosco"
version = "2.9.0"
version = "2.9.2"
description = "A reference open source controller toolset for wind turbine applications."
readme = "README.md"
requires-python = ">=3.9"
Expand Down Expand Up @@ -36,6 +36,7 @@ classifiers = [ # Optional
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Fortran",
]
Expand Down Expand Up @@ -135,5 +136,16 @@ atomic = true
#src_paths=isort,test

[tool.cibuildwheel]
skip = ["cp36-*", "cp37-*", "cp38-*", "*-win32"]
build-frontend = "build"
skip = ["pp*", "cp36-*", "cp37-*", "cp38-*", "*-win32", "*-win_arm64"] #, "*-musllinux*"]
build-frontend = { name = "build", args = ["-w","-n"] }
before-build = "pip install setuptools cmake numpy pyzmq cmake-build-extension"
build-verbosity = "3"

# https://github.com/pdfo/pdfo
[[tool.cibuildwheel.overrides]]
select = "*-win_amd64"
environment = { PKG_CONFIG_PATH="c:/opt/64/lib/pkgconfig" }

[tool.cibuildwheel.windows]
repair-wheel-command = "bash .github/tools/cibw_repair_wheel_command_windows.sh {wheel} {dest_dir}"

2 changes: 1 addition & 1 deletion rosco/controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()
message(STATUS "CMAKE_Fortran_COMPILER_ID = ${CMAKE_Fortran_COMPILER_ID}")
if(APPLE OR UNIX)
# Enable .dll export
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
if (CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIMPLICIT_DLLEXPORT -r8 -double-size 64 -cpp -no-wrap-margin")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIMPLICIT_DLLEXPORT -ffree-line-length-0 -fdefault-real-8 -fdefault-double-8 -cpp")
Expand Down

0 comments on commit a541aec

Please sign in to comment.