This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from setuptools import setup | |
import subprocess | |
import sys,os | |
with open('requirements.txt', 'r') as f: | |
req = f.read().split('\n') | |
req = [os.path.basename(sys.executable) + '-' + r for r in req if r] | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build like: | |
// clang hw.c -framework Foundation -framework IOKit | |
// ./a.out then gives with an M1 Apple Silicon CPU: | |
// | |
// cpu0@0(E): apple,icestorm | |
// cpu1@0(E): apple,icestorm | |
// cpu2@0(E): apple,icestorm | |
// cpu3@0(E): apple,icestorm | |
// cpu4@1(P): apple,firestorm | |
// cpu5@1(P): apple,firestorm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run_command('python', 'meson_file_download.py', url, zipfn, '-hash', 'md5', md5hash, check: true) | |
run_command('python', 'meson_file_extract.py', zipfn, outpath, check: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gitattributes text eol=lf | |
.gitignore text eol=lf | |
*.build text eol=lf | |
*.c text eol=lf | |
*.cmake text eol=lf | |
*.cpp text eol=lf | |
*.csv text eol=lf | |
*.f text eol=lf | |
*.f90 text eol=lf | |
*.for text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prepend = mingw_octave_path() | |
% for Octave on Windows, it's necessary to prepend MinGW path | |
% when running MinGW-compiled executables | |
% Also, Matlab with Parallel Toolbox MPIEXEC conflicts with system MPIEXEC, | |
% so excise from Path | |
% | |
% a command is then run like | |
% | |
% system([prepend, ' ', 'foo.exe']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.22) | |
project(envPrint LANGUAGES NONE) | |
enable_testing() | |
add_test(NAME PrintEnv COMMAND ${CMAKE_COMMAND} -E environment) | |
set_tests_properties(PrintEnv PROPERTIES | |
ENVIRONMENT_MODIFICATION "NotExistingVar=path_list_prepend:WillSegfault") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this must be include() before CMakeLists.txt project() | |
# --- Help CMake find matching compilers | |
function(find_fortran) | |
if(NOT DEFINED FC AND DEFINED ENV{FC}) | |
set(FC $ENV{FC}) | |
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(ctest_once_only) | |
# check if CTest already running, error if so | |
if(WIN32) | |
find_program(tasklist NAMES tasklist REQUIRED) | |
execute_process(COMMAND ${tasklist} /fi "Imagename eq ctest.exe" /fo csv | |
TIMEOUT 10 | |
RESULT_VARIABLE ret | |
OUTPUT_VARIABLE out | |
OUTPUT_STRIP_TRAILING_WHITESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find and hint Fortran compiler via ENV{FC}. | |
# ENV{FC} is picked up by project(). | |
# This is needed for CI GitHub Actions, | |
# which purposely doesn't have an alias for "gfortran" | |
include_guard(GLOBAL) | |
if(DEFINED ENV{CI}) | |
set(CI $ENV{CI}) | |
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMake projects may not find Homebrew's newer Bison since MacOS has an old Bison on PATH. | |
# this CMake script emits the location of Homebrew's Bison if available. | |
# | |
# brew install bison | |
function(bison_homebrew) | |
find_program(brew NAMES brew) | |
if(NOT brew) | |
return() |