Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
76073f8
Add cmake files
asmelko Oct 15, 2025
e34aeba
Add some comments
asmelko Oct 15, 2025
7fef31a
Add C++ standard and march=native flags
asmelko Oct 15, 2025
7f5cd69
Add dfba cmake support
asmelko Oct 16, 2025
f788409
Add roadrunner cmake support
asmelko Oct 16, 2025
dbc368b
Nicer top-level cmake
asmelko Oct 16, 2025
125c250
FIx wrong Windows MaBoSS download link
asmelko Oct 16, 2025
b105814
Update .gitignore to include more exclusions
drbergman Oct 16, 2025
227ba0f
Add one forgotten sample project
asmelko Oct 16, 2025
7bab6a8
Change CMAKE_OSX_ARCHITECTURE to CMAKE_SYSTEM_PROCESSOR
asmelko Oct 16, 2025
d91233b
Correctly set veersion restrictions for OpenMP and add missing includes
asmelko Oct 18, 2025
bc573b2
Conditionally rely on filesystem header if on windows
asmelko Oct 18, 2025
ccb47ec
Slightly better ifdef around create directory
asmelko Oct 18, 2025
34ba4db
Do not rely on OS defines and rather query a feature-test macro
asmelko Oct 20, 2025
e250c29
Add cmake build GH action
asmelko Oct 28, 2025
6416b7b
Update push, PR trigger for Cmake GH action
asmelko Oct 28, 2025
e3990f2
Fix appleclang compiler exe in GH action and add clang dep
asmelko Oct 28, 2025
cd9f782
Add missing version header
asmelko Oct 28, 2025
e68a7eb
Comment out macos appleclang GH build
asmelko Oct 28, 2025
f49b846
Rename GH Action
asmelko Oct 28, 2025
1b665c8
Add MacOS gcc GH Actions CMake build
asmelko Oct 28, 2025
5c99875
Update gcc version
asmelko Oct 28, 2025
ea63c44
Remove macos deps steps
asmelko Oct 28, 2025
7d3223c
Add tests cmake GH action
asmelko Oct 28, 2025
54fc9e7
Fix tests action
asmelko Oct 28, 2025
be5b4bf
Better GH action name
asmelko Oct 28, 2025
7d10ed5
Fix correct MAXNODES for physiboss sample projects
asmelko Oct 31, 2025
6433914
Fix paths to work for windows too
asmelko Oct 31, 2025
f08e98f
Full paths to gh actions
asmelko Oct 31, 2025
0d398dd
Make exclusion of some tests better
asmelko Oct 31, 2025
228fef3
Fix paths
asmelko Oct 31, 2025
c8ef390
Normalize paths in testing python scripts
asmelko Oct 31, 2025
ced2118
Revert "Normalize paths in testing python scripts"
asmelko Oct 31, 2025
aa0c359
Add .exe for windows in Tests GH action
asmelko Oct 31, 2025
33ea67e
Add forgotten Release dir to Tests
asmelko Oct 31, 2025
40612ed
FIx path again
asmelko Oct 31, 2025
0dcc50b
Final path fix
asmelko Oct 31, 2025
6b00c98
Bump-up CMake minimal version as copy_directory_if_different requirement
asmelko Oct 31, 2025
b099436
Remove unused cmake file
asmelko Dec 11, 2025
0f66fc5
Decrease minimal cmake version by substituting copy_directory_if_diff…
asmelko Dec 11, 2025
1e702e3
Add missing openmp flags to the remainder of targets
asmelko Dec 11, 2025
a161bdc
Use signed integers in omp pragmas to make windows openmp not complain
asmelko Dec 15, 2025
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
77 changes: 77 additions & 0 deletions .github/workflows/build_binaries_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build binaries CMake

on:
push:
pull_request:
release:
types: [published]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
build_physiboss: "OFF"
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
build_physiboss: "ON"
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
build_physiboss: "ON"
- os: macos-latest
c_compiler: gcc-15
cpp_compiler: g++-15
build_physiboss: "ON"
# - os: macos-latest
# c_compiler: cc
# cpp_compiler: c++
# build_physiboss: "ON"

steps:
- uses: actions/checkout@v4

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libomp-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=Release
-DPHYSICELL_BUILD_PHYSIBOSS=${{ matrix.build_physiboss }}
-S ${{ github.workspace }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
89 changes: 89 additions & 0 deletions .github/workflows/tests_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Tests CMake

on:
push:
pull_request:
workflow_dispatch:

jobs:
tests:
name: Testing ${{ matrix.projects.name }} on ${{ matrix.platform.os }}
runs-on: ${{ matrix.platform.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run cross-product of projects and OS/compiler combinations
matrix:
projects: [
{"use_physiboss": false, cwd: "build/sample_projects/template", name: "PhysiCell Template", binary: "template", max_time: 120, config: "config/PhysiCell_settings.xml", validation_output_folder: "output_template"},
{"use_physiboss": true, cwd: "build/sample_projects_intracellular/boolean/template_BM", name: "PhysiBoSS Template", binary: "template_BM", max_time: 120, config: "config/PhysiCell_settings.xml", validation_output_folder: "output_template_BM"},
{"use_physiboss": true, cwd: "build/sample_projects_intracellular/boolean/physiboss_cell_lines", name: "PhysiBoSS Cell Lines", binary: "physiboss_cell_lines", max_time: 120, config: "config/PhysiCell_settings.xml", validation_output_folder: "output_physiboss-cell-lines-sample"},
{"use_physiboss": false, cwd: "build/sample_projects/physimess", name: "PhysiMeSS Sample", binary: "physimess", config: "config/Fibre_Degradation/mymodel_matrix_degradation.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": true, cwd: "build/sample_projects_intracellular/boolean/tutorial", name: "PhysiBoSS Tutorial", binary: "tutorial", config: "config/cell_cycle/PhysiCell_settings.xml", max_time: 300, validation_output_folder: "output_physiboss-tutorial"},
{"use_physiboss": false, cwd: "build/sample_projects/worm", name: "PhysiCell worm", binary: "worm", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: "output_worm-sample"},
{"use_physiboss": false, cwd: "build/sample_projects/virus_macrophage", name: "Virus Macrophage", binary: "virus_macrophage", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: "output_virus-macrophage-sample"},
{"use_physiboss": false, cwd: "build/sample_projects/mechano", name: "PhysiCell Mechano", binary: "mechano", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: "output_mechano-sample"},
{"use_physiboss": false, cwd: "build/sample_projects/cancer_biorobots", name: "PhysiCell Cancer Biorobots", binary: "cancer_biorobots", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/biorobots", name: "PhysiCell Biorobots", binary: "biorobots", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/celltypes3", name: "PhysiCell Celltypes3", binary: "celltypes3", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/custom_division", name: "PhysiCell custom division", binary: "custom_division", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/interactions", name: "PhysiCell interactions", binary: "interactions", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/pred_prey_farmer", name: "PhysiCell prey predator", binary: "pred_prey_farmer", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/rules_sample", name: "PhysiCell rules sample", binary: "rules_sample", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/asymmetric_division", name: "PhysiCell asymmetric division", binary: "asymmetric_division", config: "config/PhysiCell_settings.xml", max_time: 120, validation_output_folder: ""},
{"use_physiboss": false, cwd: "build/sample_projects/episode", name: "PhysiCell Episode", binary: "episode", max_time: 120, config: "config/PhysiCell_settings.xml", validation_output_folder: ""},
]
platform: [
{"os": "windows-latest", "c_compiler": "cl", "cpp_compiler": "cl", "build_physiboss": "OFF"},
{"os": "ubuntu-latest", "c_compiler": "gcc", "cpp_compiler": "g++", "build_physiboss": "ON"},
{"os": "ubuntu-latest", "c_compiler": "clang", "cpp_compiler": "clang++", "build_physiboss": "ON"},
{"os": "macos-latest", "c_compiler": "gcc-15", "cpp_compiler": "g++-15", "build_physiboss": "ON"},
# {"os": "macos-latest", "c_compiler": "cc", "cpp_compiler": "c++", "build_physiboss": "ON"},
]
exclude:
- { projects: { use_physiboss: true }, platform: { build_physiboss: "OFF" } }

steps:
- uses: actions/checkout@v4

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install dependencies (Linux)
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libomp-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.platform.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.platform.c_compiler }}
-DCMAKE_BUILD_TYPE=Release
-DPHYSICELL_BUILD_PHYSIBOSS=${{ matrix.platform.build_physiboss }}
-S ${{ github.workspace }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release --target ${{ matrix.projects.binary }}

- name: Run ${{ matrix.projects.name }} project
run: |
python ${{ github.workspace }}/beta/test_run_sample.py ${{ matrix.platform.os == 'windows-latest' && 'Release/' || '' }}${{ matrix.projects.binary }} ${{ matrix.projects.config }} ${{ matrix.projects.max_time }}
working-directory: ${{ matrix.projects.cwd }}

- name: Check ${{ matrix.projects.name }} project simulation results
if: matrix.projects.validation_output_folder != ''
run: |
python ${{ github.workspace }}/beta/test_diff_svg.py output ${{ github.workspace }}/tests/cases/${{ matrix.projects.validation_output_folder }}
working-directory: ${{ matrix.projects.cwd }}

37 changes: 31 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
*.asv
._.DS_Store
.DS_Store
*.exe
*.o
addons/libRoadrunner/roadrunner/
addons/libRoadrunner/roadrunner-win64-vs14-cp35m.zip
addons/PhysiBoSS/MaBoSS/
addons/PhysiBoSS/libMaBoSS-*.tar.gz
biorobots
cancer_immune_3D
build/
config/PhysiCell_settings-backup.xml
heterogeneity
initial.svg
interaction_demo
Makefile-backup
pmb_debug.log
project
studio_debug.log
user_projects/*
!user_projects/empty.txt
Studio.zip
/studio

# executables
/project
/biorobots
/cancer_biorobots
/cancer_immune_3D
/celltypes3
/heterogeneity
/interaction_demo
/pred_prey
/virus-sample
/worm
/*.exe

# boolean intracellular project executables
/invasion_model
/PhysiBoSS_Cell_Lines

# fba intracellular project executables
/cancer_metabolism
/ecoli-dfba

# ode intracellular project executables
/ode_energy

# test project executables
/time_tests
/unit_tests
/test_custom_DCs
/test_voxel_values
16 changes: 8 additions & 8 deletions BioFVM/BioFVM_microenvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ void Microenvironment::apply_dirichlet_conditions( void )
{
/*
#pragma omp parallel for
for( unsigned int i=0 ; i < dirichlet_indices.size() ; i++ )
for( long long i=0 ; i < dirichlet_indices.size() ; i++ )
{ density_vector( dirichlet_indices[i] ) = dirichlet_value_vectors[i]; }
*/

// #pragma omp parallel for
for( unsigned int i=0 ; i < mesh.voxels.size() ;i++ )
for( long long i=0 ; i < mesh.voxels.size() ;i++ )
{
/*
if( mesh.voxels[i].is_Dirichlet == true )
Expand Down Expand Up @@ -740,7 +740,7 @@ void Microenvironment::simulate_bulk_sources_and_sinks( double dt )
}

#pragma omp parallel for
for( unsigned int i=0; i < mesh.voxels.size() ; i++ )
for( long long i=0; i < mesh.voxels.size() ; i++ )
{
bulk_supply_rate_function( this,i, &bulk_source_sink_solver_temp1[i] ); // temp1 = S
bulk_supply_target_densities_function( this,i, &bulk_source_sink_solver_temp2[i]); // temp2 = T
Expand All @@ -762,7 +762,7 @@ void Microenvironment::simulate_bulk_sources_and_sinks( double dt )
void Microenvironment::simulate_cell_sources_and_sinks( std::vector<Basic_Agent*>& basic_agent_list , double dt )
{
#pragma omp parallel for
for( unsigned int i=0 ; i < basic_agent_list.size() ; i++ )
for( long long i=0 ; i < basic_agent_list.size() ; i++ )
{
basic_agent_list[i]->simulate_secretion_and_uptake( this , dt );
}
Expand All @@ -787,7 +787,7 @@ void Microenvironment::update_rates( void )
{ uptake_rates.assign( number_of_voxels() , zero ); }

#pragma omp parallel for
for( unsigned int i=0 ; i < number_of_voxels() ; i++ )
for( long long i=0 ; i < number_of_voxels() ; i++ )
{
bulk_uptake_rate_function( this,i, &(uptake_rates[i]) );
bulk_supply_rate_function( this,i, &(supply_rates[i]) );
Expand Down Expand Up @@ -858,7 +858,7 @@ void Microenvironment::compute_all_gradient_vectors( void )
}

#pragma omp parallel for
for( unsigned int k=0; k < mesh.z_coordinates.size() ; k++ )
for( long long k=0; k < mesh.z_coordinates.size() ; k++ )
{
for( unsigned int j=0; j < mesh.y_coordinates.size() ; j++ )
{
Expand Down Expand Up @@ -904,7 +904,7 @@ void Microenvironment::compute_all_gradient_vectors( void )
}

#pragma omp parallel for
for( unsigned int k=0; k < mesh.z_coordinates.size() ; k++ )
for( long long k=0; k < mesh.z_coordinates.size() ; k++ )
{
for( unsigned int i=0; i < mesh.x_coordinates.size() ; i++ )
{
Expand Down Expand Up @@ -953,7 +953,7 @@ void Microenvironment::compute_all_gradient_vectors( void )
{ return; }

#pragma omp parallel for
for( unsigned int j=0; j < mesh.y_coordinates.size() ; j++ )
for( long long j=0; j < mesh.y_coordinates.size() ; j++ )
{
for( unsigned int i=0; i < mesh.x_coordinates.size() ; i++ )
{
Expand Down
14 changes: 7 additions & 7 deletions BioFVM/BioFVM_solvers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M,

M.apply_dirichlet_conditions();
#pragma omp parallel for
for( unsigned int k=0; k < M.mesh.z_coordinates.size() ; k++ )
for( long long k=0; k < M.mesh.z_coordinates.size() ; k++ )
{
for( unsigned int j=0; j < M.mesh.y_coordinates.size() ; j++ )
{
Expand Down Expand Up @@ -225,7 +225,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M,

M.apply_dirichlet_conditions();
#pragma omp parallel for
for( unsigned int k=0; k < M.mesh.z_coordinates.size() ; k++ )
for( long long k=0; k < M.mesh.z_coordinates.size() ; k++ )
{
for( unsigned int i=0; i < M.mesh.x_coordinates.size() ; i++ )
{
Expand Down Expand Up @@ -259,7 +259,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M,

M.apply_dirichlet_conditions();
#pragma omp parallel for
for( unsigned int j=0; j < M.mesh.y_coordinates.size() ; j++ )
for( long long j=0; j < M.mesh.y_coordinates.size() ; j++ )
{

for( unsigned int i=0; i < M.mesh.x_coordinates.size() ; i++ )
Expand Down Expand Up @@ -386,7 +386,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_2D( Microenvironment& M,

// x-diffusion
#pragma omp parallel for
for( unsigned int j=0; j < M.mesh.y_coordinates.size() ; j++ )
for( long long j=0; j < M.mesh.y_coordinates.size() ; j++ )
{
// Thomas solver, x-direction

Expand Down Expand Up @@ -416,7 +416,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_2D( Microenvironment& M,

M.apply_dirichlet_conditions();
#pragma omp parallel for
for( unsigned int i=0; i < M.mesh.x_coordinates.size() ; i++ )
for( long long i=0; i < M.mesh.x_coordinates.size() ; i++ )
{
// Thomas solver, y-direction

Expand Down Expand Up @@ -497,7 +497,7 @@ void diffusion_decay_explicit_uniform_rates( Microenvironment& M, double dt )
static vector<double> constant4 = M.one - dt * M.decay_rates;

#pragma omp parallel for
for( unsigned int i=0; i < (*(M.p_density_vectors)).size() ; i++ )
for( long long i=0; i < (*(M.p_density_vectors)).size() ; i++ )
{
unsigned int number_of_neighbors = M.mesh.connected_voxel_indices[i].size();

Expand Down Expand Up @@ -591,7 +591,7 @@ void diffusion_decay_solver__constant_coefficients_LOD_1D( Microenvironment& M,

// x-diffusion
#pragma omp parallel for
for( unsigned int j=0; j < M.mesh.y_coordinates.size() ; j++ )
for( long long j=0; j < M.mesh.y_coordinates.size() ; j++ )
{
// Thomas solver, x-direction

Expand Down
7 changes: 7 additions & 0 deletions BioFVM/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_library(BioFVM OBJECT)

file(GLOB SOURCES "*.cpp")
target_sources(BioFVM PRIVATE ${SOURCES})

find_package(OpenMP REQUIRED)
target_link_libraries(BioFVM PUBLIC OpenMP::OpenMP_CXX)
Loading
Loading