Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang build support #132

Merged
merged 25 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
43bff70
fixes #83 - code updates to support clang compilation / cleaned up so…
robambalu Mar 3, 2024
1cf02a7
fixes #83 - merged main
robambalu Mar 15, 2024
2ecd364
fixes #132 - last checkpoint, code should be good, build needs some work
robambalu Mar 18, 2024
7170f72
fixes #132 - final touches, all tests pass. Note this had to comment…
robambalu Mar 18, 2024
3137e13
fixes #132 - attempt to kick off macos build
robambalu Mar 18, 2024
1217e14
unset CC in mac cibuildwheel setup
ngoldbaum Mar 19, 2024
795dce7
Add support for mac conda builds
ngoldbaum Mar 19, 2024
6bdee37
Update docs for mac builds
ngoldbaum Mar 19, 2024
c2d9f38
attempt to fix macos-12 conda build
ngoldbaum Mar 19, 2024
07ce7cb
one more try for intel mac support
ngoldbaum Mar 19, 2024
69e05fd
reduce length of timeout for test_threaded_run
ngoldbaum Mar 19, 2024
7bd2aca
make this test more meaningful now that it has a shorter timeout
ngoldbaum Mar 19, 2024
9d0c75b
CMakeLists.txt - attempt tp align RPATH on linux, drop ../lib
robambalu Mar 21, 2024
cbf58e3
fixes #132 - merge main / fix conflicts
robambalu Mar 25, 2024
4211e06
#132 temporarily add some debug logging to threaded engine to try to …
robambalu Mar 25, 2024
c755181
#132 fix lint for test logging
robambalu Mar 26, 2024
e0aa7ed
#132 enable stdout logging for tests, revert test_engine back to old …
robambalu Mar 26, 2024
92320ea
#132 - next atempt
robambalu Mar 26, 2024
f33e8cc
#132 - next attempt
robambalu Mar 26, 2024
d87deda
#132 - next attempt
robambalu Mar 26, 2024
1014537
fixes #132 - Fix race condition exposed in macos build where push eve…
robambalu Mar 27, 2024
6f8b9fa
fixes #132 - undo intrusive LFQueue changes ( for now ), simplify the…
robambalu Mar 27, 2024
232f71f
fixes #132 - fix comment typo
robambalu Mar 27, 2024
baae54b
clean up ci/cd code and ensure mac tests run
timkpaine Mar 27, 2024
26b3ab1
Merge pull request #168 from Point72/tkp/clang_support_plus_tests
timkpaine Mar 27, 2024
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
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ else()
-Wall \
-Wno-deprecated-declarations \
-Wno-deprecated \
-Wno-maybe-uninitialized \
")
add_definitions(-DNDEBUG)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-Wno-maybe-uninitialized \
")
endif()
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/adapters/parquet/ArrowSingleColumnArrayBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class PrimitiveTypedArrayBuilder : public BaseTypedArrayBuilder<ValueType, Arrow
protected:
void pushValueToArray()
{
this -> m_builderPtr -> Append( *this -> m_value );
[[maybe_unused]] auto status = this -> m_builderPtr -> Append( *this -> m_value );
}
};

Expand Down
2 changes: 2 additions & 0 deletions cpp/csp/adapters/parquet/ParquetOutputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ParquetOutputHandler
{
}

virtual ~ParquetOutputHandler() {}

uint32_t getChunkSize() const;

virtual uint32_t getNumColumns() = 0;
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/adapters/parquet/ParquetReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class SingleTableParquetReader : public ParquetReader
const std::optional<utils::Symbol> &symbol, const DialectGenericListReaderInterface::Ptr &listReaderInterface ) override
{
ParquetReader::addListSubscriber( column, inputAdapter, symbol, listReaderInterface);
m_columnSubscriptionContainer.m_listColumnSubscriptions[column].push_back(ListColumnSubscriberInfo{inputAdapter, symbol, listReaderInterface});
m_columnSubscriptionContainer.m_listColumnSubscriptions[column].push_back(ListColumnSubscriberInfo{{inputAdapter, symbol}, listReaderInterface});
}

protected:
Expand Down
5 changes: 2 additions & 3 deletions cpp/csp/adapters/parquet/ParquetReaderColumnAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class MissingColumnAdapter : public ParquetColumnAdapter

bool isMissingColumn() const override{ return true; }

virtual CspTypePtr getNativeCspType() const
virtual CspTypePtr getNativeCspType() const override
{
CSP_THROW( csp::RuntimeException, "Trying to get native type of a missing column " << getColumnName() );
}
Expand Down Expand Up @@ -190,8 +190,7 @@ template< typename ValueType, typename ArrowArrayType >
class NativeTypeColumnAdapter : public BaseTypedColumnAdapter<ValueType, ArrowArrayType>
{
public:
using BASE = BaseTypedColumnAdapter<ValueType, ArrowArrayType>;
using BASE::BaseTypedColumnAdapter;
using BaseTypedColumnAdapter<ValueType, ArrowArrayType>::BaseTypedColumnAdapter;
virtual CspTypePtr getNativeCspType() const override {return CspType::fromCType<ValueType>::type();}

protected:
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/adapters/utils/JSONMessageWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class JSONMessageWriter : public MessageWriter
}

private:
void processTickImpl( const OutputDataMapper & dataMapper, const TimeSeriesProvider * sourcets )
void processTickImpl( const OutputDataMapper & dataMapper, const TimeSeriesProvider * sourcets ) override
{
dataMapper.apply( *this, sourcets );
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/cppnodes/statsimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ class Quantile
int ft = floor( target );
int ct = ceil( target );

double qtl;
double qtl = 0.0;
#ifndef __clang__
switch ( m_interpolation )
{
Expand Down
8 changes: 4 additions & 4 deletions cpp/csp/engine/CppNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ class CppNode : public csp::Node
using InputWrapper::InputWrapper;

operator const T &() { return lastValue(); }
const T & lastValue() const { return ts() -> lastValueTyped<T>(); }
const T & lastValue() const { return ts() -> template lastValueTyped<T>(); }

const T & valueAtIndex( int32_t index ) const { return ts() -> valueAtIndex<T>( index ); }
const T & valueAtIndex( int32_t index ) const { return ts() -> template valueAtIndex<T>( index ); }
};

template<typename ElemWrapperT>
Expand Down Expand Up @@ -379,7 +379,7 @@ class CppNode : public csp::Node

T & reserveSpace()
{
return ts() -> reserveTickTyped<T>( m_node.cycleCount(), m_node.now() );
return ts() -> template reserveTickTyped<T>( m_node.cycleCount(), m_node.now() );
}
};

Expand Down Expand Up @@ -644,7 +644,7 @@ struct csp::CppNode::AlarmTypeHelper<csp::CppNode::Generic>
}

#define INIT_CPPNODE_WITH_NAME( Class, Name ) \
CSP csp; \
[[maybe_unused]] CSP csp; \
public: \
const char * name() const override { return #Name; } \
_STATIC_CREATE_METHOD( Class ) \
Expand Down
85 changes: 44 additions & 41 deletions cpp/csp/engine/CspType.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,47 +169,50 @@ class CspArrayType : public CspType
CspTypePtr m_elemType;
};

template<> struct CspType::Type::fromCType<std::_Bit_reference> { static constexpr CspType::Type type = CspType::Type::BOOL; };
template<> struct CspType::Type::fromCType<bool> { static constexpr CspType::Type type = CspType::Type::BOOL; };
template<> struct CspType::Type::fromCType<int8_t> { static constexpr CspType::Type type = CspType::Type::INT8; };
template<> struct CspType::Type::fromCType<uint8_t> { static constexpr CspType::Type type = CspType::Type::UINT8; };
template<> struct CspType::Type::fromCType<int16_t> { static constexpr CspType::Type type = CspType::Type::INT16; };
template<> struct CspType::Type::fromCType<uint16_t> { static constexpr CspType::Type type = CspType::Type::UINT16; };
template<> struct CspType::Type::fromCType<int32_t> { static constexpr CspType::Type type = CspType::Type::INT32; };
template<> struct CspType::Type::fromCType<uint32_t> { static constexpr CspType::Type type = CspType::Type::UINT32; };
template<> struct CspType::Type::fromCType<int64_t> { static constexpr CspType::Type type = CspType::Type::INT64; };
template<> struct CspType::Type::fromCType<uint64_t> { static constexpr CspType::Type type = CspType::Type::UINT64; };
template<> struct CspType::Type::fromCType<double> { static constexpr CspType::Type type = CspType::Type::DOUBLE; };
template<> struct CspType::Type::fromCType<DateTime> { static constexpr CspType::Type type = CspType::Type::DATETIME; };
template<> struct CspType::Type::fromCType<TimeDelta> { static constexpr CspType::Type type = CspType::Type::TIMEDELTA; };
template<> struct CspType::Type::fromCType<Date> { static constexpr CspType::Type type = CspType::Type::DATE; };
template<> struct CspType::Type::fromCType<Time> { static constexpr CspType::Type type = CspType::Type::TIME; };
template<> struct CspType::Type::fromCType<CspEnum> { static constexpr CspType::Type type = CspType::Type::ENUM; };
template<> struct CspType::Type::fromCType<CspType::StringCType> { static constexpr CspType::Type type = CspType::Type::STRING; };
template<> struct CspType::Type::fromCType<StructPtr> { static constexpr CspType::Type type = CspType::Type::STRUCT; };
template<typename T> struct CspType::Type::fromCType<TypedStructPtr<T>> { static constexpr CspType::Type type = CspType::Type::STRUCT; };
template<> struct CspType::Type::fromCType<DialectGenericType> { static constexpr CspType::Type type = CspType::Type::DIALECT_GENERIC; };
template<typename T> struct CspType::Type::fromCType<std::vector<T>> { static constexpr CspType::Type type = CspType::Type::ARRAY; };

template<> struct CspType::Type::toCType<CspType::Type::BOOL,void> { using type = bool; };
template<> struct CspType::Type::toCType<CspType::Type::INT8,void> { using type = int8_t; };
template<> struct CspType::Type::toCType<CspType::Type::UINT8,void> { using type = uint8_t; };
template<> struct CspType::Type::toCType<CspType::Type::INT16,void> { using type = int16_t; };
template<> struct CspType::Type::toCType<CspType::Type::UINT16,void> { using type = uint16_t; };
template<> struct CspType::Type::toCType<CspType::Type::INT32,void> { using type = int32_t; };
template<> struct CspType::Type::toCType<CspType::Type::UINT32,void> { using type = uint32_t; };
template<> struct CspType::Type::toCType<CspType::Type::INT64,void> { using type = int64_t; };
template<> struct CspType::Type::toCType<CspType::Type::UINT64,void> { using type = uint64_t; };
template<> struct CspType::Type::toCType<CspType::Type::DOUBLE,void> { using type = double; };
template<> struct CspType::Type::toCType<CspType::Type::DATETIME,void> { using type = DateTime; };
template<> struct CspType::Type::toCType<CspType::Type::TIMEDELTA,void> { using type = TimeDelta; };
template<> struct CspType::Type::toCType<CspType::Type::DATE,void> { using type = Date; };
template<> struct CspType::Type::toCType<CspType::Type::TIME,void> { using type = Time; };
template<> struct CspType::Type::toCType<CspType::Type::ENUM,void> { using type = CspEnum; };
template<> struct CspType::Type::toCType<CspType::Type::STRING,void> { using type = CspType::StringCType; };
template<> struct CspType::Type::toCType<CspType::Type::STRUCT,void> { using type = StructPtr; };
template<> struct CspType::Type::toCType<CspType::Type::DIALECT_GENERIC,void> { using type = DialectGenericType; };
template<typename T> struct CspType::Type::toCType<CspType::Type::ARRAY,T> { using type = std::vector<T>; };
#ifndef __clang__
template<> struct CspType::Type::fromCType<std::_Bit_reference> { static constexpr CspType::Type type = CspType::Type::BOOL; };
#endif

template<> struct CspType::TypeTraits::fromCType<bool> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::BOOL; };
template<> struct CspType::TypeTraits::fromCType<int8_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::INT8; };
template<> struct CspType::TypeTraits::fromCType<uint8_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::UINT8; };
template<> struct CspType::TypeTraits::fromCType<int16_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::INT16; };
template<> struct CspType::TypeTraits::fromCType<uint16_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::UINT16; };
template<> struct CspType::TypeTraits::fromCType<int32_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::INT32; };
template<> struct CspType::TypeTraits::fromCType<uint32_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::UINT32; };
template<> struct CspType::TypeTraits::fromCType<int64_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::INT64; };
template<> struct CspType::TypeTraits::fromCType<uint64_t> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::UINT64; };
template<> struct CspType::TypeTraits::fromCType<double> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::DOUBLE; };
template<> struct CspType::TypeTraits::fromCType<DateTime> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::DATETIME; };
template<> struct CspType::TypeTraits::fromCType<TimeDelta> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::TIMEDELTA; };
template<> struct CspType::TypeTraits::fromCType<Date> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::DATE; };
template<> struct CspType::TypeTraits::fromCType<Time> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::TIME; };
template<> struct CspType::TypeTraits::fromCType<CspEnum> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::ENUM; };
template<> struct CspType::TypeTraits::fromCType<CspType::StringCType> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::STRING; };
template<> struct CspType::TypeTraits::fromCType<StructPtr> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::STRUCT; };
template<typename T> struct CspType::TypeTraits::fromCType<TypedStructPtr<T>> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::STRUCT; };
template<> struct CspType::TypeTraits::fromCType<DialectGenericType> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::DIALECT_GENERIC; };
template<typename T> struct CspType::TypeTraits::fromCType<std::vector<T>> { static constexpr CspType::TypeTraits::_enum type = CspType::TypeTraits::ARRAY; };

template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::BOOL,void> { using type = bool; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::INT8,void> { using type = int8_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::UINT8,void> { using type = uint8_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::INT16,void> { using type = int16_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::UINT16,void> { using type = uint16_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::INT32,void> { using type = int32_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::UINT32,void> { using type = uint32_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::INT64,void> { using type = int64_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::UINT64,void> { using type = uint64_t; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::DOUBLE,void> { using type = double; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::DATETIME,void> { using type = DateTime; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::TIMEDELTA,void> { using type = TimeDelta; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::DATE,void> { using type = Date; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::TIME,void> { using type = Time; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::ENUM,void> { using type = CspEnum; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::STRING,void> { using type = CspType::StringCType; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::STRUCT,void> { using type = StructPtr; };
template<> struct CspType::TypeTraits::toCType<CspType::TypeTraits::DIALECT_GENERIC,void> { using type = DialectGenericType; };
template<typename T> struct CspType::TypeTraits::toCType<CspType::TypeTraits::ARRAY,T> { using type = std::vector<T>; };

template<> struct CspType::fromCType<bool> { static CspTypePtr & type() { return CspType::BOOL(); } };
template<> struct CspType::fromCType<int8_t> { static CspTypePtr & type() { return CspType::INT8(); } };
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/DynamicEngine.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _IN_CSP_ENGINE_DYNAMICENGINE_H
#define _IN_CSP_ENGINE_DUNAMICENGINE_H
#define _IN_CSP_ENGINE_DYNAMICENGINE_H

#include <csp/engine/Engine.h>
#include <csp/engine/OutputAdapter.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/Feedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ inline FeedbackOutputAdapter<T>::FeedbackOutputAdapter( csp::Engine * engine,
template<typename T>
inline void FeedbackOutputAdapter<T>::executeImpl()
{
m_boundInput -> pushTick( input() -> lastValueTyped<T>() );
m_boundInput -> pushTick( input() -> template lastValueTyped<T>() );
}

}
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/PendingPushEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace csp
{

class PushGroup;
struct PushGroup;
class PushInputAdapters;

class PendingPushEvents
Expand Down
1 change: 1 addition & 0 deletions cpp/csp/engine/RootEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Dictionary;
class EndCycleListener
{
public:
virtual ~EndCycleListener() {};
virtual void onEndCycle() = 0;

bool isDirty() const { return m_dirty; }
Expand Down
6 changes: 3 additions & 3 deletions cpp/csp/engine/Struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,17 @@ class StringStructField final : public NonNativeStructField
setIsSet( s );
}

virtual void copyFrom( const Struct * src, Struct * dest ) const
virtual void copyFrom( const Struct * src, Struct * dest ) const override
{
value( dest ) = value( src );
}

virtual bool isEqual( const Struct * x, const Struct * y ) const
virtual bool isEqual( const Struct * x, const Struct * y ) const override
{
return value( x ) == value( y );
}

virtual size_t hash( const Struct * x ) const
virtual size_t hash( const Struct * x ) const override
{
return std::hash<CType>()( value( x ) );
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/python/InitHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ inline InitHelper::InitCallback InitHelper::moduleMethodsCallback( PyMethodDef *

inline InitHelper::InitCallback InitHelper::moduleMethod( const char * name, PyCFunction func, int flags, const char * doc )
{
PyMethodDef defs[2]{ { name, func, flags, doc }, nullptr };
PyMethodDef defs[2]{ { name, func, flags, doc }, { nullptr } };

//Note that we rely on the lambda closure to keep the lifetime of defs which is kept by ptr
//m_callbacks will keep the InitCallback around for the life of the program
Expand Down
4 changes: 2 additions & 2 deletions cpp/csp/python/PyCspType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ static_assert( alignof( csp::DialectGenericType ) == alignof( csp::python::PyObj
namespace csp
{
template<>
struct CspType::Type::fromCType<csp::python::PyObjectPtr>
struct CspType::TypeTraits::fromCType<csp::python::PyObjectPtr>
{
static constexpr csp::CspType::Type type = csp::CspType::Type::DIALECT_GENERIC;
static constexpr csp::CspType::TypeTraits::_enum type = csp::CspType::TypeTraits::DIALECT_GENERIC;
};

}
Expand Down
Loading