Skip to content

Instantly share code, notes, and snippets.

View derekbrokeit's full-sized avatar

Derek Ashley Thomas derekbrokeit

  • Moffett Field, CA
View GitHub Profile
@derekbrokeit
derekbrokeit / lammps_open_mpi.diff
Created December 20, 2012 11:13
install lammps with open-mpi
diff --git a/src/MAKE/Makefile.mac b/src/MAKE/Makefile.mac
index 42f5882..2f0f42a 100755
--- a/src/MAKE/Makefile.mac
+++ b/src/MAKE/Makefile.mac
@@ -6,18 +6,18 @@ SHELL = /bin/sh
# compiler/linker settings
# specify flags and libraries needed for your compiler
-CC = c++
-CCFLAGS = -O
@derekbrokeit
derekbrokeit / lammps_explicit_library_location_call.diff
Created January 9, 2013 10:49
Explicitly call the library based on the homebrew prefix location. This is best for users who do not use the standard homebrew installation directory.
diff --git a/python/lammps.py b/python/lammps.py
index c65e84c..b2b28a2 100644
--- a/python/lammps.py
+++ b/python/lammps.py
@@ -23,8 +23,8 @@ class lammps:
# if name = "g++", load liblammps_g++.so
try:
- if not name: self.lib = CDLL("liblammps.so",RTLD_GLOBAL)
- else: self.lib = CDLL("liblammps_%s.so" % name,RTLD_GLOBAL)
@derekbrokeit
derekbrokeit / variable_env.diff
Created January 29, 2013 07:37
Add "environment" style to variables. Allows the user to import variables directly from the environment. It should be noted that this was just an experiment. I have since found that the `-v` commandline flag is the best way to do this. The problem with environment variables here is that 1) it does not handle array data well `export blah=(1 2 3)`…
diff --git a/src/variable.cpp b/src/variable.cpp
index d60accc..b52220c 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -43,7 +43,7 @@ using namespace MathConst;
#define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a)
-enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,FILEVAR,EQUAL,ATOM};
+enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,FILEVAR,EQUAL,ATOM,ENVIRONMENT};
@derekbrokeit
derekbrokeit / user-omp_bsd.patch
Created February 12, 2013 02:18
Building LAMMPS with the USER-OMP package is broken in lammps-11Feb13 because of the difference between GNU sed and BSD sed.
diff --git a/src/USER-OMP/Install.sh b/src/USER-OMP/Install.sh
old mode 100644
new mode 100755
index b37fd00..dd87e8b
--- a/src/USER-OMP/Install.sh
+++ b/src/USER-OMP/Install.sh
@@ -4,7 +4,7 @@
# do not install child files if parent does not exist
for file in *_omp.cpp *_omp.h ; do
@derekbrokeit
derekbrokeit / pymol_disable_vmd_plugin.diff
Created February 16, 2013 09:47
Disable VMD plugin in pymol
diff --git a/setup.py b/setup.py
index b8d7070..46d9087 100644
--- a/setup.py
+++ b/setup.py
@@ -118,7 +118,7 @@ lib_dirs = []
ext_comp_args = []
ext_link_args = []
-if True:
+if False:
@derekbrokeit
derekbrokeit / povray_install_failure
Created February 25, 2013 05:50
Homebrew povray installation failure
==> Downloading http://www.povray.org/beta/source/povray-3.7.0.RC6.tar.gz
Already downloaded: /Library/Caches/Homebrew/povray-3.7.0.RC6.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/povray-3.7.0.RC6.tar.gz
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.9.4 (Ruby 1.8.7-358; Mac OS X 10.8.2) https://trac.macports.org/export/102440/trunk/dports/graphics/povray/files/patch-boost-1.50.diff -o 000-homebrew.diff https://trac.macports.org/export/102440/trunk/dports/graphics/povray/files/patch-configure-stat.diff -o 001-homebrew.diff https://trac.macports.org/export/102440/trunk/dports/graphics/povray/files/patch-lseek64.diff -o 002-homebrew.diff https://trac.macports.org/export/102440/trunk/dports/graphics/povray/files/patch-vfe-uint.diff -o 003-homebrew.diff --silent
==> Patching
/usr/bin/patch -f -p0 -i 000-homebrew.diff
patching file source/backend/scene/view.cpp
patching file source/base/timer.cpp
patching file vfe/unix/platformbase.cpp
@derekbrokeit
derekbrokeit / python_disable_x11_lib.diff
Created April 16, 2013 08:09
Disable automatically linking to x11 in python installation.
diff --git a/setup.py b/setup.py
index ea8a5f5..5460fb9 100644
--- a/setup.py
+++ b/setup.py
@@ -1897,8 +1897,8 @@ class PyBuildExt(build_ext):
libs.append('ld')
# Finally, link with the X11 libraries (not appropriate on cygwin)
- if host_platform != "cygwin":
- libs.append('X11')
@derekbrokeit
derekbrokeit / torch7_serial.rb
Created May 24, 2013 08:14
A homebrew formula copy of torch7 that builds without OpenMP support. Additionally, it builds with significantly reduced dependencies.
require 'formula'
class Torch7 < Formula
homepage 'http://www.torch.ch/'
head 'https://github.com/andresy/torch.git'
url 'https://github.com/andresy/torch/archive/7.0.3-0.zip'
version '7.0.3-0'
sha1 'd455003b3f632ffd5062f98de774479c1de57607'
depends_on 'cmake' => :build
@derekbrokeit
derekbrokeit / lammps_airebo_test.diff
Created June 13, 2013 04:10
Testing extent to which airebo can be modified for better graphite
diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp
index 6e1edb1..1d491d0 100644
--- a/src/MANYBODY/pair_airebo.cpp
+++ b/src/MANYBODY/pair_airebo.cpp
@@ -709,6 +709,9 @@ void PairAIREBO::FLJ(int eflag, int vflag)
rljmax = sigcut * rljmin;
rljmin = sigmin * rljmin;
+ rljmin = 3.816370964251868;
+ rljmax = cutlj * sigma[itype][jtype];
@derekbrokeit
derekbrokeit / h5py_failed_tests.log
Created July 17, 2013 00:07
h5py failure on opensuse. hdf5 (1.8.11) and python (2.7.4) built by linuxbrew Same as: https://github.com/h5py/h5py/issues/304
...........................................sss...............................................E.....EFF..F....F.Es.......................................................................................x.............................................
======================================================================
ERROR: test_create_scale (h5py._hl.tests.test_dimension_scales.TestDimensionManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/derekt/.linuxbrew/lib/python2.7/site-packages/h5py/_hl/tests/test_dimension_scales.py", line 101, in test_create_scale
self.assertEqual(self.f['data'].dims[2]['foobar'], self.f['x1'])
File "/home/derekt/.linuxbrew/lib/python2.7/site-packages/h5py/_hl/dims.py", line 54, in __getitem__
raise KeyError('%s not found' % item)
KeyError: 'foobar not found'