From 5bf1153d82765b157faed8b7b2d7ec2ecd0f2311 Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Thu, 1 Jun 2017 16:04:39 -0600 Subject: [PATCH 01/11] Updating the reading and writing of number of time steps to the velocity data file --- glue-codes/fast-cpp/src/OpenFAST.H | 2 +- glue-codes/fast-cpp/src/OpenFAST.cpp | 26 ++++++++------------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/glue-codes/fast-cpp/src/OpenFAST.H b/glue-codes/fast-cpp/src/OpenFAST.H index e9a605cc43..9a4cac642b 100644 --- a/glue-codes/fast-cpp/src/OpenFAST.H +++ b/glue-codes/fast-cpp/src/OpenFAST.H @@ -167,7 +167,7 @@ class OpenFAST { void end(); hid_t openVelocityDataFile(bool createFile); - int readVelocityData(); + void readVelocityData(int nTimesteps); void writeVelocityData(hid_t h5file, int iTurb, int iTimestep, OpFM_InputType_t iData, OpFM_OutputType_t oData); herr_t closeVelocityDataFile(int nt_global, hid_t velDataFile); diff --git a/glue-codes/fast-cpp/src/OpenFAST.cpp b/glue-codes/fast-cpp/src/OpenFAST.cpp index 2e18fa845a..011365b3bd 100644 --- a/glue-codes/fast-cpp/src/OpenFAST.cpp +++ b/glue-codes/fast-cpp/src/OpenFAST.cpp @@ -113,10 +113,8 @@ void fast::OpenFAST::init() { int nTimesteps; if (nTurbinesProc > 0) { - nTimesteps = readVelocityData(); - if (nTimesteps != ntStart) throw std::runtime_error("Start time is not consistent with the number of timesteps in the velocity data file"); + readVelocityData(ntStart); } - for (int iTurb=0; iTurb < nTurbinesProc; iTurb++) { applyVelocityData(0, iTurb, cDriver_Output_to_FAST[iTurb], velNodeData[iTurb]); } @@ -758,9 +756,9 @@ void fast::OpenFAST::end() { } -int fast::OpenFAST::readVelocityData() { +void fast::OpenFAST::readVelocityData(int nTimesteps) { - int nTurbines, nTimesteps; + int nTurbines; hid_t velDataFile = H5Fopen(("velDatafile." + std::to_string(worldMPIRank) + ".h5").c_str(), H5F_ACC_RDWR, H5P_DEFAULT); @@ -769,10 +767,6 @@ int fast::OpenFAST::readVelocityData() { herr_t ret = H5Aread(attr, H5T_NATIVE_INT, &nTurbines) ; H5Aclose(attr); - attr = H5Aopen(velDataFile, "nTimesteps", H5P_DEFAULT); - ret = H5Aread(attr, H5T_NATIVE_INT, &nTimesteps) ; - H5Aclose(attr); - } // Allocate memory and read the velocity data. @@ -797,8 +791,6 @@ int fast::OpenFAST::readVelocityData() { } - return nTimesteps; - } hid_t fast::OpenFAST::openVelocityDataFile(bool createFile) { @@ -854,19 +846,13 @@ hid_t fast::OpenFAST::openVelocityDataFile(bool createFile) { herr_t fast::OpenFAST::closeVelocityDataFile(int nt_global, hid_t velDataFile) { - - hid_t attr_id = H5Aopen_by_name(velDataFile, ".", "nTimesteps", H5P_DEFAULT, H5P_DEFAULT); - herr_t status = H5Awrite(attr_id, H5T_NATIVE_INT, &nt_global); - status = H5Aclose(attr_id); - - status = H5Fclose(velDataFile) ; + herr_t status = H5Fclose(velDataFile) ; return status; } void fast::OpenFAST::writeVelocityData(hid_t h5File, int iTurb, int iTimestep, OpFM_InputType_t iData, OpFM_OutputType_t oData) { - hsize_t start[3]; start[0] = iTimestep; start[1] = 0; start[2] = 0; int nVelPts = get_numVelPtsLoc(iTurb) ; hsize_t count[3]; count[0] = 1; count[1] = nVelPts; count[2] = 6; @@ -893,6 +879,10 @@ void fast::OpenFAST::writeVelocityData(hid_t h5File, int iTurb, int iTimestep, O H5Sclose(dspace_id); H5Sclose(mspace_id); + hid_t attr_id = H5Aopen_by_name(h5File, ".", "nTimesteps", H5P_DEFAULT, H5P_DEFAULT); + herr_t status = H5Awrite(attr_id, H5T_NATIVE_INT, &iTimestep); + status = H5Aclose(attr_id); + } void fast::OpenFAST::applyVelocityData(int iPrestart, int iTurb, OpFM_OutputType_t cDriver_Output_to_FAST, std::vector & velData) { From 7f0927135e2738885eebfed7b0c3581938487e48 Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Mon, 24 Jul 2017 16:37:46 -0600 Subject: [PATCH 02/11] Updating OpenFOAM.f90 to be more robust when interpolating chord to the force nodes --- modules-local/openfoam/src/OpenFOAM.f90 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules-local/openfoam/src/OpenFOAM.f90 b/modules-local/openfoam/src/OpenFOAM.f90 index 9f7cb9c80e..428747f29e 100644 --- a/modules-local/openfoam/src/OpenFOAM.f90 +++ b/modules-local/openfoam/src/OpenFOAM.f90 @@ -1025,7 +1025,7 @@ SUBROUTINE CalcForceActuatorPositionsBlade(InitIn_OpFM, p_OpFM, structPositions, ! Now calculate the positions of the force nodes based on interpolation DO I=1,p_OpFM%NnodesForceBlade ! Calculate the position of the force nodes jLower=1 - do while ( (rStructNodes(jLower) - p_OpFM%forceBldRnodes(I))*(rStructNodes(jLower+1) - p_OpFM%forceBldRnodes(I)) .gt. 0 ) + do while ( ( (rStructNodes(jLower) - p_OpFM%forceBldRnodes(I))*(rStructNodes(jLower+1) - p_OpFM%forceBldRnodes(I)) .gt. 0) .and. (jLower .lt. nStructNodes) ) jLower = jLower + 1 end do rInterp = (p_OpFM%forceBldRnodes(I) - rStructNodes(jLower))/(rStructNodes(jLower+1)-rStructNodes(jLower)) ! The location of this force node in (0,1) co-ordinates between the jLower and jLower+1 nodes @@ -1066,7 +1066,7 @@ SUBROUTINE CalcForceActuatorPositionsTower(InitIn_OpFM, p_OpFM, structPositions, ! Now calculate the positions of the force nodes based on interpolation DO I=1,p_OpFM%NnodesForceTower ! Calculate the position of the force nodes jLower=1 - do while ( (hStructNodes(jLower) - p_OpFM%forceTwrHnodes(I))*(hStructNodes(jLower+1) - p_OpFM%forceTwrHnodes(I)) .gt. 0 ) + do while ( ((hStructNodes(jLower) - p_OpFM%forceTwrHnodes(I))*(hStructNodes(jLower+1) - p_OpFM%forceTwrHnodes(I)) .gt. 0) .and. (jLower .lt. nStructNodes)) jLower = jLower + 1 end do hInterp = (p_OpFM%forceTwrHnodes(I) - hStructNodes(jLower))/(hStructNodes(jLower+1)-hStructNodes(jLower)) ! The location of this force node in (0,1) co-ordinates between the jLower and jLower+1 nodes @@ -1098,18 +1098,20 @@ SUBROUTINE OpFM_CreateActForceBladeTowerNodes(p_OpFM, ErrStat, ErrMsg) !Do the blade first allocate(p_OpFM%forceBldRnodes(p_OpFM%NnodesForceBlade), stat=errStat2) dRforceNodes = p_OpFM%BladeLength/(p_OpFM%NnodesForceBlade-1) - do i=1,p_OpFM%NnodesForceBlade + do i=1,p_OpFM%NnodesForceBlade-1 p_OpFM%forceBldRnodes(i) = (i-1)*dRforceNodes end do + p_OpFM%forceBldRnodes(p_OpFM%NnodesForceBlade) = p_OpFM%BladeLength !Do the tower now allocate(p_OpFM%forceTwrHnodes(p_OpFM%NnodesForceTower), stat=errStat2) dRforceNodes = p_OpFM%TowerHeight/(p_OpFM%NnodesForceTower-1) - do i=1,p_OpFM%NnodesForceTower + do i=1,p_OpFM%NnodesForceTower-1 p_OpFM%forceTwrHnodes(i) = (i-1)*dRforceNodes end do - + p_OpFM%forceTwrHnodes(p_OpFM%NnodesForceTower) = p_OpFM%TowerHeight + return END SUBROUTINE OpFM_CreateActForceBladeTowerNodes @@ -1127,6 +1129,7 @@ SUBROUTINE OpFM_InterpolateForceNodesChord(InitOut_AD, p_OpFM, u_OpFM, ErrStat, !Local variables INTEGER(IntKI) :: i,j,k,node ! Loop variables INTEGER(IntKI) :: nNodesBladeProps ! Number of nodes in the blade properties for a given blade + INTEGER(IntKI) :: nNodesTowerProps ! Number of nodes in the tower properties INTEGER(IntKI) :: jLower ! Index of the blade properties node just smaller than the force node INTEGER(IntKi) :: ErrStat2 ! temporary Error status of the operation CHARACTER(ErrMsgLen) :: ErrMsg2 ! temporary Error message if ErrStat /= ErrID_None @@ -1159,12 +1162,13 @@ SUBROUTINE OpFM_InterpolateForceNodesChord(InitOut_AD, p_OpFM, u_OpFM, ErrStat, ! The tower now + nNodesTowerProps = SIZE(InitOut_AD%TwrElev) do k = p_OpFM%NumBl+1,p_OpFM%NMappings ! Calculate the chord at the force nodes based on interpolation DO I=1,p_OpFM%NnodesForceTower Node = Node + 1 jLower=1 - do while ( (InitOut_AD%TwrElev(jLower) - p_OpFM%forceTwrHnodes(I))*(InitOut_AD%TwrElev(jLower+1) - p_OpFM%forceTwrHnodes(I)) .gt. 0 ) !Determine the closest two nodes at which the blade properties are specified + do while ( ( (InitOut_AD%TwrElev(jLower) - p_OpFM%forceTwrHnodes(I))*(InitOut_AD%TwrElev(jLower+1) - p_OpFM%forceTwrHnodes(I)) .gt. 0) .and. (jLower .le. nNodesTowerProps) ) !Determine the closest two nodes at which the blade properties are specified jLower = jLower + 1 end do rInterp = (p_OpFM%forceTwrHnodes(I) - InitOut_AD%TwrElev(jLower))/(InitOut_AD%TwrElev(jLower+1)-InitOut_AD%TwrElev(jLower)) ! The location of this force node in (0,1) co-ordinates between the jLower and jLower+1 nodes From f855181e9e5588ddca12fa1c56b376bae6bea7b2 Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Mon, 24 Jul 2017 17:09:50 -0600 Subject: [PATCH 03/11] Update install instructions and provide sample scripts for configuration and installation --- docs/source/install_linux.rst | 9 ++ glue-codes/fast-cpp/CMakeLists.txt | 1 + share/doConfigOpenFAST_cpp_nospack | 19 +++++ share/doConfigOpenFAST_cpp_spack | 41 ++++++++++ share/doConfigOpenFAST_nospack | 18 ++++ share/install_nospack.sh | 127 +++++++++++++++++++++++++++++ 6 files changed, 215 insertions(+) create mode 100755 share/doConfigOpenFAST_cpp_nospack create mode 100755 share/doConfigOpenFAST_cpp_spack create mode 100755 share/doConfigOpenFAST_nospack create mode 100755 share/install_nospack.sh diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index e0d5fbf307..41f040d939 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -12,6 +12,7 @@ CMake Build Instructions cmake ../ make + Current CMake Options ~~~~~~~~~~~~~~~~~~~~~ @@ -23,3 +24,11 @@ Current CMake Options - ``CMAKE_INSTALL_PREFIX`` - Set desired installation directory - ``BUILD_SHARED_LIBS`` - Enable/disable building shared libraries (Default: OFF) +- ``FPE_TRAP_ENABLED`` - Enable Floating Point Exception trap +- ``BUILD_CPP_API`` - Enable C++ API + +Dependencies +~~~~~~~~~~~~ + +OpenFAST depends on the ``LAPACK`` libraries provided through the variable ``BLASLIB``. When building the ``C++``API, OpenFAST also depends on `HDF5 ` (provided by ``HDF5_ROOT``) and `yaml-cpp ` (provided by ``YAML_ROOT``). We recommend installing OpenFAST using `spack `. However, we also provide some sample scripts in ``share`` folder if you choose to install without ``spack``. + diff --git a/glue-codes/fast-cpp/CMakeLists.txt b/glue-codes/fast-cpp/CMakeLists.txt index 0c01e257fe..9ab45299f7 100644 --- a/glue-codes/fast-cpp/CMakeLists.txt +++ b/glue-codes/fast-cpp/CMakeLists.txt @@ -30,6 +30,7 @@ include_directories(${MPI_INCLUDE_PATH}) add_library(openfastcpplib src/OpenFAST.cpp) +set_property(TARGET openfastcpplib PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(openfastcpplib openfastlib ${HDF5_C_LIBRARIES} diff --git a/share/doConfigOpenFAST_cpp_nospack b/share/doConfigOpenFAST_cpp_nospack new file mode 100755 index 0000000000..c2868a6814 --- /dev/null +++ b/share/doConfigOpenFAST_cpp_nospack @@ -0,0 +1,19 @@ +openfast_dir= +yaml_install_dir=$openfast_dir/install/ +hdf5_install_dir=$openfast_dir/install/ + +EXTRA_ARGS=$@ + +CC=mpicc CXX=mpic++ FC=gfortran cmake \ + -DCMAKE_INSTALL_PREFIX=$openfast_dir/install/ \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DBUILD_FAST_CPP_API=ON \ + -DYAML_ROOT:PATH=$yaml_install_dir \ + -DHDF5_USE_STATIC_LIBRARIES=ON \ + -DHDF5_ROOT:PATH=$hdf5_install_dir \ + -DLAPACK_LIBRARIES="$BLASLIB" \ + -DBLAS_LIBRARIES="$BLASLIB" \ + -DFPE_TRAP_ENABLED=OFF \ + $EXTRA_ARGS \ +../ &> log.cmake + diff --git a/share/doConfigOpenFAST_cpp_spack b/share/doConfigOpenFAST_cpp_spack new file mode 100755 index 0000000000..c203af0624 --- /dev/null +++ b/share/doConfigOpenFAST_cpp_spack @@ -0,0 +1,41 @@ +#!/bin/bash + +set -ex + +COMPILER=gcc +SPACK_ROOT= +SPACK_EXE=${SPACK_ROOT}/bin/spack +module purge +module load gcc/5.2.0 +module load python/2.7.8 +module use ${SPACK_ROOT}/share/spack/modules/$(${SPACK_EXE} arch) +module load $(${SPACK_EXE} module find cmake %${COMPILER}) +module load $(${SPACK_EXE} module find openmpi %${COMPILER}) +module load $(${SPACK_EXE} module find hdf5 %${COMPILER}) +module load $(${SPACK_EXE} module find zlib %${COMPILER}) +module load $(${SPACK_EXE} module find libxml2 %${COMPILER}) +module load $(${SPACK_EXE} module find xz %${COMPILER}) +module load $(${SPACK_EXE} module find binutils %${COMPILER}) +module list +which cmake + + +OPENFAST_DIR= +yaml_install_dir=`${SPACK_EXE} location -i yaml-cpp %${COMPILER}` +hdf5_install_dir=`${SPACK_EXE} location -i hdf5 %${COMPILER}` +zlib_install_dir=`${SPACK_EXE} location -i zlib %${COMPILER}` +libxml2_install_dir=`${SPACK_EXE} location -i libxml2 %${COMPILER}` +CC=gcc CXX=g++ FC=gfortran cmake \ + -DCMAKE_INSTALL_PREFIX=${OPENFAST_DIR}/install/ \ + -DCMAKE_BUILD_TYPE=DEBUG \ + -DBUILD_FAST_CPP_API=ON \ + -DFPE_TRAP_ENABLED:BOOL=ON \ + -DYAML_ROOT:PATH=$yaml_install_dir \ + -DHDF5_USE_STATIC_LIBRARIES=ON \ + -DHDF5_ROOT:PATH=$hdf5_install_dir \ + -DLIBXML2_ROOT:PATH=$libxml2_install_dir \ + -DLIBXML2_USE_STATIC_LIBRARIES=ON \ + -DHDF5_ROOT:PATH=$hdf5_install_dir \ + $EXTRA_ARGS \ +../ &> log.cmake +make VERBOSE=1 &> log.make diff --git a/share/doConfigOpenFAST_nospack b/share/doConfigOpenFAST_nospack new file mode 100755 index 0000000000..2118bd3e6a --- /dev/null +++ b/share/doConfigOpenFAST_nospack @@ -0,0 +1,18 @@ +openfast_dir= +yaml_install_dir=$openfast_dir/install/ +hdf5_install_dir=$openfast_dir/install/ + +EXTRA_ARGS=$@ + +CC=mpicc CXX=mpic++ FC=gfortran cmake \ + -DCMAKE_INSTALL_PREFIX=$openfast_dir/install/ \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DYAML_ROOT:PATH=$yaml_install_dir \ + -DHDF5_USE_STATIC_LIBRARIES=ON \ + -DHDF5_ROOT:PATH=$hdf5_install_dir \ + -DLAPACK_LIBRARIES="$BLASLIB" \ + -DBLAS_LIBRARIES="$BLASLIB" \ + -DFPE_TRAP_ENABLED=OFF \ + $EXTRA_ARGS \ +../ &> log.cmake + diff --git a/share/install_nospack.sh b/share/install_nospack.sh new file mode 100755 index 0000000000..81159f9938 --- /dev/null +++ b/share/install_nospack.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +passFail() { + if [ $1 -eq 0 ] + then + echo "... PASSED" + else + echo "... FAILED" + fi +} + +prepInstall() { +#Prepare for installation + echo -n "Prepping install" + echo -n $PWD > /tmp/fastDir + OPENFAST_DIR=$(sed 's:/:\\/:g' /tmp/fastDir) + echo "export OPENFAST_DIR=${OPENFAST_DIR}" > .prepInstall + source .prepInstall + passFail $? +} + +compileLapack() { +#Registry + echo -n "Compiling Lapack" + [ -d modules-ext/lapack ] || mkdir modules-ext/lapack + cd modules-ext/lapack + curl -k -o lapack-3.6.0.tgz http://www.netlib.org/lapack/lapack-3.6.0.tgz &> log.wget + tar -zxf lapack-3.6.0.tgz &> log.untar + [ -d build ] || mkdir build + cd build + make clean &> /dev/null + # if [ -f CMakeCache.txt] ; then + # rm CMakeCache.txt + # fi + cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_FORTRAN_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=../../../../install/ -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON -DBUILD_DEPRECATED=ON -DLAPACKE=ON ../lapack-3.6.0 &> log.config + make -j 8 &> log.make + make install &> log.makeInstall + passFail $? + cd ${OPENFAST_DIR} +} + +compileYAMLcpp() { +#yaml-cpp + echo "Compiling yaml-cpp" + echo -n " Setting up build directory" + [ -d modules-ext/yaml-cpp ] || mkdir modules-ext/yaml-cpp + cd modules-ext/yaml-cpp + git clone https://github.com/jbeder/yaml-cpp.git &> /dev/null + [ -d build ] || mkdir build + cd build + if [ -f CMakeCache.txt ] ; then + rm -rf CMakeCache.txt CMakeFiles/ + fi + passFail $? + echo -n " Configuring" + cmake ../yaml-cpp/ -DCMAKE_INSTALL_PREFIX=${OPENFAST_DIR}/install &> log.cmake + passFail $? + echo -n " Compiling" + make -j 8 &> log.make + passFail $? + echo -n " Installing" + make install &> log.makeInstall + passFail $? + cd ${OPENFAST_DIR} +} + +compileHDF5() { + echo "Compiling hdf5" + echo -n " Getting source" + [ -d modules-ext/hdf5 ] || mkdir modules-ext/hdf5 + cd modules-ext/hdf5 + wget --no-check-certificate https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-1.8.19.tar.bz2 &> log.wget + passFail $? + echo -n " Setting up build directory" + tar -jxf hdf5-1.8.19.tar.bz2 &> log.untar + cd hdf5-1.8.19 + passFail $? + echo -n " Configuring" + ./configure CC=mpicc FC=mpif90 CXX=mpicxx --enable-parallel --prefix=${OPENFAST_DIR}/install &> log.config + passFail $? + echo -n " Compiling" + make -j 8 &> log.make + passFail $? + echo -n " Installing" + make install &> log.makeInstall + passFail $? + cd ${OPENFAST_DIR} +} + +compileOpenFAST() { + echo "Compiling OpenFAST" + echo -n " Setting up config" + [ -d build ] || mkdir build + cd build/ + make clean &> /dev/null + # if [ -f CMakeCache.txt] ; then + # rm CMakeCache.txt + # fi + cp ${OPENFAST_DIR}/share/doConfigOpenFAST_cpp_nospack . + passFail $? + echo -n " Configuring" + ./doConfigOpenFAST_cpp_nospack + passFail $? + echo -n " Compiling" + make &> log.make + passFail $? + echo -n " Installing" + make install &> log.makeInstall + passFail $? + cd ${OPENFAST_DIR} +} + +prepPhiEnv() { + echo -n "Prepping phi.env" + echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > phi.env + echo "export PATH=$PATH" >> phi.env + echo "export FAST=FAST_ProgC_glin64" >> phi.env + passFail $? +} + +prepInstall +#compileYAMLcpp +#compileHDF5 +compileOpenFAST +#rm .prepInstall + + From dded7351588c2ce791c8aea1a6de108fb096debd Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Mon, 24 Jul 2017 17:12:57 -0600 Subject: [PATCH 04/11] Updating install script --- share/install_nospack.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/share/install_nospack.sh b/share/install_nospack.sh index 81159f9938..9c99a9fe2b 100755 --- a/share/install_nospack.sh +++ b/share/install_nospack.sh @@ -110,18 +110,9 @@ compileOpenFAST() { cd ${OPENFAST_DIR} } -prepPhiEnv() { - echo -n "Prepping phi.env" - echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" > phi.env - echo "export PATH=$PATH" >> phi.env - echo "export FAST=FAST_ProgC_glin64" >> phi.env - passFail $? -} - prepInstall -#compileYAMLcpp -#compileHDF5 +compileYAMLcpp +compileHDF5 compileOpenFAST -#rm .prepInstall From 592c15edc6990b23c723333dc545b216d765fd13 Mon Sep 17 00:00:00 2001 From: Shreyas Ananthan Date: Tue, 25 Jul 2017 08:40:24 -0600 Subject: [PATCH 05/11] FAST CXX: Update CMake directives for Spack HDF5 compilation Spack's HDF5 doesn't use a CMake configuration file, so the dependencies on zlib and libxml2 are set correctly when compiling the `openfastcpp` executable. The update specifically adds these dependencies to ensure compilation under both autoconf and CMake builds of HDF5. --- glue-codes/fast-cpp/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glue-codes/fast-cpp/CMakeLists.txt b/glue-codes/fast-cpp/CMakeLists.txt index 9ab45299f7..16fec3a70e 100644 --- a/glue-codes/fast-cpp/CMakeLists.txt +++ b/glue-codes/fast-cpp/CMakeLists.txt @@ -18,11 +18,15 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(MPI REQUIRED) +find_package(LibXml2 REQUIRED) +find_package(ZLIB REQUIRED) find_package(HDF5 REQUIRED COMPONENTS C HL) find_package(YAMLCPP REQUIRED) include_directories(${YAML_INCLUDES}) include_directories(${HDF5_INCLUDES}) +include_directories(${ZLIB_INCLUDES}) +include_directories(${LIBXML2_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/modules-local/fast-library/src/) include_directories(${CMAKE_BINARY_DIR}/modules-local/openfoam/) include_directories(${CMAKE_BINARY_DIR}/modules-local/supercontroller/) @@ -35,6 +39,8 @@ target_link_libraries(openfastcpplib openfastlib ${HDF5_C_LIBRARIES} ${HDF5_HL_LIBRARIES} + ${ZLIB_LIBRARIES} + ${LIBXML2_LIBRARIES} ${CMAKE_DL_LIBS}) add_executable(openfastcpp @@ -44,6 +50,8 @@ target_link_libraries(openfastcpp openfastcpplib openfastlib ${MPI_LIBRARIES} ${YAML_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_HL_LIBRARIES} + ${ZLIB_LIBRARIES} + ${LIBXML2_LIBRARIES} ${CMAKE_DL_LIBS}) if(MPI_COMPILE_FLAGS) From bd79d2099859a5cb4c29d59d2ef004c3f14eaa9a Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Mon, 7 Aug 2017 13:47:07 -0600 Subject: [PATCH 06/11] Updating instructions for building OpenFAST manually and using spack. --- docs/source/install_linux.rst | 122 +++++++++++++++++- glue-codes/fast-cpp/CMakeLists.txt | 1 + ...FAST_cpp_spack => fast-build-cpp-spack.sh} | 0 ...OpenFAST_cpp_nospack => fast-build-cpp.sh} | 0 ...doConfigOpenFAST_nospack => fast-build.sh} | 0 share/{install_nospack.sh => fast-install.sh} | 20 +-- share/spack/package.py | 99 ++++++++++++++ 7 files changed, 229 insertions(+), 13 deletions(-) rename share/{doConfigOpenFAST_cpp_spack => fast-build-cpp-spack.sh} (100%) rename share/{doConfigOpenFAST_cpp_nospack => fast-build-cpp.sh} (100%) rename share/{doConfigOpenFAST_nospack => fast-build.sh} (100%) rename share/{install_nospack.sh => fast-install.sh} (87%) create mode 100644 share/spack/package.py diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index 41f040d939..ff9177be5f 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -1,5 +1,7 @@ -OpenFAST -======== +Building OpenFAST +================= + +OpenFAST uses the `cmake ` build system. We recommend installing OpenFAST using `spack `. However, we also provide some sample scripts in ``share`` folder if you choose to install without `spack`. CMake Build Instructions ------------------------ @@ -30,5 +32,119 @@ Current CMake Options Dependencies ~~~~~~~~~~~~ -OpenFAST depends on the ``LAPACK`` libraries provided through the variable ``BLASLIB``. When building the ``C++``API, OpenFAST also depends on `HDF5 ` (provided by ``HDF5_ROOT``) and `yaml-cpp ` (provided by ``YAML_ROOT``). We recommend installing OpenFAST using `spack `. However, we also provide some sample scripts in ``share`` folder if you choose to install without ``spack``. +OpenFAST has the following dependencies: + +- ``LAPACK`` libraries provided through the variable ``BLASLIB``, +- for the ``C++`` API, OpenFAST also depends on `HDF5 ` (provided by ``HDF5_ROOT``) and `yaml-cpp ` (provided by ``YAML_ROOT``). + + + +Building OpenFAST Semi-Automatically Using Spack on Mac OS X or Linux +--------------------------------------------------------------------- + +The following describes how to build OpenFAST and its dependencies +mostly automatically on your Mac using +`Spack `__. +This can also be used as a template to build OpenFAST on any +Linux system with Spack. + +Step 1 +~~~~~~ + +This assumes you have a Homebrew installation of GCC installed already +(we are using GCC 6.3.0). These instructions have been tested on OSX 10.11. MacOS 10.12 +will not build CMake with GCC anymore, so these instructions won't work +in that case, but we have built OpenFAST using Spack on MacOS Sierra by +using Homebrew to install ``cmake`` and ``pkg-config`` and defining these +as external packages in Spack (see +`packages.yaml.mac_sierra `__). + +Step 2 +~~~~~~ + +Checkout the official Spack repo from github (we will checkout into ``${HOME}``): + +``cd ${HOME} && git clone https://github.com/LLNL/spack.git`` + +Step 3 +~~~~~~ + +Add Spack shell support to your ``.profile`` by adding the lines: + +:: + + export SPACK_ROOT=${HOME}/spack + . $SPACK_ROOT/share/spack/setup-env.sh + +Step 4 +~~~~~~ + +Copy the `https://raw.githubusercontent.com/OpenFAST/openfast/dev/share/spack/package.py`__ file +to your installation of Spack: + +:: + + mkdir ${SPACK_ROOT}/etc/spack/openfast ; cd ${SPACK_ROOT}/etc/spack/openfast + wget --no-check-certificate https://raw.githubusercontent.com/OpenFAST/openfast/dev/share/spack/package.py + +Step 5 +~~~~~~ + +Try ``spack info openfast`` to see if Spack works. If it does, check the +compilers you have available by: + +:: + + machine:~ user$ spack compilers + ==> Available compilers + -- gcc ---------------------------------------------------------- + gcc@6.3.0 gcc@4.2.1 + + -- clang -------------------------------------------------------- + clang@8.0.0-apple clang@7.3.0-apple + +Step 6 +~~~~~~ + +Install OpenFAST with whatever version of GCC (6.3.0 for us) you have +installed from Homebrew and force the build to use CMake 3.6.1 because +newer versions currently don't build on OS X: + +:: + + spack install openfast %gcc@6.3.0 + +To install OpenFAST with the C++ API, do: + +:: + + spack install openfast+cxx %gcc@6.3.0 + +That should be it! Spack will automatically use the most up-to-date dependencies +unless otherwise specified. For example to constrain OpenFAST to use some specific +versions of dependencies you could issue the Spack install command: + +:: + + spack install openfast %gcc@6.3.0 ^hdf5@1.8.16 + +The executables and libraries will be located at + +:: + + spack location -i openfast + + +Add the appropriate paths to your ``PATH`` and ``LD_LIBRARY_PATH`` to run OpenFAST. + +Building OpenFAST manually on Mac OS X or Linux +----------------------------------------------- + +A sample installation shell script is provided in the `share` folder. Run the script from `openfast_dir` as: + +:: + + git clone https://github.com/OpenFAST/OpenFAST.git + cd OpenFAST + bash share/install.sh diff --git a/glue-codes/fast-cpp/CMakeLists.txt b/glue-codes/fast-cpp/CMakeLists.txt index 16fec3a70e..4efbea8a7d 100644 --- a/glue-codes/fast-cpp/CMakeLists.txt +++ b/glue-codes/fast-cpp/CMakeLists.txt @@ -25,6 +25,7 @@ find_package(YAMLCPP REQUIRED) include_directories(${YAML_INCLUDES}) include_directories(${HDF5_INCLUDES}) +include_directories(${HDF5_INCLUDE_DIR}) include_directories(${ZLIB_INCLUDES}) include_directories(${LIBXML2_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/modules-local/fast-library/src/) diff --git a/share/doConfigOpenFAST_cpp_spack b/share/fast-build-cpp-spack.sh similarity index 100% rename from share/doConfigOpenFAST_cpp_spack rename to share/fast-build-cpp-spack.sh diff --git a/share/doConfigOpenFAST_cpp_nospack b/share/fast-build-cpp.sh similarity index 100% rename from share/doConfigOpenFAST_cpp_nospack rename to share/fast-build-cpp.sh diff --git a/share/doConfigOpenFAST_nospack b/share/fast-build.sh similarity index 100% rename from share/doConfigOpenFAST_nospack rename to share/fast-build.sh diff --git a/share/install_nospack.sh b/share/fast-install.sh similarity index 87% rename from share/install_nospack.sh rename to share/fast-install.sh index 9c99a9fe2b..8d32953a95 100755 --- a/share/install_nospack.sh +++ b/share/fast-install.sh @@ -13,8 +13,8 @@ prepInstall() { #Prepare for installation echo -n "Prepping install" echo -n $PWD > /tmp/fastDir - OPENFAST_DIR=$(sed 's:/:\\/:g' /tmp/fastDir) - echo "export OPENFAST_DIR=${OPENFAST_DIR}" > .prepInstall + openfast_dir=$(sed 's:/:\\/:g' /tmp/fastDir) + echo "export openfast_dir=${openfast_dir}" > .prepInstall source .prepInstall passFail $? } @@ -36,7 +36,7 @@ compileLapack() { make -j 8 &> log.make make install &> log.makeInstall passFail $? - cd ${OPENFAST_DIR} + cd ${openfast_dir} } compileYAMLcpp() { @@ -53,7 +53,7 @@ compileYAMLcpp() { fi passFail $? echo -n " Configuring" - cmake ../yaml-cpp/ -DCMAKE_INSTALL_PREFIX=${OPENFAST_DIR}/install &> log.cmake + cmake ../yaml-cpp/ -DCMAKE_INSTALL_PREFIX=${openfast_dir}/install &> log.cmake passFail $? echo -n " Compiling" make -j 8 &> log.make @@ -61,7 +61,7 @@ compileYAMLcpp() { echo -n " Installing" make install &> log.makeInstall passFail $? - cd ${OPENFAST_DIR} + cd ${openfast_dir} } compileHDF5() { @@ -76,7 +76,7 @@ compileHDF5() { cd hdf5-1.8.19 passFail $? echo -n " Configuring" - ./configure CC=mpicc FC=mpif90 CXX=mpicxx --enable-parallel --prefix=${OPENFAST_DIR}/install &> log.config + ./configure CC=mpicc FC=mpif90 CXX=mpicxx --enable-parallel --prefix=${openfast_dir}/install &> log.config passFail $? echo -n " Compiling" make -j 8 &> log.make @@ -84,7 +84,7 @@ compileHDF5() { echo -n " Installing" make install &> log.makeInstall passFail $? - cd ${OPENFAST_DIR} + cd ${openfast_dir} } compileOpenFAST() { @@ -96,10 +96,10 @@ compileOpenFAST() { # if [ -f CMakeCache.txt] ; then # rm CMakeCache.txt # fi - cp ${OPENFAST_DIR}/share/doConfigOpenFAST_cpp_nospack . + cp ${openfast_dir}/share/fast-build-cpp.sh . passFail $? echo -n " Configuring" - ./doConfigOpenFAST_cpp_nospack + ./fast-build-cpp.sh passFail $? echo -n " Compiling" make &> log.make @@ -107,7 +107,7 @@ compileOpenFAST() { echo -n " Installing" make install &> log.makeInstall passFail $? - cd ${OPENFAST_DIR} + cd ${openfast_dir} } prepInstall diff --git a/share/spack/package.py b/share/spack/package.py new file mode 100644 index 0000000000..f13af5283a --- /dev/null +++ b/share/spack/package.py @@ -0,0 +1,99 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Openfast(CMakePackage): + """NREL OpenFAST - Wind Turbine Simulation Package""" + + homepage = "http://openfast.readthedocs.io/en/latest/" + url = "https://github.com/OpenFAST/openfast.git" + + version('develop', + git='https://github.com/OpenFAST/openfast.git', + branch='dev') + version('master', + git='https://github.com/OpenFAST/openfast.git', + branch='master') + + variant('shared', default=False, + description="Build shared libraries") + variant('double-precision', default=True, + description="Treat REAL as double precision") + variant('dll-interface', default=True, + description="Enable dynamic library loading interface") + variant('cxx', default=True, + description="Enable C++ bindings") + variant('debug', default=False, + description="Enable debugging symbols with RelWithDebInfo") + + # Dependencies for OpenFAST Fortran + depends_on('blas') + depends_on('lapack') + + # Additional dependencies when compiling C++ library + depends_on('mpi', when='+cxx') + depends_on('yaml-cpp', when='+cxx') + depends_on('hdf5+mpi+cxx', when='+cxx') + depends_on('zlib', when='+cxx') + depends_on('libxml2', when='+cxx') + + # Disable parallel builds because of OpenFOAM Types modules dependencies + parallel = False + + def build_type(self): + if '+debug' in self.spec: + return 'RelWithDebInfo' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec + + options = [] + + options.extend([ + '-DBUILD_SHARED_LIBS:BOOL=%s' % ( + 'ON' if '+shared' in spec else 'OFF'), + '-DDOUBLE_PRECISION:BOOL=%s' % ( + 'ON' if '+double-precision' in spec else 'OFF'), + '-DUSE_DLL_INTERFACE:BOOL=%s' % ( + 'ON' if '+dll-interface' in spec else 'OFF'), + '-DBUILD_FAST_CPP_API:BOOL=%s' % ( + 'ON' if '+cxx' in spec else 'OFF'), + ]) + + if '+cxx' in spec: + options.extend([ + '-DHDF5_ROOT:PATH=%s' % spec['hdf5'].prefix, + '-DYAML_ROOT:PATH=%s' % spec['yaml-cpp'].prefix, + ]) + + if not '+shared' in spec: + options.extend([ + '-DHDF5_USE_STATIC_LIBRARIES=ON', + ]) + + return options From 6c50804fe589038b0d4c7190b2ee484ce958135c Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Tue, 8 Aug 2017 10:04:44 -0600 Subject: [PATCH 07/11] fix links and formatting --- docs/source/install_linux.rst | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index ff9177be5f..a918008103 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -1,7 +1,7 @@ Building OpenFAST ================= -OpenFAST uses the `cmake ` build system. We recommend installing OpenFAST using `spack `. However, we also provide some sample scripts in ``share`` folder if you choose to install without `spack`. +OpenFAST uses the `CMake `__ build system. We recommend installing OpenFAST using `spack `__. However, we also provide some sample scripts in ``share`` folder if you choose to install without `spack`. CMake Build Instructions ------------------------ @@ -18,24 +18,23 @@ CMake Build Instructions Current CMake Options ~~~~~~~~~~~~~~~~~~~~~ -- ``DOUBLE_PRECISION`` - Enable/disable ``-DDOUBLE_PRECISION`` flag - (Default: ON) -- ``USE_DLL_INTERFACE`` - Enable dynamic library loading capability - (Default: ON) -- ``CMAKE_BUILD_TYPE`` - Release, Debug builds (Default: Release) -- ``CMAKE_INSTALL_PREFIX`` - Set desired installation directory -- ``BUILD_SHARED_LIBS`` - Enable/disable building shared libraries - (Default: OFF) -- ``FPE_TRAP_ENABLED`` - Enable Floating Point Exception trap -- ``BUILD_CPP_API`` - Enable C++ API +- ``BUILD_DOCUMENTATION`` - Build documentation (Default: OFF) +- ``BUILD_FAST_CPP_API`` - Enable building FAST - C++ API (Default: OFF) +- ``BUILD_SHARED_LIBS`` - Enable building shared libraries (Default: OFF) +- ``CMAKE_BUILD_TYPE`` - Choose the build type: Debug Release (Default: Release) +- ``CMAKE_INSTALL_PREFIX`` - Install path prefix, prepended onto install directories. +- ``DOUBLE_PRECISION`` - Treat REAL as double precision (Default: ON) +- ``FPE_TRAP_ENABLED`` - Enable Floating Point Exception (FPE) trap in compiler options (Default: OFF) +- ``ORCA_DLL_LOAD`` - Enable OrcaFlex library load (Default: OFF) +- ``USE_DLL_INTERFACE`` - Enable runtime loading of dynamic libraries (Default: ON) Dependencies ~~~~~~~~~~~~ OpenFAST has the following dependencies: -- ``LAPACK`` libraries provided through the variable ``BLASLIB``, -- for the ``C++`` API, OpenFAST also depends on `HDF5 ` (provided by ``HDF5_ROOT``) and `yaml-cpp ` (provided by ``YAML_ROOT``). +- ``LAPACK`` libraries provided through the variable ``BLASLIB`` +- for the C++ API, `HDF5 `__ (provided by ``HDF5_ROOT``) and `yaml-cpp `__ (provided by ``YAML_ROOT``). From cec9f73c38cce4e789112d1e1f1aeb8ea723bc34 Mon Sep 17 00:00:00 2001 From: Ganesh Vijayakumar Date: Tue, 8 Aug 2017 11:03:01 -0600 Subject: [PATCH 08/11] Remove reference to MacOS 10.12 in the install instructions --- docs/source/install_linux.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index a918008103..6c41b3d9ad 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -51,11 +51,10 @@ Step 1 ~~~~~~ This assumes you have a Homebrew installation of GCC installed already -(we are using GCC 6.3.0). These instructions have been tested on OSX 10.11. MacOS 10.12 -will not build CMake with GCC anymore, so these instructions won't work -in that case, but we have built OpenFAST using Spack on MacOS Sierra by -using Homebrew to install ``cmake`` and ``pkg-config`` and defining these -as external packages in Spack (see +(we are using GCC 6.3.0). These instructions have been tested on OSX 10.11. +We have built OpenFAST using Spack on MacOS Sierra by using Homebrew to +install ``cmake`` and ``pkg-config`` and defining these as external +packages in Spack (see `packages.yaml.mac_sierra `__). Step 2 From a9f8f300b8f4c456ac0e0bddf2952f2410ec797b Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Tue, 8 Aug 2017 12:45:07 -0600 Subject: [PATCH 09/11] list dependencies before build instructions, keep cmake together --- docs/source/install_linux.rst | 42 ++++++++++++++--------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index 6c41b3d9ad..3eaaa95d02 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -1,11 +1,20 @@ Building OpenFAST ================= -OpenFAST uses the `CMake `__ build system. We recommend installing OpenFAST using `spack `__. However, we also provide some sample scripts in ``share`` folder if you choose to install without `spack`. +OpenFAST uses the `CMake `__ build system. +We recommend building OpenFAST using `Spack `__. +However, we also provide some sample scripts in ``openfast/share`` if you choose to proceed without `Spack`. + +Dependencies +------------ + +OpenFAST has the following dependencies: + +- LAPACK libraries provided through the variable ``BLASLIB`` +- for the C++ API, `HDF5 `__ (provided by ``HDF5_ROOT``) and `yaml-cpp `__ (provided by ``YAML_ROOT``). CMake Build Instructions ------------------------ - :: git clone https://github.com/OpenFAST/OpenFAST.git @@ -13,7 +22,13 @@ CMake Build Instructions mkdir build && cd build cmake ../ make + +A sample installation shell script is also provided in the ``openfast/share``. Run the script from ``openfast/`` as: +:: + git clone https://github.com/OpenFAST/OpenFAST.git + cd OpenFAST + bash share/install.sh Current CMake Options ~~~~~~~~~~~~~~~~~~~~~ @@ -28,17 +43,6 @@ Current CMake Options - ``ORCA_DLL_LOAD`` - Enable OrcaFlex library load (Default: OFF) - ``USE_DLL_INTERFACE`` - Enable runtime loading of dynamic libraries (Default: ON) -Dependencies -~~~~~~~~~~~~ - -OpenFAST has the following dependencies: - -- ``LAPACK`` libraries provided through the variable ``BLASLIB`` -- for the C++ API, `HDF5 `__ (provided by ``HDF5_ROOT``) and `yaml-cpp `__ (provided by ``YAML_ROOT``). - - - -Building OpenFAST Semi-Automatically Using Spack on Mac OS X or Linux --------------------------------------------------------------------- The following describes how to build OpenFAST and its dependencies @@ -134,15 +138,3 @@ The executables and libraries will be located at Add the appropriate paths to your ``PATH`` and ``LD_LIBRARY_PATH`` to run OpenFAST. - - -Building OpenFAST manually on Mac OS X or Linux ------------------------------------------------ - -A sample installation shell script is provided in the `share` folder. Run the script from `openfast_dir` as: - -:: - - git clone https://github.com/OpenFAST/OpenFAST.git - cd OpenFAST - bash share/install.sh From 6c3ed5585bb5a32af1228bd0654d8fa3b38df04b Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Tue, 8 Aug 2017 12:45:28 -0600 Subject: [PATCH 10/11] update spack instructions --- docs/source/install_linux.rst | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index 3eaaa95d02..370948593b 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -43,6 +43,7 @@ Current CMake Options - ``ORCA_DLL_LOAD`` - Enable OrcaFlex library load (Default: OFF) - ``USE_DLL_INTERFACE`` - Enable runtime loading of dynamic libraries (Default: ON) +Building OpenFAST Semi-Automatically Using Spack on macOS or Linux --------------------------------------------------------------------- The following describes how to build OpenFAST and its dependencies @@ -51,24 +52,20 @@ mostly automatically on your Mac using This can also be used as a template to build OpenFAST on any Linux system with Spack. -Step 1 -~~~~~~ +These instructions were developed on macOS 10.11 with the following tools installed via Homebrew: -This assumes you have a Homebrew installation of GCC installed already -(we are using GCC 6.3.0). These instructions have been tested on OSX 10.11. -We have built OpenFAST using Spack on MacOS Sierra by using Homebrew to -install ``cmake`` and ``pkg-config`` and defining these as external -packages in Spack (see -`packages.yaml.mac_sierra `__). +- GCC 6.3.0 +- CMake 3.6.1 +- pkg-config 0.29.2 -Step 2 +Step 1 ~~~~~~ Checkout the official Spack repo from github (we will checkout into ``${HOME}``): ``cd ${HOME} && git clone https://github.com/LLNL/spack.git`` -Step 3 +Step 2 ~~~~~~ Add Spack shell support to your ``.profile`` by adding the lines: @@ -78,7 +75,7 @@ Add Spack shell support to your ``.profile`` by adding the lines: export SPACK_ROOT=${HOME}/spack . $SPACK_ROOT/share/spack/setup-env.sh -Step 4 +Step 3 ~~~~~~ Copy the `https://raw.githubusercontent.com/OpenFAST/openfast/dev/share/spack/package.py`__ file @@ -89,7 +86,7 @@ to your installation of Spack: mkdir ${SPACK_ROOT}/etc/spack/openfast ; cd ${SPACK_ROOT}/etc/spack/openfast wget --no-check-certificate https://raw.githubusercontent.com/OpenFAST/openfast/dev/share/spack/package.py -Step 5 +Step 4 ~~~~~~ Try ``spack info openfast`` to see if Spack works. If it does, check the @@ -105,12 +102,10 @@ compilers you have available by: -- clang -------------------------------------------------------- clang@8.0.0-apple clang@7.3.0-apple -Step 6 +Step 5 ~~~~~~ -Install OpenFAST with whatever version of GCC (6.3.0 for us) you have -installed from Homebrew and force the build to use CMake 3.6.1 because -newer versions currently don't build on OS X: +Install OpenFAST with your chosen version of GCC: :: From 5f23c3169f639d99ae06c48e621dcb789fd214df Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Wed, 9 Aug 2017 09:43:11 -0600 Subject: [PATCH 11/11] add openfast to spack packages --- docs/source/install_linux.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/install_linux.rst b/docs/source/install_linux.rst index 370948593b..e9e45e4507 100644 --- a/docs/source/install_linux.rst +++ b/docs/source/install_linux.rst @@ -83,7 +83,8 @@ to your installation of Spack: :: - mkdir ${SPACK_ROOT}/etc/spack/openfast ; cd ${SPACK_ROOT}/etc/spack/openfast + mkdir ${SPACK_ROOT}/var/spack/repos/builtin/packages/openfast + cd ${SPACK_ROOT}/var/spack/repos/builtin/packages/openfast wget --no-check-certificate https://raw.githubusercontent.com/OpenFAST/openfast/dev/share/spack/package.py Step 4