Skip to content

Commit 6037cc5

Browse files
committed
only xmake, no cmake anymore
1 parent 67526fa commit 6037cc5

20 files changed

+659
-321
lines changed

CMakeLists.txt

Lines changed: 0 additions & 113 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,9 @@ int main() {
269269
270270
### Prerequisites
271271
- C++20 compatible compiler (GCC 10+, Clang 12+, MSVC 2019+)
272-
- CMake 3.20+ (recommended) or xmake
272+
- xmake build system
273273
274-
### Modern CMake Build (Recommended)
275-
```bash
276-
cd diffeq
277-
mkdir build && cd build
278-
cmake .. -DCMAKE_BUILD_TYPE=Release
279-
make -j$(nproc)
280-
ctest # Run tests
281-
```
282-
283-
### Legacy xmake Build
274+
### xmake Build
284275
```bash
285276
cd diffeq
286277
xmake # Build all examples and tests
@@ -293,9 +284,9 @@ Since the library is header-only, you can also simply:
293284
#include "path/to/diffeq/include/diffeq.hpp"
294285
```
295286

296-
Or with CMake:
297-
```cmake
298-
find_package(diffeq REQUIRED)
287+
Or with xmake:
288+
```lua
289+
add_requires("diffeq")
299290
target_link_libraries(your_target diffeq::diffeq)
300291
```
301292

docs/STANDARD_PARALLELISM.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -657,34 +657,34 @@ public:
657657

658658
## Building and Dependencies
659659

660-
### CMake Integration
661-
```cmake
662-
# For std::execution
663-
target_compile_features(your_target PRIVATE cxx_std_17)
664-
665-
# For OpenMP
666-
find_package(OpenMP REQUIRED)
667-
target_link_libraries(your_target OpenMP::OpenMP_CXX)
668-
669-
# For Intel TBB
670-
find_package(TBB REQUIRED)
671-
target_link_libraries(your_target TBB::tbb)
672-
673-
# For NVIDIA Thrust (comes with CUDA)
674-
find_package(CUDA REQUIRED)
675-
target_link_libraries(your_target ${CUDA_LIBRARIES})
676-
677-
# For direct CUDA kernel usage
678-
enable_language(CUDA)
679-
set_property(TARGET your_target PROPERTY CUDA_SEPARABLE_COMPILATION ON)
680-
681-
# For OpenCL
682-
find_package(OpenCL REQUIRED)
683-
target_link_libraries(your_target OpenCL::OpenCL)
684-
685-
# For MPI (distributed computing)
686-
find_package(MPI REQUIRED)
687-
target_link_libraries(your_target MPI::MPI_CXX)
660+
### xmake Integration
661+
```lua
662+
-- For std::execution
663+
set_languages("c++17")
664+
665+
-- For OpenMP
666+
add_requires("openmp")
667+
target_link_libraries(your_target openmp)
668+
669+
-- For Intel TBB
670+
add_requires("tbb")
671+
target_link_libraries(your_target tbb)
672+
673+
-- For NVIDIA Thrust (comes with CUDA)
674+
add_requires("cuda")
675+
target_link_libraries(your_target cuda)
676+
677+
-- For direct CUDA kernel usage
678+
set_languages("cuda")
679+
set_policy("build.cuda.devlink", true)
680+
681+
-- For OpenCL
682+
add_requires("opencl")
683+
target_link_libraries(your_target opencl)
684+
685+
-- For MPI (distributed computing)
686+
add_requires("mpi")
687+
target_link_libraries(your_target mpi)
688688
```
689689

690690
## Summary: Choosing the Right Approach

examples/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,14 @@ This directory contains comprehensive examples demonstrating how to use the diff
5454
### Prerequisites
5555

5656
- C++17 or later compiler
57-
- CMake or xmake build system
57+
- xmake build system
5858
- Optional: OpenMP, Intel TBB, CUDA for advanced parallelism examples
5959

6060
### Building
6161

6262
```bash
63-
# Using xmake (recommended)
63+
# Using xmake
6464
xmake
65-
66-
# Or using CMake
67-
mkdir build && cd build
68-
cmake ..
69-
make
7065
```
7166

7267
### Running Examples

examples/interface_usage_demo.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <chrono>
88
#include <iostream>
99

10-
namespace diffeq::examples {
11-
1210
/**
1311
* @brief Example usage patterns for the general integration interface
1412
*
@@ -21,12 +19,12 @@ namespace diffeq::examples {
2119
*/
2220
template<system_state StateType>
2321
auto create_portfolio_interface() {
24-
auto interface = interfaces::make_integration_interface<StateType>();
22+
auto interface = diffeq::interfaces::make_integration_interface<StateType>();
2523

2624
// Example: Market data signal causes continuous trajectory shift
2725
interface->template register_signal_influence<double>(
2826
"price_update",
29-
interfaces::IntegrationInterface<StateType>::InfluenceMode::CONTINUOUS_SHIFT,
27+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::CONTINUOUS_SHIFT,
3028
[](const double& new_price, StateType& state, auto t) {
3129
// Modify portfolio dynamics based on price update
3230
if (state.size() >= 3) {
@@ -42,7 +40,7 @@ auto create_portfolio_interface() {
4240
// Example: Risk alert causes discrete state modification
4341
interface->template register_signal_influence<std::string>(
4442
"risk_alert",
45-
interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
43+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
4644
[](const std::string& alert_type, StateType& state, auto t) {
4745
if (alert_type == "high_volatility" && state.size() >= 3) {
4846
// Reduce all positions by 10%
@@ -76,12 +74,12 @@ auto create_portfolio_interface() {
7674
*/
7775
template<system_state StateType>
7876
auto create_robotics_interface() {
79-
auto interface = interfaces::make_integration_interface<StateType>();
77+
auto interface = diffeq::interfaces::make_integration_interface<StateType>();
8078

8179
// Example: Control command causes discrete position target update
8280
interface->template register_signal_influence<std::vector<double>>(
8381
"control_command",
84-
interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
82+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
8583
[](const std::vector<double>& targets, StateType& state, auto t) {
8684
// Update target positions (assuming state has position targets)
8785
size_t n_joints = std::min(targets.size(), state.size() / 3);
@@ -98,7 +96,7 @@ auto create_robotics_interface() {
9896
// Example: Emergency stop signal
9997
interface->template register_signal_influence<bool>(
10098
"emergency_stop",
101-
interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
99+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::DISCRETE_EVENT,
102100
[](const bool& stop, StateType& state, auto t) {
103101
if (stop) {
104102
// Set all velocities to zero
@@ -136,12 +134,12 @@ auto create_robotics_interface() {
136134
*/
137135
template<system_state StateType>
138136
auto create_scientific_interface() {
139-
auto interface = interfaces::make_integration_interface<StateType>();
137+
auto interface = diffeq::interfaces::make_integration_interface<StateType>();
140138

141139
// Example: Parameter update from external optimization
142140
interface->template register_signal_influence<double>(
143141
"parameter_update",
144-
interfaces::IntegrationInterface<StateType>::InfluenceMode::PARAMETER_UPDATE,
142+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::PARAMETER_UPDATE,
145143
[](const double& new_param, StateType& state, auto t) {
146144
// Update system parameters affecting dynamics
147145
// This could modify integration tolerances, system constants, etc.
@@ -151,7 +149,7 @@ auto create_scientific_interface() {
151149
// Example: Data logging triggered by external events
152150
interface->template register_signal_influence<std::string>(
153151
"log_trigger",
154-
interfaces::IntegrationInterface<StateType>::InfluenceMode::OUTPUT_TRIGGER,
152+
diffeq::interfaces::IntegrationInterface<StateType>::InfluenceMode::OUTPUT_TRIGGER,
155153
[](const std::string& log_type, StateType& state, auto t) {
156154
// This will trigger all output streams immediately
157155
}
@@ -221,19 +219,17 @@ void demonstrate_usage(StateType initial_state) {
221219
std::cout << "Integration completed successfully!" << std::endl;
222220
}
223221

224-
} // namespace diffeq::examples
225-
226222
int main() {
227223
std::cout << "=== diffeq Integration Interface Examples ===" << std::endl;
228224

229225
// Example with vector state
230226
std::vector<double> initial_portfolio = {1000.0, 2000.0, 1500.0};
231-
diffeq::examples::demonstrate_usage(initial_portfolio);
227+
demonstrate_usage(initial_portfolio);
232228

233229
std::cout << "\n=== Robotics Interface Example ===" << std::endl;
234230

235231
// Create robotics interface
236-
auto robotics_interface = diffeq::examples::create_robotics_interface<std::vector<double>>();
232+
auto robotics_interface = create_robotics_interface<std::vector<double>>();
237233

238234
// Define robot dynamics
239235
auto robot_ode = [](double t, const std::vector<double>& y, std::vector<double>& dydt) {
@@ -243,7 +239,7 @@ int main() {
243239
};
244240

245241
auto signal_aware_robot_ode = robotics_interface->make_signal_aware_ode(robot_ode);
246-
auto robot_integrator = diffeq::make_rk4<std::vector<double>>(signal_aware_robot_ode);
242+
auto robot_integrator = diffeq::make_rk45<std::vector<double>>(signal_aware_robot_ode);
247243

248244
std::vector<double> robot_state = {0.1, 0.0}; // [angle, angular_velocity]
249245
auto robot_signal_proc = robotics_interface->get_signal_processor();
@@ -267,7 +263,7 @@ int main() {
267263
std::cout << "\n=== Scientific Interface Example ===" << std::endl;
268264

269265
// Create scientific interface
270-
auto scientific_interface = diffeq::examples::create_scientific_interface<std::vector<double>>();
266+
auto scientific_interface = create_scientific_interface<std::vector<double>>();
271267

272268
// Define scientific system (e.g., chemical reaction)
273269
auto chemical_ode = [](double t, const std::vector<double>& y, std::vector<double>& dydt) {

examples/parallelism_usage_demo.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <chrono>
55
#include <random>
66

7-
namespace diffeq::examples::parallelism {
8-
97
/**
108
* @brief Quick Start Example - Simplified Parallel Interface
119
*
@@ -364,13 +362,11 @@ void demonstrate_all_parallelism_features() {
364362
std::cout << "\n=== All parallelism features demonstrated! ===" << std::endl;
365363
}
366364

367-
} // namespace diffeq::examples::parallelism
368-
369365
int main() {
370366
std::cout << "=== diffeq Parallelism Usage Examples ===" << std::endl;
371367

372368
// Run comprehensive demonstration
373-
diffeq::examples::parallelism::demonstrate_all_parallelism_features();
369+
demonstrate_all_parallelism_features();
374370

375371
return 0;
376372
}

0 commit comments

Comments
 (0)