From 37a32b34ce0fc8594c23247b7145ed4ccb498f5c Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:22:08 +0000
Subject: [PATCH 01/28] Initial CI script
---
.github/workflows/ci-build.yml | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 .github/workflows/ci-build.yml
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
new file mode 100644
index 0000000..fba1040
--- /dev/null
+++ b/.github/workflows/ci-build.yml
@@ -0,0 +1,31 @@
+name: Build Sibernetic
+
+on:
+ push:
+ branches: [ master, dev*, ow* ]
+ pull_request:
+ branches: [ master, dev, ow* ]
+
+jobs:
+
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Intel OpenCL libraries needed for Sibernetic
+ run: |
+
+ mkdir intel-opencl-tmp
+ cd intel-opencl-tmp
+ mkdir intel-opencl
+ wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
+ unzip SRB5.0_linux64.zip
+ tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
+ tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
+ tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
+ sudo cp -R intel-opencl/* /
+ sudo ldconfig
+ cd ..
+ sudo rm -r intel-opencl-tmp
From cc8370c297a837ec54edd86f4a7f851dc8f56f9f Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:26:47 +0000
Subject: [PATCH 02/28] More CI script
---
.github/workflows/ci-build.yml | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index fba1040..f0aafbf 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -17,10 +17,12 @@ jobs:
- name: Install Intel OpenCL libraries needed for Sibernetic
run: |
+ # Based on: https://github.com/openworm/OpenWorm/blob/master/Dockerfile
+
mkdir intel-opencl-tmp
cd intel-opencl-tmp
mkdir intel-opencl
- wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
+ wget http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip
unzip SRB5.0_linux64.zip
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
@@ -29,3 +31,11 @@ jobs:
sudo ldconfig
cd ..
sudo rm -r intel-opencl-tmp
+
+ sudo cp -R /opt/intel/opencl/include/CL /usr/include/
+ sudo apt install -y ocl-icd-opencl-dev vim
+
+ - name: Build Sibernetic
+ run: |
+
+ python -V
From 4eb76b284c6ebd7bedf9f5b14e4ca88894427212 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:31:33 +0000
Subject: [PATCH 03/28] Specify python version
---
.github/workflows/ci-build.yml | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index f0aafbf..7dddfa9 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -10,10 +10,21 @@ jobs:
build:
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.runs-on }}
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version: [ 3.7 ]
+ runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
- name: Install Intel OpenCL libraries needed for Sibernetic
run: |
@@ -22,7 +33,7 @@ jobs:
mkdir intel-opencl-tmp
cd intel-opencl-tmp
mkdir intel-opencl
- wget http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip
+ wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
unzip SRB5.0_linux64.zip
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
@@ -38,4 +49,4 @@ jobs:
- name: Build Sibernetic
run: |
- python -V
+ python -V
From 03b1b4323abd57f425962dc9bdb51a98041ed44c Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:34:43 +0000
Subject: [PATCH 04/28] Use ubuntu-18.04
---
.github/workflows/ci-build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 7dddfa9..fba40cf 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
python-version: [ 3.7 ]
- runs-on: [ubuntu-latest]
+ runs-on: [ ubuntu-18.04 ]
steps:
- uses: actions/checkout@v2
@@ -24,7 +24,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
-
+
- name: Install Intel OpenCL libraries needed for Sibernetic
run: |
From 96637b651d6aaf1b520de8e5840001332373ef2f Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:36:31 +0000
Subject: [PATCH 05/28] Test build...
---
.github/workflows/ci-build.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index fba40cf..8fa64b9 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -50,3 +50,7 @@ jobs:
run: |
python -V
+ ls -alt
+ make clean
+ make
+
From 49e262371beb0e306c8db74fd13169abee279f5b Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 13:39:02 +0000
Subject: [PATCH 06/28] install python-dev
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 8fa64b9..ad5e113 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -49,8 +49,8 @@ jobs:
- name: Build Sibernetic
run: |
+ sudo apt install -y python-dev
python -V
ls -alt
make clean
make
-
From 85edb19f2fc19edac8f3f44418d09869f81c8b56 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 14:34:08 +0000
Subject: [PATCH 07/28] Install python3-dev
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index ad5e113..24a167f 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -49,7 +49,7 @@ jobs:
- name: Build Sibernetic
run: |
- sudo apt install -y python-dev
+ sudo apt install -y python3-dev
python -V
ls -alt
make clean
From 04a6eaccf3771e1db73ee6b0e74797b6d42c0598 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 14:41:51 +0000
Subject: [PATCH 08/28] 3.7
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 24a167f..17f91ab 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -49,7 +49,7 @@ jobs:
- name: Build Sibernetic
run: |
- sudo apt install -y python3-dev
+ sudo apt install -y python3.7-dev
python -V
ls -alt
make clean
From 3aa50f8cfaf0f8940bfe786622aae98d0a401591 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 14:44:54 +0000
Subject: [PATCH 09/28] Install freeglut3-dev libglu1-mesa-dev
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 17f91ab..cfb9429 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -49,7 +49,7 @@ jobs:
- name: Build Sibernetic
run: |
- sudo apt install -y python3.7-dev
+ sudo apt install -y python3.7-dev freeglut3-dev libglu1-mesa-dev
python -V
ls -alt
make clean
From 0af5104496645e21caa0842bf8b53c0daaef3068 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 15 Mar 2022 14:52:04 +0000
Subject: [PATCH 10/28] Run quick Sibernetic test
---
.github/workflows/ci-build.yml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index cfb9429..3ea4225 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -49,8 +49,13 @@ jobs:
- name: Build Sibernetic
run: |
- sudo apt install -y python3.7-dev freeglut3-dev libglu1-mesa-dev
+ sudo apt install -y python3.7-dev freeglut3-dev libglu1-mesa-dev
python -V
ls -alt
make clean
make
+
+ - name: Run quick Sibernetic test
+ run: |
+
+ ./Release/Sibernetic -no_g timelimit=0.001
From e493de27f0b6c2ad647d75a4df04d20f36f7b73c Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 16 May 2022 17:49:10 +0100
Subject: [PATCH 11/28] Print out version info at end of test
---
.github/workflows/ci-build.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 3ea4225..2d2da41 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -59,3 +59,9 @@ jobs:
run: |
./Release/Sibernetic -no_g timelimit=0.001
+
+ - name: Final version info
+ run: |
+
+ python -V
+ pip list
From 5a66ec4ba294cc238324769d5656ddef79839cb0 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 20 Jun 2022 16:09:02 +0100
Subject: [PATCH 12/28] Test ubuntu 20.04
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 2d2da41..6df5cc9 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
python-version: [ 3.7 ]
- runs-on: [ ubuntu-18.04 ]
+ runs-on: [ ubuntu-18.04, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
From bf66e593387677d66684537d9419f7246900bd9f Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Thu, 23 Jun 2022 18:06:40 +0100
Subject: [PATCH 13/28] Minor fix to os.environ.get('XAUTHORITY')
---
sibernetic_c302.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sibernetic_c302.py b/sibernetic_c302.py
index 2e270d4..ad97195 100644
--- a/sibernetic_c302.py
+++ b/sibernetic_c302.py
@@ -327,7 +327,7 @@ def run(a=None,**kwargs):
command = './Release/Sibernetic %s -f %s -no_g -l_to lpath=%s timelimit=%s timestep=%s logstep=%s device=%s'%('' if a.noc302 else '-c302', a.configuration, sim_dir, a.duration/1000.0, a.dt/1000, a.logstep, a.device)
env = { "DISPLAY": os.environ.get('DISPLAY'),
- "XAUTHORITY": os.environ.get('XAUTHORITY'),
+ "XAUTHORITY": os.environ.get('XAUTHORITY') if os.environ.get('XAUTHORITY') is not None else '',
"PYTHONPATH": ".:%s:%s" % (os.environ.get('PYTHONPATH', '.'), os.path.abspath(sim_dir))}
sim_start = time.time()
From a3bbf799fbb17ad5a8e26dc28d8525e8892b672b Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Thu, 23 Jun 2022 19:08:27 +0100
Subject: [PATCH 14/28] Test detect python version
---
makefile | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/makefile b/makefile
index ca4243e..3b9bba6 100755
--- a/makefile
+++ b/makefile
@@ -13,8 +13,10 @@ BINARYDIR = $(BUILDDIR)/obj
SOURCES = $(wildcard $(SRCDIR)/*.$(SRCEXT))
BINARYTESTDIR = $(BINARYDIR)/test
OBJECTS := $(patsubst $(SRCDIR)/%,$(BINARYDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
-OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
-PYTHON_CONFIG ?= /usr/bin/python3.7-config
+OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
+PYTHON_VER_MAIN = $(shell python -c 'import sys; vv=sys.version_info[:];print(str(vv[0])+str(1.0)[1]+str(vv[1]))')
+#PYTHON_VER_MAIN = 3.8 # Hardcode if necessary
+PYTHON_CONFIG ?= /usr/bin/python$(PYTHON_VER_MAIN)-config
CPP_DEPS = $(OBJECTS:.o=.d)
@@ -35,7 +37,7 @@ CXXFLAGS += $(shell $(PYTHON_CONFIG) --embed --cflags)
endif
CXXFLAGS += -fPIE
-EXTRA_LIBS := -L/usr/lib64/OpenCL/vendors/amd/ -L/opt/AMDAPP/lib/x86_64/ -L/usr/lib/x86_64-linux-gnu/
+EXTRA_LIBS := -L/usr/lib64/OpenCL/vendors/amd/ -L/opt/AMDAPP/lib/x86_64/ -L/usr/lib/x86_64-linux-gnu/
all: CXXFLAGS += -O3
all : $(TARGET)
@@ -45,12 +47,12 @@ debug: $(TARGET)
$(TARGET):$(OBJECTS)
@echo 'Building target: $@'
- @echo 'Invoking: GCC C++ Linker'
+ @echo 'Invoking: GCC C++ Linker'
$(CC) $(CXXFLAGS) $(EXTRA_LIBS) -o $(BUILDDIR)/$(TARGET) $(OBJECTS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
-$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
+$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(BINARYDIR)
@mkdir -p $(BINARYTESTDIR)
@echo 'Building file: $<'
@@ -59,7 +61,7 @@ $(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@echo 'Finished building: $<'
@echo ' '
-clean :
+clean :
-$(RM) $(OBJECTS)$(CPP_DEPS) $(BUILDDIR)/$(TARGET)
-@echo ' '
From 36d99fcb667edee312db5144d870bf42e1d5578f Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 24 Jun 2022 10:05:28 +0100
Subject: [PATCH 15/28] Use native system python
---
.github/workflows/ci-build.yml | 9 ++-------
makefile | 3 ++-
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 6df5cc9..0eb01da 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,17 +14,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: [ 3.7 ]
runs-on: [ ubuntu-18.04, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
-
- name: Install Intel OpenCL libraries needed for Sibernetic
run: |
@@ -49,8 +43,9 @@ jobs:
- name: Build Sibernetic
run: |
- sudo apt install -y python3.7-dev freeglut3-dev libglu1-mesa-dev
+ sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
python -V
+ ll /usr/bin/python*
ls -alt
make clean
make
diff --git a/makefile b/makefile
index 3b9bba6..1a1f807 100755
--- a/makefile
+++ b/makefile
@@ -14,7 +14,7 @@ SOURCES = $(wildcard $(SRCDIR)/*.$(SRCEXT))
BINARYTESTDIR = $(BINARYDIR)/test
OBJECTS := $(patsubst $(SRCDIR)/%,$(BINARYDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
-PYTHON_VER_MAIN = $(shell python -c 'import sys; vv=sys.version_info[:];print(str(vv[0])+str(1.0)[1]+str(vv[1]))')
+PYTHON_VER_MAIN = $(shell python3 -c 'import sys; vv=sys.version_info[:];print(str(vv[0])+str(1.0)[1]+str(vv[1]))')
#PYTHON_VER_MAIN = 3.8 # Hardcode if necessary
PYTHON_CONFIG ?= /usr/bin/python$(PYTHON_VER_MAIN)-config
@@ -53,6 +53,7 @@ $(TARGET):$(OBJECTS)
@echo ' '
$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
+ @echo 'Assuming Python: $(PYTHON_VER_MAIN)'
@mkdir -p $(BINARYDIR)
@mkdir -p $(BINARYTESTDIR)
@echo 'Building file: $<'
From 7b0f44427cbab299c1a8285dc69f076d98eda39e Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 24 Jun 2022 10:09:45 +0100
Subject: [PATCH 16/28] Tweak
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 0eb01da..a3b7bed 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -45,7 +45,7 @@ jobs:
sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
python -V
- ll /usr/bin/python*
+ ls -alt /usr/bin/python*
ls -alt
make clean
make
From 5da4179ddf6d616b82afce3aa1016645141f2b9d Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 24 Jun 2022 10:27:37 +0100
Subject: [PATCH 17/28] Test on 22.04
---
.github/workflows/ci-build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index a3b7bed..c0a1196 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ ubuntu-18.04, ubuntu-20.04 ]
+ runs-on: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
steps:
- uses: actions/checkout@v2
@@ -52,7 +52,7 @@ jobs:
- name: Run quick Sibernetic test
run: |
-
+ ldd ./Release/Sibernetic
./Release/Sibernetic -no_g timelimit=0.001
- name: Final version info
From e5762fe7a5f1ef715c2299434bbeebfb73c22dfb Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 24 Jun 2022 12:52:03 +0100
Subject: [PATCH 18/28] Just ubuntu-20.04
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index c0a1196..d8d1a59 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
+ runs-on: [ ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
From d47316409fb2a6943e442fd5e9f091a39717229d Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 28 Jun 2022 16:37:47 +0100
Subject: [PATCH 19/28] Improved printing from python helper scripts
---
plot_positions.py | 97 +++++++++++++++---------------
wcon/generate_wcon.py | 136 +++++++++++++++++++++---------------------
2 files changed, 116 insertions(+), 117 deletions(-)
diff --git a/plot_positions.py b/plot_positions.py
index 3378799..f91aca2 100644
--- a/plot_positions.py
+++ b/plot_positions.py
@@ -1,12 +1,17 @@
-import sys
+import sys
+
+
+def print_(msg):
+
+ print("c302 plot >>> %s"%(msg))
'''
Plot the positions from a saved Sibernetic position_buffer.txt file
'''
def plot_positions(pos_file_name, rate_to_plot = 100, save_figure=True, show_plot=True):
-
+
postions_file = open(pos_file_name)
-
+
rate_to_plot = max(1,int(rate_to_plot))
index = 0
@@ -20,7 +25,7 @@ def plot_positions(pos_file_name, rate_to_plot = 100, save_figure=True, show_plo
import matplotlib.pyplot as plt
- print("Loading: %s"%pos_file_name)
+ print_("Loading: %s"%pos_file_name)
fig = plt.figure()
@@ -40,13 +45,13 @@ def plot_positions(pos_file_name, rate_to_plot = 100, save_figure=True, show_plo
in_frame = 0
xs = []
ys = []
-
+
num_plotted_frames = 0
for line in postions_file:
if index>max_lines:
- print("Finished parsing file, as max number of lines reached!")
+ print_("Finished parsing file, as max number of lines reached!")
break
if index==0: xmin=float(line)
@@ -71,7 +76,7 @@ def plot_positions(pos_file_name, rate_to_plot = 100, save_figure=True, show_plo
t_ms = frame * steps_per_frame * dt * 1000
if t_ms>max_time_ms:
- print("Finished parsing file, as max time (%s ms) reached!"%max_time_ms)
+ print_("Finished parsing file, as max time (%s ms) reached!"%max_time_ms)
break
@@ -93,27 +98,27 @@ def plot_positions(pos_file_name, rate_to_plot = 100, save_figure=True, show_plo
if in_frame == a+b+c-1:
if plot_frame:
- print(" >> Plotting frame %i at %s ms; line %i: %s...\n"%(num_plotted_frames,t_ms,index,line))
+ print_(" >> Plotting frame %i at %s ms; line %i: %s...\n"%(num_plotted_frames,t_ms,index,line))
ax.plot(xs,ys,'.', markersize=1)
num_plotted_frames+=1
if num_plotted_frames%3 == 1:
time = '%sms'%t_ms if not t_ms==int(t_ms) else '%sms'%int(t_ms)
ax.text(50+((num_plotted_frames-1)*30), 510, time, fontsize=12)
- frame+=1
+ frame+=1
in_frame = 0
- print("New positions (#%i) at time %s ms; line %i: %s"%(frame,t_ms,index,line))
+ print_("New positions (#%i) at time %s ms; line %i: %s"%(frame,t_ms,index,line))
xs = []
ys = []
index+=1
- print("Loaded: %s points from %s, showing %s points in %i plots"%(index,pos_file_name,points_plotted,num_plotted_frames))
+ print_("Loaded: %s points from %s, showing %s points in %i plots"%(index,pos_file_name,points_plotted,num_plotted_frames))
if save_figure:
plt.savefig('%s.png'%pos_file_name,bbox_inches='tight')
-
+
if show_plot:
plt.show()
@@ -125,49 +130,49 @@ def plot_muscle_activity(muscle_file_name, dt, logstep, save_figure=True, show_p
a = []
times = []
muscle_names = []
-
+
quadrant0 = 'MDR'
quadrant1 = 'MVR'
quadrant2 = 'MVL'
quadrant3 = 'MDL'
qs = [quadrant0,quadrant1,quadrant2,quadrant3]
-
+
activations = {}
-
+
for q in qs:
activations[q] = {}
for i in range(24):
activations[q][i] = []
muscle_names.append('%s%s'%(q,i))
- max_act = 0
+ max_act = 0
for line in muscle_file:
acts = [float(w) for w in line.split()]
-
- print("Found %s activation values (%s,...,%s) at line %s"%(len(acts),acts[0],acts[-1],count))
+
+ print_("Found %s activation values (%s,...,%s) at line %s"%(len(acts),acts[0],acts[-1],count))
a.append(acts)
-
+
for qi in range(len(qs)):
q = qs[qi]
for mi in range(24):
index = qi*24 + mi
activations[q][mi].append(acts[index])
max_act = max(max_act,acts[index])
-
+
times.append(count*dt*logstep/1000)
count+=1
-
-
+
+
import matplotlib.pyplot as plt
import numpy as np
-
-
+
+
fig, ax0 = plt.subplots(4, sharex=True, sharey=True)
-
+
info = "Muscle activation values per quadrant"
fig.canvas.set_window_title(info)
-
+
ax0[0].set_title('Muscle activation values per quadrant - '+quadrant0, size='small')
ax0[0].set_ylabel('muscle #')
ax0[1].set_title(quadrant3, size='small')
@@ -177,8 +182,8 @@ def plot_muscle_activity(muscle_file_name, dt, logstep, save_figure=True, show_p
ax0[3].set_title(quadrant2, size='small')
ax0[3].set_ylabel('muscle #')
ax0[3].set_xlabel('time (s)'%())
-
-
+
+
arr0 = []
arr1 = []
arr2 = []
@@ -188,16 +193,16 @@ def plot_muscle_activity(muscle_file_name, dt, logstep, save_figure=True, show_p
arr1.append(activations[quadrant3][i])
arr2.append(activations[quadrant1][i])
arr3.append(activations[quadrant2][i])
-
+
ax0[0].imshow(arr0, interpolation='none', aspect='auto', vmin=0, vmax=max_act)
ax0[1].imshow(arr1, interpolation='none', aspect='auto', vmin=0, vmax=max_act)
ax0[2].imshow(arr2, interpolation='none', aspect='auto', vmin=0, vmax=max_act)
ax0[3].imshow(arr3, interpolation='none', aspect='auto', vmin=0, vmax=max_act)
#fig.colorbar(im0)
-
-
-
-
+
+
+
+
ax1 = plt.gca();
xt = ax1.get_xticks()
time_ticks = [times[int(ti)] if (ti>=0 and ti=0 and ti>> %s"%(msg))
def generate_wcon(pos_file_name,
@@ -21,7 +21,7 @@ def generate_wcon(pos_file_name,
save_figure1_to=None,
save_figure2_to=None,
save_figure3_to=None):
-
+
print_("Generating WCON from %s to %s, with plotting rate %i"%(pos_file_name,wcon_file_name,rate_to_plot))
postions_file = open(pos_file_name)
@@ -50,7 +50,7 @@ def generate_wcon(pos_file_name,
time_points = []
num_frames = 0
-
+
angles = {}
xs0 = None
@@ -87,7 +87,7 @@ def generate_wcon(pos_file_name,
avx = 0
avy = 0
offset = num_plotted_frames * spacing
-
+
for i in range(len(x[t_s])):
# Swap x and y so worm moves "up"
@@ -97,7 +97,7 @@ def generate_wcon(pos_file_name,
avx += xs[-1] - offset
avy += ys[-1]
points_plotted += 1
-
+
if xs0==None:
xs0 = xs
if ys0==None:
@@ -136,7 +136,7 @@ def generate_wcon(pos_file_name,
ave_points.append((avx, avy))
time_points.append(t_s)
- print_(" Plot frame %i at %s s; l %i: [(%s,%s),...#%i]\n" % (
+ print_(" Plot frame %i at %s s; l %i: [(%s,%s),...#%i]" % (
num_plotted_frames, t_s, line_num, xs[0], ys[0], len(xs)))
num_plotted_frames += 1
@@ -149,33 +149,33 @@ def generate_wcon(pos_file_name,
ax.text(50 + ((num_plotted_frames - 1) * spacing),
10, time_, fontsize=12)
ax.plot([xx+offset for xx in xs0], ys0,':',color=l[0].get_color(),linewidth=0.5)
-
+
data = np.zeros((len(ts),len(xs)-4))
-
+
print_('Finished parsing %i lines'%line_num)
-
+
for ti in range(len(ts)):
-
+
for i in range(len(y[0]))[2:-2]:
-
+
x1 = x[ts[ti]][i-2]
xc = x[ts[ti]][i]
x2 = x[ts[ti]][i+2]
-
+
y1 = y[ts[ti]][i-2]
yc = y[ts[ti]][i]
y2 = y[ts[ti]][i+2]
-
- a1 = math.atan2(y1-yc,x1-xc)
+
+ a1 = math.atan2(y1-yc,x1-xc)
a2 = math.atan2(y2-yc,x2-xc)
angle = a2-a1
if angle <0: angle+=2*math.pi
if angle >2*math.pi: angle= 2*math.pi-angle
-
+
deg = 360*(angle/(2*math.pi))
-
+
data[ti][i-2]= deg
-
+
###print("At t=%s, i=%s: angle from between (%s,%s) - (%s,%s) - (%s,%s) = %s, %sdeg"%(ts[ti], i, x1,y1,xc,yc,x2,y2,angle,deg))
info = "Loaded: %s points from %s, saving %i frames" % (
@@ -196,8 +196,8 @@ def generate_wcon(pos_file_name,
"comment":"Saved from Sibernetic data.",
"note":"%s",
"data":[\n''' % (time.strftime("%Y-%m-%dT%H:%M:%S+00:00", time.gmtime()), info))
-
- wcon.write(''' {"id":"wormTest",
+
+ wcon.write(''' {"id":"wormTest",
"t":[ ''')
for t in ts:
wcon.write('%s' % (t))
@@ -205,36 +205,36 @@ def generate_wcon(pos_file_name,
wcon.write(', ')
wcon.write('],\n')
-
+
wcon.write(''' "x":[ ''')
for t in ts:
wcon.write('%s' % (x[t]))
if t != ts[-1]:
wcon.write(',\n')
wcon.write('],\n')
-
+
wcon.write(''' "y":[ ''')
for t in ts:
wcon.write('%s' % (y[t]))
if t != ts[-1]:
wcon.write(',\n')
wcon.write(']\n')
-
-
+
+
wcon.write('\n}\n')
wcon.write('\n]\n')
wcon.write('\n}\n')
-
+
wcon.close()
postions_file.close()
info = "Midline of worm through time (to %s seconds)"%time_points[-1]
-
+
plt.xlabel("x direction")
plt.ylabel("y direction")
fig.canvas.set_window_title(info)
plt.title(info)
-
+
if save_figure1_to:
plt.savefig(save_figure1_to)
@@ -244,7 +244,7 @@ def generate_wcon(pos_file_name,
plt.title(info)
plt.xlabel("Time (s)")
plt.ylabel("Speed")
-
+
plt.plot(time_points[1:], ave_point_speed_x, 'red',
label='Speed in x of average of %i points' % points)
plt.plot(time_points[1:], middle_point_speed_x, 'pink',
@@ -255,50 +255,50 @@ def generate_wcon(pos_file_name,
plt.plot(time_points[1:], middle_point_speed_y, 'cyan',
label='Speed in y dir of point %i/%i' % (middle_point,
points), linestyle='--')
-
-
-
+
+
+
plt.plot([0,time_points[-1]],[0,0], 'grey', linestyle=':')
-
+
plt.legend(loc=2, fontsize = 'x-small')
if save_figure2_to:
plt.savefig(save_figure2_to,bbox_inches='tight')
fig = plt.figure()
-
+
plt.xlabel("Time (s)")
plt.ylabel("Percentage along worm")
-
+
plot0 = plt.imshow(data.transpose(), interpolation='nearest', aspect='auto')
ax = plt.gca();
-
+
info = "Propagation of curvature along body of worm (180=straight)"
fig.canvas.set_window_title(info)
plt.title(info)
-
+
xt = ax.get_xticks()
- print(xt)
+ #print(xt)
time_ticks = [time_points[int(ti)] if (ti>=0 and ti1: fract = 1.0
-
+
hue = (270 * (1-fract))
return "pigment { color CHSL2RGB(<%f,1,0.5>) } // v = %f, fract = %f"%( hue , v, fract)'''
@@ -347,28 +347,28 @@ def get_rainbow_color_for_volts(fract):
import matplotlib
import math
validate("test.wcon")
-
+
test_sim = 'C0_Muscles_2018-01-19_15-59-59'
#test_sim = 'Sibernetic_2018-01-17_21-10-11'
#test_sim = 'C0_TargetMuscle_2018-01-23_14-19-54'
-
+
'''
test_sim = 'C2_FW_2018-01-27_14-52-26'
test_sim="/home/padraig/git/OpenWorm/output/C2_FW_2018-01-28_13-35-36"
pos_file_name = "%s/worm_motion_log.txt"%test_sim
small_file = "%s/worm_motion_log.wcon"%test_sim
x,y,z,ts = generate_wcon(pos_file_name, small_file, rate_to_plot=2, plot=False)
-
+
sys.path.append("..")
from plot_positions import plot_muscle_activity
musc_act_file = "%s/muscles_activity_buffer.txt"%test_sim
activations, times = plot_muscle_activity(musc_act_file,0.005,1000, show_plot=False)
-
+
print("Plotting %s sets of %s (%s) activation values on %s times"%(len(activations['MDR']),len(activations['MDR'][0]), len(times),len(ts)))
for ti in range(len(ts)):
t = ts[ti]
print("Check time index %i: %s ms"%(ti,t))
-
+
fig = plt.figure()
info = "Pos at %sms"%t
@@ -391,8 +391,8 @@ def get_rainbow_color_for_volts(fract):
actVR = activations['MVR'][mi][mt]*scale
colorVR = get_color_for_fract(actVR)
print('Midpoint %i mapped to muscle %s: %s - %s; %s - %s'%(li,mi, actDL, colorDL, actVL, colorVL))
-
-
+
+
max_rad1 = 3.5
max_rad2 = 2
widthL = transform(li,max_rad=max_rad1)
@@ -405,44 +405,44 @@ def get_rainbow_color_for_volts(fract):
y1=my[li+1]
a=x1-x0
b=y1-y0
-
-
-
+
+
+
newx0 = x0+widthL*b
newy0 = y0-widthL*a
newx1 = x1+widthL1*b
newy1 = y1-widthL1*a
plt.plot([newx0,newx1],[newy0,newy1],color=colorDL,linewidth=0,marker='o',markersize=3,alpha=0.4, markeredgewidth=0)
-
+
newx0 = x0+widthR*b
newy0 = y0-widthR*a
newx1 = x1+widthR1*b
newy1 = y1-widthR1*a
plt.plot([newx0,newx1],[newy0,newy1],color=colorDR,linewidth=0,marker='o',markersize=3,alpha=0.4, markeredgewidth=0)
-
+
newx0 = x0-widthL*b
newy0 = y0+widthL*a
newx1 = x1-widthL1*b
newy1 = y1+widthL1*a
plt.plot([newx0,newx1],[newy0,newy1],color=colorVL,linewidth=0,marker='o',markersize=3,alpha=0.4, markeredgewidth=0)
-
+
newx0 = x0-widthR*b
newy0 = y0+widthR*a
newx1 = x1-widthR1*b
newy1 = y1+widthR1*a
plt.plot([newx0,newx1],[newy0,newy1],color=colorVR,linewidth=0,marker='o',markersize=3,alpha=0.4, markeredgewidth=0)
-
+
plt.plot(mx,my, 'green')
-
+
bound = .7
plt.xlim([mx[49]-bound*1.5,mx[49]+bound*1.5])
plt.ylim([my[49]-bound,my[49]+bound])
ax = plt.gca();
#ax.set_facecolor('black')
ax.set_aspect('equal')
-
+
matplotlib.rc('axes',edgecolor='w')
-
+
for child in ax.get_children():
if isinstance(child, matplotlib.spines.Spine):
child.set_color('w')
@@ -455,15 +455,15 @@ def get_rainbow_color_for_volts(fract):
frame='0'+frame
print("Writing frame %i: %s"%(ti,frame))
plt.savefig("Calcium_%s.png"%frame,facecolor='black',transparent=True,bbox_inches='tight')
-
+
exit()'''
-
-
+
+
if len(sys.argv) >1:
pos_file_name = sys.argv[1]
else:
pos_file_name = '../buffers/worm_motion_log.txt'
-
+
if len(sys.argv) >2:
rate_to_plot = int(sys.argv[2])
else:
@@ -473,9 +473,7 @@ def get_rainbow_color_for_volts(fract):
#generate_wcon(pos_file_name, "sibernetic_test_small.wcon",
# rate_to_plot=20, max_time_s=20)
-
+
small_file = "small.wcon"
- generate_wcon(pos_file_name, small_file, rate_to_plot=rate_to_plot, plot=False)
+ generate_wcon(pos_file_name, small_file, rate_to_plot=rate_to_plot, plot=True)
validate(small_file)
-
-
From 610bf12e0161fecd2e7feb219d9ea1b751a4b736 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 1 Jul 2022 17:27:08 +0100
Subject: [PATCH 20/28] Update ci-build.yml
---
.github/workflows/ci-build.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index d8d1a59..e2f944b 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,7 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ ubuntu-20.04 ]
+ python-version: [ 3.7, 3.8 ]
+ runs-on: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
steps:
- uses: actions/checkout@v2
From c6503a477d8782911968c68d76253bc05e3eea0d Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 4 Jul 2022 11:48:04 +0100
Subject: [PATCH 21/28] Use libc-bin=2.27-3ubuntu1.5
---
.github/workflows/ci-build.yml | 2 ++
makefile | 1 +
2 files changed, 3 insertions(+)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index e2f944b..21012dd 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -45,6 +45,8 @@ jobs:
run: |
sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
+ sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for soem reason...
+
python -V
ls -alt /usr/bin/python*
ls -alt
diff --git a/makefile b/makefile
index 1a1f807..e5ced7e 100755
--- a/makefile
+++ b/makefile
@@ -63,6 +63,7 @@ $(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@echo ' '
clean :
+ @echo 'Assuming Python: $(PYTHON_VER_MAIN)'
-$(RM) $(OBJECTS)$(CPP_DEPS) $(BUILDDIR)/$(TARGET)
-@echo ' '
From a93bb0cdd0183afe658f4682dbb5342992712528 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 4 Jul 2022 11:53:39 +0100
Subject: [PATCH 22/28] Use libc-bin=2.27-3ubuntu1.5
---
.github/workflows/ci-build.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 6df5cc9..c843aba 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
python-version: [ 3.7 ]
- runs-on: [ ubuntu-18.04, ubuntu-20.04 ]
+ runs-on: [ ubuntu-18.04 ]
steps:
- uses: actions/checkout@v2
@@ -50,6 +50,7 @@ jobs:
run: |
sudo apt install -y python3.7-dev freeglut3-dev libglu1-mesa-dev
+ sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for soem reason...
python -V
ls -alt
make clean
From 0db5dd34a6a26040c1a018c00609c06467fae986 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 4 Jul 2022 13:03:05 +0100
Subject: [PATCH 23/28] Just 18.04
---
.github/workflows/ci-build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 21012dd..65ca6eb 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: [ 3.7, 3.8 ]
- runs-on: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
+ python-version: [ 3.7 ]
+ runs-on: [ ubuntu-18.04 ]
steps:
- uses: actions/checkout@v2
From 27af21c28f9c0eae87078c96d6a9f0b6eaa2d347 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 4 Jul 2022 13:17:51 +0100
Subject: [PATCH 24/28] Typo
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 57a856c..6310282 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -44,7 +44,7 @@ jobs:
run: |
sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
- sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for soem reason...
+ sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
python -V
ls -alt /usr/bin/python*
From 77a46399649bbabd3150862e5d4feec46c3452c3 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 8 Jul 2022 18:31:55 +0100
Subject: [PATCH 25/28] Test on ubuntu-latest
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 6310282..013406f 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ ubuntu-18.04 ]
+ runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
From 1989074fc60055c7d88f355c18a0e03f53c4c867 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 8 Jul 2022 18:34:22 +0100
Subject: [PATCH 26/28] Update ci-build.yml
---
.github/workflows/ci-build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 013406f..80e7abb 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -44,7 +44,7 @@ jobs:
run: |
sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
- sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
+ #sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
python -V
ls -alt /usr/bin/python*
From ba1ac497a9709c7d9e8d40019f94486ce1c7e96e Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Fri, 26 Jan 2024 12:51:13 +0000
Subject: [PATCH 27/28] Update tests on gha branch
---
.github/workflows/ci-build-intel.yml | 81 ++++++++++++++++++++++++++++
.github/workflows/ci-build.yml | 70 ++++++++++++++++--------
2 files changed, 130 insertions(+), 21 deletions(-)
create mode 100644 .github/workflows/ci-build-intel.yml
diff --git a/.github/workflows/ci-build-intel.yml b/.github/workflows/ci-build-intel.yml
new file mode 100644
index 0000000..51b9b59
--- /dev/null
+++ b/.github/workflows/ci-build-intel.yml
@@ -0,0 +1,81 @@
+name: Build using Intel drivers
+
+on:
+ push:
+ branches: [ master, dev*, ow* ]
+ pull_request:
+ branches: [ master, dev, ow* ]
+
+jobs:
+
+ build:
+
+ runs-on: ${{ matrix.runs-on }}
+ strategy:
+ fail-fast: false
+ matrix:
+ runs-on: [ ubuntu-latest, ubuntu-20.04 ]
+
+ steps:
+ - name: Set git to use LF
+ run: |
+ git config --global core.autocrlf false
+ git config --global core.eol lf
+
+ - uses: actions/checkout@v3
+
+ - name: Install Intel OpenCL libraries needed for Sibernetic
+ run: |
+
+ lscpu
+
+ echo "Installing OpenCL Drivers"
+
+ # Based on: https://github.com/openworm/OpenWorm/blob/master/Dockerfile
+
+ mkdir intel-opencl-tmp
+ cd intel-opencl-tmp
+ mkdir intel-opencl
+ wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
+ unzip SRB5.0_linux64.zip
+ tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
+ tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
+ tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
+ sudo cp -R intel-opencl/* /
+ sudo ldconfig
+ cd ..
+ sudo rm -r intel-opencl-tmp
+
+ sudo cp -R /opt/intel/opencl/include/CL /usr/include/
+ sudo apt install -y ocl-icd-opencl-dev vim
+
+ echo "OpenCL Driver Installation Complete"
+
+
+ - name: Build Sibernetic
+ run: |
+
+ sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
+ #sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
+ python -V
+ ls -alt /usr/bin/python*
+ ls -alt
+ make clean
+ make
+
+ - name: Print Sibernetic help
+ run: |
+ ./Release/Sibernetic -h
+
+ - name: Print info on executable
+ run: |
+ ldd ./Release/Sibernetic
+
+ echo "NOTE: not running Sibernetic on GitHub actions test with Intel drivers. Seg faults."
+ ###./Release/Sibernetic -no_g timelimit=0.001
+
+ - name: Final version info
+ run: |
+
+ python -V
+ pip list
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 80e7abb..876bbf5 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -1,4 +1,4 @@
-name: Build Sibernetic
+name: Build using AMD drivers
on:
push:
@@ -14,51 +14,79 @@ jobs:
strategy:
fail-fast: false
matrix:
- runs-on: [ ubuntu-latest ]
+ runs-on: [ ubuntu-latest, ubuntu-20.04 ]
steps:
- - uses: actions/checkout@v2
+ - name: Set git to use LF
+ run: |
+ git config --global core.autocrlf false
+ git config --global core.eol lf
+
+ - uses: actions/checkout@v3
- - name: Install Intel OpenCL libraries needed for Sibernetic
+ - name: Install AMD OpenCL libraries needed for Sibernetic
run: |
+ lscpu
+
+ echo "Installing OpenCL Drivers"
+
+ # Legacy install of Intel's OpenCL Drivers:
# Based on: https://github.com/openworm/OpenWorm/blob/master/Dockerfile
+ # mkdir intel-opencl-tmp
+ # cd intel-opencl-tmp
+ # mkdir intel-opencl
+ # wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
+ # unzip SRB5.0_linux64.zip
+ # tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
+ # tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
+ # tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
+ # sudo cp -R intel-opencl/* /
+ # sudo ldconfig
+ # cd ..
+ # sudo rm -r intel-opencl-tmp
+
+ # sudo cp -R /opt/intel/opencl/include/CL /usr/include/
+ # sudo apt install -y ocl-icd-opencl-dev vim
+
+ # Install AMD's OpenCL Drivers (AMD-APP-SDK 3.0):
+ wget https://master.dl.sourceforge.net/project/nicehashsgminerv5viptools/APP%20SDK%20A%20Complete%20Development%20Platform/AMD%20APP%20SDK%203.0%20for%2064-bit%20Linux/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
+ tar -xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
+ printf 'Y\n\n' | sudo ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh
+
+ sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1 /usr/lib/libOpenCL.so.1
+ sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so /usr/lib/libamdocl64.so
+
+ sudo apt install -y ocl-icd-opencl-dev
- mkdir intel-opencl-tmp
- cd intel-opencl-tmp
- mkdir intel-opencl
- wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip
- unzip SRB5.0_linux64.zip
- tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz
- tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz
- tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz
- sudo cp -R intel-opencl/* /
- sudo ldconfig
- cd ..
- sudo rm -r intel-opencl-tmp
-
- sudo cp -R /opt/intel/opencl/include/CL /usr/include/
- sudo apt install -y ocl-icd-opencl-dev vim
+ echo "OpenCL Driver Installation Complete"
+
+ echo "CLINFO:"
+ clinfo
- name: Build Sibernetic
run: |
sudo apt install -y python3-dev freeglut3-dev libglu1-mesa-dev
#sudo apt install -y --allow-downgrades libc-bin=2.27-3ubuntu1.5 # Fails with 2.27-3ubuntu1.6 for some reason...
-
python -V
ls -alt /usr/bin/python*
ls -alt
make clean
make
+ - name: Print Sibernetic help
+ run: |
+ ./Release/Sibernetic -h
+
- name: Run quick Sibernetic test
run: |
ldd ./Release/Sibernetic
+
./Release/Sibernetic -no_g timelimit=0.001
- name: Final version info
run: |
-
+
python -V
pip list
From 4ef0e1ccdd6d28951f49e2170b84b36875f6d875 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Mon, 20 May 2024 10:50:31 +0100
Subject: [PATCH 28/28] Update versions of gh actions
---
.github/workflows/ci-build-intel.yml | 2 +-
.github/workflows/ci-build.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci-build-intel.yml b/.github/workflows/ci-build-intel.yml
index 51b9b59..74b972f 100644
--- a/.github/workflows/ci-build-intel.yml
+++ b/.github/workflows/ci-build-intel.yml
@@ -22,7 +22,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install Intel OpenCL libraries needed for Sibernetic
run: |
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 876bbf5..2bea855 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -22,7 +22,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Install AMD OpenCL libraries needed for Sibernetic
run: |