Skip to content

Commit

Permalink
Merge OpenFAST/dev + Bjonkman AFI pull request OpenFAST#213
Browse files Browse the repository at this point in the history
Accepted all of OpenFAST#213 for the non cmake-related code.
  • Loading branch information
HaymanConsulting committed Dec 13, 2018
2 parents 4c11bed + 428f835 commit cdf28d0
Show file tree
Hide file tree
Showing 218 changed files with 17,909 additions and 9,824 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# add (semi-useful) version info to git archive
CreateGitVersion.bat ident export-subst

# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf

53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Bug report
about: Create a report to help us improve

---

**Bug description**
A clear and concise description of the bug.

**To Reproduce**
Steps to reproduce the behavior:
1. Compile with '...'
2. Run '...' case with '...' settings
3. Open '...' output
4. See the error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OpenFAST Version**
Please provide as much detail as possible including git commit. The best information is a screenshot of the OpenFAST system description that prints when running OpenFAST:
```
**************************************************************************************************
OpenFAST
Copyright (C) National Renewable Energy Laboratory
Copyright (C) Envision Energy USA LTD
This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.
**************************************************************************************************
OpenFAST-v2.0.0
Compile Info:
- Architecture: 64 bit
- Precision: double
- Date: Nov 27 2018
- Time: 17:19:38
Execution Info:
- Date: 11/29/2018
- Time: 10:52:28-0700
```

**System Information (please complete the following information):**
- OS: [e.g. Ubuntu 14.04 or macOS 10.12]
- Compiler: [e.g. GFortran 4.4]
- Compiler settings: [e.g. CMake flags or other settings]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@
*.exe
*.out
*.app
__pycache__/*
*.pyc

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

# vs-build specific folders and files
vs-build/*

# ide and system specific directories and files
# OS and IDE specific files
.DS_Store
.vscode
.atom
.fortls

# mbdyn and kitefast output
*.act
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
url = https://github.com/openfast/r-test.git
[submodule "unit_tests/pfunit"]
path = unit_tests/pfunit
url = https://git.code.sf.net/p/pfunit/code
url = https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git
86 changes: 70 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,75 @@
# Travis CI configuration
#
# Environment info
# https://docs.travis-ci.com/user/reference/overview/
# https://docs.travis-ci.com/user/reference/osx/
# https://docs.travis-ci.com/user/reference/trusty/

# macOS
os: osx
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

before_install:
# first uninstall a conflicting package
- brew cask uninstall oclint

# update and install required packages
- brew update
- brew install gcc
# - brew install cmake # cmake is already installed in the default mac image

before_script:
- mkdir build
- cd build
- cmake ..

# 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 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

# 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

script:
- make -j 8
# 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

# subset of openfast regression tests
# do not run
# - 3, 4, 7, 15, 16, 17 since the free yaw is not well trusted
# - 20, 21 because theyre too long
# THIS IS COMMENTED UNTIL TESTS CAN RELIABLY DETERMINE REGRESSION
# 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

67 changes: 37 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
cmake_minimum_required(VERSION 2.8.12)
project(OpenFAST CXX C Fortran)

include(${CMAKE_SOURCE_DIR}/cmake/FastCmakeUtils.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/FastFortranOptions.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/OpenfastCmakeUtils.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/OpenfastFortranOptions.cmake)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

Expand All @@ -39,7 +39,7 @@ 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_FAST_CPP_API "Enable building FAST - C++ API" off)
option(BUILD_OPENFAST_CPP_API "Enable building OpenFAST - C++ API" off)

# Setup Fortran Compiler options based on architecture/compiler
set_fast_fortran()
Expand All @@ -53,8 +53,18 @@ if (FPE_TRAP_ENABLED)
endif (FPE_TRAP_ENABLED)

# Setup dependencies
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
find_package(MKL)
endif()
if (MKL_FOUND)
include_directories(${MKL_INCLUDE_DIRS})
set(BLAS_LIBRARIES ${MKL_LIBRARIES})
set(LAPACK_LIBRARIES ${MKL_LIBRARIES})
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "ifport;ifcore;imf;svml;m;ipgo;intlc;c;irc_s;dl;c")
else()
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
endif()

########################################################################
# Test option configuration
Expand All @@ -65,14 +75,14 @@ if(BUILD_TESTING)
endif()

########################################################################
# Build rules for FAST Registry
# Build rules for OpenFAST Registry
#
add_subdirectory(modules-local/fast-registry)
add_subdirectory(modules-local/openfast-registry)

########################################################################
# FAST Core modules
# OpenFAST Core modules
#
set(FAST_MODULES_LOCAL
set(OPENFAST_MODULES_LOCAL
nwtc-library
inflowwind
actuatordisk
Expand All @@ -91,37 +101,37 @@ set(FAST_MODULES_LOCAL
supercontroller
turbsim
vsm
fast-library
kitefast-library
kitefast-controller
openfast-library
)

########################################################################
# FAST External modules
# OpenFAST External modules
#
set(FAST_MODULES_EXTERNAL
set(OPENFAST_MODULES_EXTERNAL
feamooring
moordyn
icedyn
icefloe
map
)

set(FAST_REGISTRY_INCLUDES "" CACHE INTERNAL "Registry includes paths")
set_registry_includes("modules-local" ${FAST_MODULES_LOCAL})
set_registry_includes("modules-ext" ${FAST_MODULES_EXTERNAL})
# Fix non-standard path addition to FAST_REGISTRY_INCLUDES in icefloe module
set(FAST_REGISTRY_INCLUDES
${FAST_REGISTRY_INCLUDES} -I ${CMAKE_SOURCE_DIR}/modules-ext/icefloe/src/interfaces/FAST/
set(OPENFAST_REGISTRY_INCLUDES "" CACHE INTERNAL "Registry includes paths")
set_registry_includes("modules-local" ${OPENFAST_MODULES_LOCAL})
set_registry_includes("modules-ext" ${OPENFAST_MODULES_EXTERNAL})
# Fix non-standard path addition to OPENFAST_REGISTRY_INCLUDES in icefloe module
set(OPENFAST_REGISTRY_INCLUDES
${OPENFAST_REGISTRY_INCLUDES} -I ${CMAKE_SOURCE_DIR}/modules-ext/icefloe/src/interfaces/FAST/
CACHE INTERNAL "Registry includes paths")

foreach(IDIR IN ITEMS ${FAST_MODULES_LOCAL})
foreach(IDIR IN ITEMS ${OPENFAST_MODULES_LOCAL})
add_subdirectory("${CMAKE_SOURCE_DIR}/modules-local/${IDIR}")
endforeach(IDIR IN ITEMS ${FAST_MODULES_LOCAL})
endforeach(IDIR IN ITEMS ${OPENFAST_MODULES_LOCAL})

foreach(IDIR IN ITEMS ${FAST_MODULES_EXTERNAL})
foreach(IDIR IN ITEMS ${OPENFAST_MODULES_EXTERNAL})
add_subdirectory("${CMAKE_SOURCE_DIR}/modules-ext/${IDIR}")
endforeach(IDIR IN ITEMS ${FAST_MODULES_EXTERNAL})
endforeach(IDIR IN ITEMS ${OPENFAST_MODULES_EXTERNAL})

add_subdirectory(glue-codes)

Expand All @@ -140,7 +150,7 @@ include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR include/)
set(LIB_INSTALL_DIR lib/)
set(FTNMOD_INSTALL_DIR include/openfast/)
if (BUILD_FAST_CPP_API)
if (BUILD_OPENFAST_CPP_API)
set(OpenFAST_HAS_CXX_API TRUE)
else()
set(OpenFAST_HAS_CXX_API FALSE)
Expand All @@ -156,12 +166,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenFASTConfig.cmake

########################################################################
# Configure the default install path to openfast/install
string(FIND ${CMAKE_Fortran_MODULE_DIRECTORY} "build/ftnmods" found)
if(${found} GREATER 0)
string(REPLACE "build/ftnmods" "install" install_path ${CMAKE_Fortran_MODULE_DIRECTORY})
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${install_path} CACHE PATH "..." FORCE)
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH
"OpenFAST install directory" FORCE)
endif()

# Option configuration
Expand All @@ -178,4 +185,4 @@ endif()
option(BUILD_DOCUMENTATION "Build documentation." OFF)
if(BUILD_DOCUMENTATION)
add_subdirectory(docs)
endif()
endif()
Loading

0 comments on commit cdf28d0

Please sign in to comment.