Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Michael Hirsch scivision

💭
I may be slow to respond.
View GitHub Profile
@scivision
scivision / configure.output.mpich
Last active Feb 22, 2021
Intel oneAPI MacOS 11.x: Trying to get MPI library working (MPICH, or OpenMPI)
View configure.output.mpich
$ git clone https://github.com/pmodels/mpich.git
$ git checkout v3.4.1
$ ./configure --prefix=$HOME/mpich-3.4.1 --disable-cxx
# NOTE: if CPPFLAGS not set, configure will fail in HWLOC. There is some bug in mpich/configure that just requires CPPFLAGS.
#
# configure complete, but make fails instantly:
$ make
@scivision
scivision / image_stack_hdf5.m
Last active Feb 18, 2021
HDF5 image stack writing, suitable for HDFView video player
View image_stack_hdf5.m
Simg = load('clown');
imgs = Simg.X;
file = 'img.h5';
name = '/img';
h5create(file, name, size(imgs))
h5write(file, name, imgs)
h5writeatt(file, name, 'CLASS', 'IMAGE')
@scivision
scivision / CMakeLists.txt
Last active Feb 17, 2021
CMake pkg-config .pc.in generate template
View CMakeLists.txt
# this fragment generates build/my_package.pc
#
# cmake -B build -DCMAKE_INSTALL_PREFIX=~/mylib
cmake_minimum_required(VERSION 3.0)
project(mylib
LANGUAGES C
HOMEPAGE_URL https://github.invalid/username/mylib
DESCRIPTION "example library"
@scivision
scivision / TestAll.m
Created Feb 17, 2021
Matlab CI on Azure Pipelines
View TestAll.m
% this script is run on Azure (or local)
import matlab.unittest.TestRunner
import matlab.unittest.Verbosity
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.XMLPlugin
import matlab.unittest.plugins.codecoverage.CoberturaFormat
name = "MyProject";
suite = testsuite(name);
@scivision
scivision / ci_cmake.yml
Created Feb 14, 2021
GitHub Actions CI MSYS2 with MS-MPI on Windows
View ci_cmake.yml
name: CI CMake
on:
push:
- "**/CMakeLists.txt"
- "**.cmake"
- "**.cmake.in"
- "**.c"
- "**.h"
- "**.h.in"
@scivision
scivision / _redirects
Last active Feb 15, 2021
Netlify public/_redirects for bot log diversion
View _redirects
# This file is for use with a Hugo blog.
# be careful using this on real-life site, so that the patterns below don't dump legitimate traffic!
# we use 410 to be more aggressive than 404, and to unclutter Netlify statistics
/.env /bot.html 410
/blog.zip /bot.html 410
/.git/* /bot.html 410
/browserconfig.xml /bot.html 410
/OLD/* /bot.html 410
/404.html /bot.html 410
@scivision
scivision / windows_openssh_authorized_keys_acl.ps1
Created Aug 11, 2020
Set permissions ACL for Windows OpenSSH administrators_authorized_keys
View windows_openssh_authorized_keys_acl.ps1
# this script is copied from:
# https://www.concurrency.com/blog/may-2019/key-based-authentication-for-openssh-on-windows
# Script by Mitchell Grande of Concurrency.com
#
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
$acl.SetAccessRuleProtection($true, $false)
$administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow")
$systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow")
$acl.SetAccessRule($administratorsRule)
$acl.SetAccessRule($systemRule)
@scivision
scivision / gfortran7wsl:testlog.txt
Last active Dec 1, 2019
Gemini Meson test false failures
View gfortran7wsl:testlog.txt
$ meson test -C build --suite 2d_fang -v
ninja: Entering directory `/mnt/c/code/gemini/build'
[13/13] Linking target gemini_glow.bin.
/mnt/c/code/gemini/build/gemini_fang.bin Process: 0 / 0
/mnt/c/code/gemini/build/gemini_fang.bin Process: 0 / 0
/mnt/c/code/gemini/build/gemini_fang.bin Process: 0 / 0
/mnt/c/code/gemini/build/gemini_fang.bin Process: 0 / 0
/mnt/c/code/gemini/build/gemini_fang.bin Process: 0 / 0
/mnt/c/code/gemini/initialize/test2d_fang/config.nml: simulation ymd is: 2013/02/20
/mnt/c/code/gemini/initialize/test2d_fang/config.nml: simulation ymd is: 2013/02/20
@scivision
scivision / cmake_build_macos.log
Created Aug 16, 2019
Gemini build and test: MacOS with CMake
View cmake_build_macos.log
# MacOS 10.14.6
$ cmake --version
cmake version 3.15.2
$ git rev-parse --short HEAD
bf39419
$ cmake -B build_cmake
-- The C compiler identification is AppleClang 10.0.1.10010046
@scivision
scivision / CMakeError.log
Last active Jul 30, 2019
Gemini GLOW errors on git rev 99c41d18
View CMakeError.log
$ ctest --output-on-failure
Test project /home/box/code/gemini/build
Start 7: MPIexist
1/13 Test #7: MPIexist ......................... Passed 0.61 sec
Start 8: MUMPS
2/13 Test #8: MUMPS ............................ Passed 1.02 sec
Start 11: DateFormats
3/13 Test #11: DateFormats ...................... Passed 0.04 sec
Start 1: GeminiGlow2D-NP2
4/13 Test #1: GeminiGlow2D-NP2 ................. Passed 77.08 sec