Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 46 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ jobs:
cmake -DPYBIND11_TEST=FALSE ..
make -j${{ env.NARG }} install



- name: Linux Dependencies
if: startsWith(matrix.os, 'ubuntu') # Linux only
run: |
Expand All @@ -118,7 +116,6 @@ jobs:
cd ../..
pip install "pybind11[global]"


- name: Configure CMake
run: |
mkdir -p build
Expand All @@ -141,6 +138,14 @@ jobs:
cd build
Testing/RunTests

- name: Build CppRepo Example
env:
Nymph_ENABLE_TESTING: OFF
Nymph_TAG: nymph2_2/cppexample
run: |
cd Examples/CppRepo
./BUILD_ME.sh

build_python:
name: Build and Test Python

Expand Down Expand Up @@ -190,8 +195,6 @@ jobs:
cmake -DPYBIND11_TEST=FALSE ..
make -j${{ env.NARG }} install

python -m pip install build

- name: Linux Dependencies
if: startsWith(matrix.os, 'ubuntu') # Linux only
run: |
Expand All @@ -207,20 +210,48 @@ jobs:
cd build
sudo cmake -DPYBIND11_TEST=FALSE ..
sudo make -j${{ env.NARG }} install
cd ../..


pip install "pybind11[global]"

python -m pip install build

- name: Install nymph
- name: Build Nymph/Cpp
run: |
pip -v install .
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${Nymph_BUILD_TYPE} \
-DNymph_BUILD_NYMPH_EXE=${Nymph_BUILD_NYMPH_EXE} \
-DNymph_ENABLE_EXECUTABLES=${Nymph_ENABLE_EXECUTABLES} \
-DNymph_ENABLE_PYTHON=${Nymph_ENABLE_PYTHON} \
-DNymph_ENABLE_TESTING=${Nymph_ENABLE_TESTING} \
-DNymph_SINGLETHREADED=${Nymph_SINGLETHREADED} \
-DPBUILDER_PY_INSTALL_IN_SITELIB=TRUE \
..
make -j${{ env.NARG }} install

- name: Install Nymph/Python
run: |
env
pip -v install -e .

- name: Run Tests
continue-on-error: true
run: |
cd Testing/Python
cd Testing/Python/Bindings
python -m unittest discover -v

# eventually include these tests
# cd ../nymph
# python -m unittest discover -v

- name: Build PyRepo Example
env:
Nymph_ENABLE_TESTING: OFF
Nymph_ENABLE_PYTHON: ON
Nymph_TAG: nymph2_2/cppexample
run: |
cd Examples/PyRepo
./BUILD_ME.sh
hello-world


# For debugging
- name: Setup tmate session
if: ${{ ! success() }}
uses: mxschmitt/action-tmate@v3

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ build*/
# Python Package
dist*/
Python/*.egg-info
Examples/PyRepo/*.egg-info
__pycache__
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ set( PRIVATE_EXT_LIBS )
#######

# Boost (1.46 required for filesystem version 3)
list( APPEND BOOST_COMPONENTS chrono date_time filesystem system thread )
list( APPEND BOOST_COMPONENTS chrono date_time filesystem thread )
find_package( Boost 1.46.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
list( APPEND PUBLIC_EXT_LIBS Boost::boost Boost::chrono Boost::date_time Boost::thread Boost::filesystem )
# make sure dynamic linking is assumed for all boost libraries
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ COPY Testing /tmp_source/Testing
COPY CMakeLists.txt /tmp_source/CMakeLists.txt
COPY NymphConfig.cmake.in /tmp_source/NymphConfig.cmake.in
COPY pyproject.toml /tmp_source/pyproject.toml
COPY VERSION /tmp_source/VERSION
#COPY .git /tmp_source/.git

# repeat the cmake command to get the change of install prefix to set correctly (a package_builder known issue)
Expand Down
20 changes: 20 additions & 0 deletions Examples/CppRepo/BUILD_ME.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash

# This script builds the CppRepo example of a Nymph-based C++-only package.
# The CMake-based build downloads Nymph using CMake's FetchContent module,
# rather than including it as a submodule. Nymph is built using
# the Scarab/PackageBuilder framework included with Nymph.

mkdir build
cd build

cmake -DCMAKE_BUILD_TYPE=${Nymph_BUILD_TYPE:=Debug} \
-DNymph_BUILD_NYMPH_EXE=${Nymph_BUILD_NYMPH_EXE:=FALSE} \
-DNymph_ENABLE_EXECUTABLES=${Nymph_ENABLE_EXECUTABLES:=TRUE} \
-DNymph_ENABLE_PYTHON=${Nymph_ENABLE_PYTHON:=FALSE} \
-DNymph_ENABLE_TESTING=${Nymph_ENABLE_TESTING:=FALSE} \
-DNymph_SINGLETHREADED=${Nymph_SINGLETHREADED:=FALSE} \
-DNymph_TAG=${Nymph_TAG:=nymph2_2/develop} \
..

make -j${NARG:=} install
91 changes: 91 additions & 0 deletions Examples/CppRepo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Minimum cmake verison 3.12 required for Scarab
cmake_minimum_required (VERSION 3.12)

# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
project( CppRepo VERSION 0.0.0 )

include( FetchContent )
# Get Nymph with FetchContent
# If Nymph is a submodule, then set the SOURCE_DIR option to point to it; also in that case, remove any download specifications
message( STATUS "Getting Nymph" )
option( Nymph_TAG "Version of Nymph to use" nymph2_2/develop )
message( "$$$$$$ tag: ${Nymph_TAG}" )
set( Nymph_DIR nymph_src )
FetchContent_Populate( nymph
SOURCE_DIR ${Nymph_DIR}
GIT_REPOSITORY https://github.com/project8/nymph
GIT_TAG ${Nymph_TAG}
GIT_SHALLOW TRUE
)

# If nymph were a submodule in ${PROJECT_SOURCE_DIR}/nymph, that would be used in place of ${Nymph_DIR}
list( APPEND CMAKE_MODULE_PATH
${CMAKE_BINARY_DIR}/${Nymph_DIR}/Scarab/cmake
${CMAKE_BINARY_DIR}/${Nymph_DIR}/cmake
)
include( PackageBuilder )
include( Nymph )

#########
# flags #
#########

set( CMAKE_CXX_STANDARD 17 )


################
# dependencies #
################

set( PUBLIC_EXT_LIBS )
set( PRIVATE_EXT_LIBS )




#####################
# prepare for build #
#####################

pbuilder_prepare_project()


##############
# submodules #
##############

# Nymph
pbuilder_add_submodule( Nymph ${CMAKE_BINARY_DIR}/${Nymph_DIR} )

pbuilder_use_sm_library( Nymph Nymph )

#####################
# build the project #
#####################

# add include directories
include_directories( BEFORE
Library/Processors
Library/Data
)

# build this project
add_subdirectory( Library )

if( tettigoniidae_ENABLE_EXECUTABLES )
#add_subdirectory( Executables )
endif()

if( tettigoniidae_ENABLE_TESTING )
#add_subdirectory( Testing )
endif()


##################
# package config #
##################

#configure_file( ${PROJECT_SOURCE_DIR}/tettigoniidaeConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tettigoniidaeConfig.cmake @ONLY )

#pbuilder_do_package_config()
5 changes: 5 additions & 0 deletions Examples/CppRepo/Library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CMakeLists for nymph/Examples/CppRepo/Library
# Author: N.S. Oblath

add_subdirectory( Data )
add_subdirectory( Processors )
32 changes: 32 additions & 0 deletions Examples/CppRepo/Library/Data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CMakeLists for nymph/Examples/CppRepo/Library/Data
# Author: N.S. Oblath

include_directories( BEFORE
${CMAKE_CURRENT_SOURCE_DIR}
)

set( CppRepoData_HEADERFILES
DoubleData.hh
IntData.hh
)

set( CppRepoData_SOURCEFILES
DoubleData.cc
IntData.cc
)


##################################################

pbuilder_library(
TARGET CppRepoData
SOURCES ${CppRepoData_SOURCEFILES}
PUBLIC_EXTERNAL_LIBRARIES ${PUBLIC_EXT_LIBS}
)

pbuilder_component_install_and_export(
COMPONENT Library
LIBTARGETS CppRepoData
)

pbuilder_install_headers( ${CppRepoData_HEADERFILES} )
14 changes: 14 additions & 0 deletions Examples/CppRepo/Library/Data/DoubleData.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include "DoubleData.hh"

namespace tettigoniidae
{
DoubleData::DoubleData() :
Nymph::Data(),
fDValue1( 0. ),
fDValue2( 10. )
{}

DoubleData::~DoubleData()
{}
}
31 changes: 31 additions & 0 deletions Examples/CppRepo/Library/Data/DoubleData.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* TestData2.hh
*
* Created on: Jan 6, 2022
* Author: N.S. Oblath
*/

#ifndef TTGD_TESTING_TESTDATA2
#define TTGD_TESTING_TESTDATA2

#include "Data.hh"
#include "MemberVariable.hh"

namespace tettigoniidae
{

class DoubleData : public Nymph::Data
{
public:
DoubleData();

virtual ~DoubleData();

MEMVAR( double, DValue1 );
MEMVAR( double, DValue2 );
};


} /* namespace tettigoniidae */

#endif /* TTGD_TESTING_TESTDATA2 */
14 changes: 14 additions & 0 deletions Examples/CppRepo/Library/Data/IntData.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include "IntData.hh"

namespace tettigoniidae
{
IntData::IntData() :
Nymph::Data(),
fIValue1( 0 ),
fIValue2( 5 )
{}

IntData::~IntData()
{}
}
35 changes: 35 additions & 0 deletions Examples/CppRepo/Library/Data/IntData.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* IntData.hh
*
* Created on: Jan 6, 2022
* Author: N.S. Oblath
*/

#ifndef TTGD_DATA_INTDATA
#define TTGD_DATA_INTDATA

#include "Data.hh"
#include "MemberVariable.hh"

namespace tettigoniidae
{

/*!
@class IntData
@author N. S. Oblath
@brief Two integer values
*/
class IntData : public Nymph::Data
{
public:
IntData();

virtual ~IntData();

MEMVAR( int, IValue1 );
MEMVAR( int, IValue2 );
};

} /* namespace tettigoniidae */

#endif /* TTGD_DATA_INTDATA */
Loading