Skip to content

Commit

Permalink
Merge pull request #1 from ebranlard/noise
Browse files Browse the repository at this point in the history
Noise
  • Loading branch information
ptrbortolotti authored Dec 13, 2019
2 parents 681b5e4 + 11215bd commit d27de10
Show file tree
Hide file tree
Showing 258 changed files with 254,225 additions and 20,240 deletions.
45 changes: 45 additions & 0 deletions .github/actions/compile-and-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright 2016 National Renewable Energy Laboratory
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM rafmudaf/openfast-ubuntu:dev

# Move into the openfast directory and update
WORKDIR /openfast
RUN git fetch
RUN git pull
RUN git submodule update

# Move into the "build" directory, remove the old reg tests, and compile
WORKDIR /openfast/build
RUN rm -rf reg_tests
RUN cmake ..
RUN make -j4 install

# Run the tests

# BeamDyn-specific tests
RUN ctest -VV -j7 -R bd_
RUN ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
# Dont run these in parallel, copying the case files can fail in a race condition
RUN ctest -VV -L linear

# Subset of OpenFAST regression tests; do not run
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 17, 22, 23 becuase we dont know why they fail :(
RUN ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25
10 changes: 10 additions & 0 deletions .github/actions/compile-and-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Compile and test'
description: 'Compile OpenFAST and run the tests'
author: 'NREL'
# inputs:
# build-type:
# description: 'Set the CMake build type: Release (-O3); RelWithDebInfo (-O2 -g); Debug (-g)'
# default: 'Release'
runs:
using: 'docker'
image: 'Dockerfile'
22 changes: 22 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

name: OpenFAST Build and Test

on: [push, pull_request]

# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macOS-10.14, ubuntu-18.04]
# runs-on: docker://rafmudaf/openfast-ubuntu:alpha

jobs:
build-and-test:
runs-on: ubuntu-latest
name: OpenFAST tests on Ubuntu
steps:
- name: Checkout
uses: actions/checkout@master
with:
submodule: recursive
- name: Build and test step
uses: ./.github/actions/compile-and-test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ __pycache__/*

# Build specific files
build*/
_build*/
install/
vs-build/

Expand All @@ -40,4 +41,5 @@ vs-build/
.vscode
.atom
.fortls
tags
# backup files
*.asv
29 changes: 29 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

sphinx:
configuration: docs/conf.py

formats:
- htmlzip
- pdf
# - epub

python:
version: 3.7
install:
- requirements: docs/requirements.txt
system_packages: true

# select the docker image to use: stable | latest
build:
image: stable

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true
77 changes: 34 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,55 @@

language: c

os:
- linux
- osx

env:
- FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=ON
- FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=OFF
- FC=/usr/bin/gfortran; DOUBLE_PRECISION=ON
- FC=/usr/bin/gfortran; DOUBLE_PRECISION=OFF
# - FC=ifort; DOUBLE_PRECISION=ON; TRAVIS_BUILD_INTEL=YES
matrix:
include:
- os: linux
dist: bionic
env: FC=/usr/bin/gfortran-7; DOUBLE_PRECISION=OFF
- os: linux
dist: bionic
env: FC=/usr/bin/gfortran-7; DOUBLE_PRECISION=ON; CPP_API=ON; CMAKE_FLAGS="-DBUILD_OPENFAST_CPP_API=$CPP_API"
- os: linux
dist: bionic
env: FC=/usr/bin/gfortran-7; DOUBLE_PRECISION=ON; CPP_API=ON; CMAKE_FLAGS="-DBUILD_OPENFAST_CPP_API=$CPP_API -DGENERATE_TYPES=ON"
- os: osx
osx_image: xcode11
env: FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=ON
- os: osx
osx_image: xcode11
env: FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=OFF

# macos dependency install
addons:
homebrew:
packages:
- gcc@7
- yaml-cpp
- hdf5
- open-mpi
update: true

before_install:
# mac configuration
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@7; fi

# linux configuration
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gfortran; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libblas-dev liblapack-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv shell 3.6.3; fi

# intel compiler
# this build requires setting an environment variable https://docs.travis-ci.com/user/environment-variables#defining-encrypted-variables-in-travisyml
# INTEL_SERIAL_NUMBER=XXXX-XXXXXXXX
- if [[ -n "${TRAVIS_BUILD_INTEL}" ]] ; then wget 'https://raw.githubusercontent.com/nemequ/icc-travis/master/install-icc.sh'; fi
- if [[ -n "${TRAVIS_BUILD_INTEL}" ]] ; then chmod 755 install-icc.sh; fi
- if [[ -n "${TRAVIS_BUILD_INTEL}" ]] ; then ./install-icc.sh --components ifort,icc,mkl; source ~/.bashrc; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gfortran libblas-dev liblapack-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CPP_API" == "ON" ]]; then sudo apt-get install libopenmpi-dev libyaml-cpp-dev libhdf5-dev libxml2-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv shell 3.7.1; fi

# common configuration
- pip3 install numpy

install:
- mkdir build && cd build
- cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=$DOUBLE_PRECISION -DBUILD_SHARED_LIBS=ON
- make -j 8 install

matrix:
exclude:
- os: linux
env: FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=ON
- os: linux
env: FC=/usr/local/bin/gfortran-7; DOUBLE_PRECISION=OFF
- os: osx
env: FC=/usr/bin/gfortran; DOUBLE_PRECISION=ON
- os: osx
env: FC=/usr/bin/gfortran; DOUBLE_PRECISION=OFF
# - os: osx
# env: FC=ifort; DOUBLE_PRECISION=ON; TRAVIS_BUILD_INTEL=YES
- cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=ON -DDOUBLE_PRECISION=$DOUBLE_PRECISION $CMAKE_FLAGS
- cat CMakeCache.txt
- make -j4 install

script:
# beamdyn unit tests
- if [[ "$DOUBLE_PRECISION" == "ON" ]]; then ctest -VV -R beamdyn_utest; fi

# beamdyn regression tests
- if [[ "$DOUBLE_PRECISION" == "ON" ]]; then ctest -VV -R bd_; fi
- if [[ "$DOUBLE_PRECISION" == "ON" ]]; then ctest -j4 -VV -R bd_; fi

# subset of openfast regression tests
# do not run
Expand All @@ -73,4 +65,3 @@ script:
# CURRENTLY, TESTS FAIL WITH VERY MINOR DIFFERENCES
# - ctest -VV -j 18 -I 1,1,1,2,5,6,8,9,10,11,12,13,14,18,19,22,23,24,25,26
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ctest -j 18 -I 1,1,1,2,5,6,8,9,10,11,12,13,14,18,19,22,23,24,25,26 ; fi

26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,25 @@ if (NOT CMAKE_BUILD_TYPE)
"Choose the build type: Debug Release" FORCE)
endif (NOT CMAKE_BUILD_TYPE)

option(GENERATE_TYPES "Use the openfast-regsitry to autogenerate types modules" off)
option(BUILD_SHARED_LIBS "Enable building shared libraries" off)
option(DOUBLE_PRECISION "Treat REAL as double precision" on)
option(USE_DLL_INTERFACE "Enable runtime loading of dynamic libraries" on)
option(FPE_TRAP_ENABLED "Enable FPE trap in compiler options" off)
option(ORCA_DLL_LOAD "Enable OrcaFlex Library Load" off)
option(BUILD_OPENFAST_CPP_API "Enable building OpenFAST - C++ API" off)

# Precompiler/preprocessor flag configuration
# Do this before configuring modules so that the flags are included
option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DUNIT_TEST")
endif()
option(BUILD_OPENFAST_SIMULINK_API "Enable building OpenFAST for use with Simulink" off)
if(BUILD_OPENFAST_SIMULINK_API)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DCOMPILE_SIMULINK")
endif()

# Setup Fortran Compiler options based on architecture/compiler
set_fast_fortran()

Expand All @@ -60,18 +72,12 @@ else()
find_package(LAPACK REQUIRED)
endif()

########################################################################
# Test option configuration
# Do this before configuring modules so that precompiler flags are included
option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DUNIT_TEST")
endif()

########################################################################
# Build rules for OpenFAST Registry
#
add_subdirectory(modules/openfast-registry)
if(GENERATE_TYPES)
add_subdirectory(modules/openfast-registry)
endif()

########################################################################
# OpenFAST modules
Expand All @@ -98,7 +104,7 @@ set(OPENFAST_MODULES
icedyn
icefloe
map
)
)

set(OPENFAST_REGISTRY_INCLUDES "" CACHE INTERNAL "Registry includes paths")
set_registry_includes("modules" ${OPENFAST_MODULES})
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
MAKE=make --no-print-directory
CMAKE_ARGS= -DGENERATE_TYPES=ON -DCMAKE_BUILD_TYPE=Debug
ifeq ($(OS),Windows_NT)
OS=Windows
suffix=-nmake
CMAKE_ARGS=-G"NMake Makefiles"
CMAKE_ARGS:=$(CMAKE_ARGS) -G"NMake Makefiles"
MAKE=nmake
RMDIR=rmdir /S /Q
LIBEXT=.dll
Expand Down
73 changes: 0 additions & 73 deletions README.md

This file was deleted.

Loading

0 comments on commit d27de10

Please sign in to comment.