Skip to content

Commit

Permalink
CMake build for ip2 (#5)
Browse files Browse the repository at this point in the history
CMake build for ip2 along with changes to repo layout
  • Loading branch information
kgerheiser authored Jul 8, 2020
1 parent 3eb7f4b commit 4aa6b67
Show file tree
Hide file tree
Showing 277 changed files with 638 additions and 719 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build and Test
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
env:
FC: gfortran-9
CC: gcc-9

steps:

- name: checkout-pfunit
uses: actions/checkout@v2
with:
repository: Goddard-Fortran-Ecosystem/pFUnit
path: pfunit

- name: cache-pfunit
id: cache-pfunit
uses: actions/cache@v2
with:
path: ~/pfunit
key: pfunit-${{ runner.os }}-${{ hashFiles('pfunit/VERSION') }}

- name: build-pfunit
if: steps.cache-pfunit.outputs.cache-hit != 'true'
run: |
cd pfunit
mkdir build
cd build
cmake .. -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit
make -j2
make install
- name: checkout-sp
uses: actions/checkout@v2
with:
repository: NOAA-EMC/NCEPLIBS-sp
path: sp
ref: develop

- name: build-sp
run: |
cd sp
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/sp
make -j2
make install
- name: checkout
uses: actions/checkout@v2
with:
path: ip2
submodules: true

- name: build
run: |
cd ip2
mkdir build
cd build
cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit;~/"
make -j2
- name: test
run: |
cd $GITHUB_WORKSPACE/ip2/build
make test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/
install/

*.[ao]
*.mod
*.so
*DS_Store

*.swp
35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.15)

file(STRINGS "VERSION" pVersion)

project(
ip2
VERSION ${pVersion}
LANGUAGES Fortran)

option(OPENMP "use OpenMP threading" OFF)
option(ENABLE_TESTS "Build pfunit tests?" OFF)

if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU)$")
message(WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}")
endif()

if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

find_package(sp REQUIRED)

add_subdirectory(src)

if (ENABLE_TESTS)
find_package(PFUNIT REQUIRED)
enable_testing()
add_subdirectory(tests)
endif()
49 changes: 0 additions & 49 deletions Conf/Analyse_args.sh

This file was deleted.

107 changes: 0 additions & 107 deletions Conf/Collect_info.sh

This file was deleted.

91 changes: 0 additions & 91 deletions Conf/Gen_cfunction.sh

This file was deleted.

Loading

0 comments on commit 4aa6b67

Please sign in to comment.