Skip to content

Commit

Permalink
Merge pull request #2 from rafmudaf/f/Envision
Browse files Browse the repository at this point in the history
Update f/Envision to openfast/dev
  • Loading branch information
bjonkman authored Aug 1, 2018
2 parents 502dde3 + 50e45b6 commit 997e5b2
Show file tree
Hide file tree
Showing 87 changed files with 1,442 additions and 1,710 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*.exe
*.out
*.app
__pycache__/*
*.pyc

# Build specific files
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://github.com/openfast/pfunit.git
url = https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git
77 changes: 62 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,68 @@
# 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

# linux configuration; container-based environments (default for linux) require the following setup block
addons:
apt:
packages:
- gfortran
- libblas-dev
- liblapack-dev

env:
- FC=/usr/local/bin/gfortran-7
- FC=/usr/bin/gfortran

# mac configuration
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 ..

- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask uninstall oclint; fi

# install required packages
- 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
# - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake; fi # cmake is already installed in the default mac image

# common configuration
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pyenv shell 3.6.3; fi
- pip3 install numpy

install:
- mkdir build && cd build
- cmake .. -DBUILD_TESTING=ON
- make -j 8 install

matrix:
exclude:
- os: linux
env: FC=/usr/local/bin/gfortran-7
- os: osx
env: FC=/usr/bin/gfortran

script:
- make -j 8
# beamdyn unit tests
- ctest -R beamdyn_utest

# beamdyn regression tests
- ctest -R bd_

# 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

42 changes: 21 additions & 21 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 Down Expand Up @@ -75,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
aerodyn
Expand All @@ -97,35 +97,35 @@ set(FAST_MODULES_LOCAL
openfoam
supercontroller
turbsim
fast-library
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 @@ -144,7 +144,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 Down
22 changes: 11 additions & 11 deletions cmake/FindMKL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
# limitations under the License.
#

find_path(MKL_INCLUDE_DIRS
mkl.h
HINTS $ENV{MKLROOT}
PATH_SUFFIXES include)
# find_path(MKL_INCLUDE_DIRS
# mkl.h
# HINTS $ENV{MKLROOT}
# PATH_SUFFIXES include)

find_library(MKL_IFACE_LIB
NAMES mkl_intel_lp64 libmkl_intel_lp64.a
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64)
NAMES mkl_intel_lp64 libmkl_intel_lp64.a mkl_intel_lp64_dll.lib
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64 $ENV{INTEL}/mkl/lib/intel64_win)

find_library(MKL_SEQ_LIB
NAMES mkl_sequential libmkl_sequential.a
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64)
NAMES mkl_sequential libmkl_sequential.a mkl_sequential.lib
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64 $ENV{INTEL}/mkl/lib/intel64_win)

find_library(MKL_CORE_LIB
NAMES mkl_core libmkl_core.a
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64)
NAMES mkl_core libmkl_core.a mkl_core_dll.lib
PATHS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64 $ENV{INTEL}/mkl/lib/intel64 $ENV{INTEL}/mkl/lib/intel64_win)

if (MKL_IFACE_LIB AND MKL_SEQ_LIB AND MKL_CORE_LIB)
set(MKL_LIBRARIES ${MKL_IFACE_LIB} ${MKL_SEQ_LIB} ${MKL_CORE_LIB})
Expand All @@ -40,6 +40,6 @@ endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MKL DEFAULT_MSG
MKL_LIBRARIES MKL_INCLUDE_DIRS MKL_IFACE_LIB MKL_SEQ_LIB MKL_CORE_LIB)
MKL_LIBRARIES MKL_IFACE_LIB MKL_SEQ_LIB MKL_CORE_LIB) # MKL_INCLUDE_DIRS)
mark_as_advanced(
MKL_INCLUDE_DIRS MKL_LIBRARIES MKL_IFACE_LIB MKL_SEQ_LIB MKL_CORE_LIB)
14 changes: 7 additions & 7 deletions cmake/FastCmakeUtils.cmake → cmake/OpenfastCmakeUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ function(generate_f90_types regfile outfile)
set(output "${CMAKE_CURRENT_BINARY_DIR}/${output_base}")
add_custom_command(
OUTPUT ${output}
DEPENDS fast_registry ${input}
COMMAND ${CMAKE_BINARY_DIR}/modules-local/fast-registry/fast_registry
${input} ${FAST_REGISTRY_INCLUDES} ${ARGN})
DEPENDS openfast_registry ${input}
COMMAND ${CMAKE_BINARY_DIR}/modules-local/openfast-registry/openfast_registry
${input} ${OPENFAST_REGISTRY_INCLUDES} ${ARGN})
set_source_files_properties(${output} PROPERTIES GENERATED TRUE)
endfunction(generate_f90_types regfile outfile)
endfunction(generate_f90_types)

#
# SET_REGISTRY_INCLUDES - Set includes path for generating *_Types.f90
Expand All @@ -61,8 +61,8 @@ endfunction(generate_f90_types regfile outfile)
#
function(set_registry_includes modules_location)
foreach(IDIR IN ITEMS ${ARGN})
set(FAST_REGISTRY_INCLUDES
${FAST_REGISTRY_INCLUDES} -I ${CMAKE_SOURCE_DIR}/${modules_location}/${IDIR}/src
set(OPENFAST_REGISTRY_INCLUDES
${OPENFAST_REGISTRY_INCLUDES} -I ${CMAKE_SOURCE_DIR}/${modules_location}/${IDIR}/src
CACHE INTERNAL "Registry includes paths")
endforeach(IDIR IN ITEMS ${ARGN})
endfunction(set_registry_includes reg_inc_var)
endfunction(set_registry_includes)
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ macro(set_fast_fortran)
endif()
endif()

# Set the preprocessor for all source files by default
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp ")

# Force all .mod files to be stored in a single directory
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/ftnmods"
CACHE STRING "Set the Fortran Modules directory" FORCE)
Expand All @@ -80,6 +77,7 @@ endmacro(set_fast_fortran)
macro(set_fast_gfortran)
if(NOT WIN32)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic")
endif(NOT WIN32)

# Fix free-form compilation for OpenFAST
Expand All @@ -88,7 +86,7 @@ macro(set_fast_gfortran)
# Deal with Double/Single precision
if (DOUBLE_PRECISION)
add_definitions(-DDOUBLE_PRECISION)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -fdefault-real-8")
endif (DOUBLE_PRECISION)

# debug flags
Expand Down Expand Up @@ -117,7 +115,7 @@ macro(set_fast_intel_fortran_posix)
# Deal with Double/Single precision
if (DOUBLE_PRECISION)
add_definitions(-DDOUBLE_PRECISION)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double_size 128")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -r8 -double_size 128")
endif (DOUBLE_PRECISION)
endmacro(set_fast_intel_fortran_posix)

Expand All @@ -129,7 +127,7 @@ macro(set_fast_intel_fortran_windows)
# Deal with Double/Single precision
if (DOUBLE_PRECISION)
add_definitions(-DDOUBLE_PRECISION)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:128")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /fpp /real_size:64 /double_size:128")
endif (DOUBLE_PRECISION)

# Turn off specific warnings
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pyparsing==2.1.9
Sphinx==1.5.2
sphinxcontrib-bibtex==0.3.4
sphinxcontrib-doxylink==1.3
sphinx_rtd_theme==0.3.1
requests[security]
Loading

0 comments on commit 997e5b2

Please sign in to comment.