Skip to content

Instantly share code, notes, and snippets.

@cstich
cstich / Julia 1.6
Created March 25, 2021 10:19
Builds Julia 1.6 as a pacakge in my overlays
{ stdenv, fetchurl, fetchzip, fetchFromGitHub
# build tools
, gfortran, m4, makeWrapper, patchelf, perl, which, python2
, cmake
# libjulia dependencies
, libunwind, readline, utf8proc, zlib
# standard library dependencies
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
# linear algebra
, blas, lapack, arpack
@cstich
cstich / try_install_load.R
Created December 9, 2016 12:10
A function for installing R packages if you don't already have them installed.
# Only install packages when you can't find them
try.install.load = function(pack.name, libpath=.libPaths()[1]) {
t = try(library(pack.name, lib.loc = libpath, character.only = TRUE))
if("try-error" %in% class(t)) {
install.packages(pack.name, lib = libpath)
library(pack.name, lib.loc = libpath, character.only = TRUE)
}
}