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 / 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 / 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 / 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 / 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_fftw-none.diff
Created December 20, 2012 08:10
build lammps with no fftw
diff --git a/src/MAKE/Makefile.mac b/src/MAKE/Makefile.mac
index ccefa59..42f5882 100755
--- a/src/MAKE/Makefile.mac
+++ b/src/MAKE/Makefile.mac
@@ -48,9 +48,9 @@ MPI_LIB = -lmpi_stubs
# PATH = path for FFT library
# LIB = name of FFT library
-FFT_INC = -DFFT_FFTW
+FFT_INC = -DFFT_NONE
@derekbrokeit
derekbrokeit / fix-config-sx9.diff
Created December 20, 2012 00:06
Fix the configure scripts (config.guess and config.sub) to support NEC-SX9
diff --git a/config.guess b/config.guess
index d622a44..5dd0df7 100755
--- a/config.guess
+++ b/config.guess
@@ -1219,6 +1219,12 @@ EOF
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
+ SX-9:SUPER-UX:*:*)
+ echo sx9-nec-superux${UNAME_RELEASE}
@derekbrokeit
derekbrokeit / build-fftw3-nec-sx.sh
Last active December 9, 2015 23:08
configure fftw on nec-sx platform ... why do you taunt me?! The diff file is here: https://gist.github.com/4341920 If the machine has a permission error, just move to the "builder" directory and run `make && make install` again ... and again ... and again .. until it finally works
#!/bin/sh
# fix the configure files
patch -p1 config.guess < fix-config-sx9.diff
# make the build directory
mkdir -p builder
cd builder
# configure
diff --git a/setup.py b/setup.py
index 6b47451..0bfca0c 100644
--- a/setup.py
+++ b/setup.py
@@ -620,7 +620,7 @@ class PyBuildExt(build_ext):
missing.extend(['imageop'])
# readline
- do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
+ do_readline = '/usr/local/opt/readline/lib/libhistory.dylib'
@derekbrokeit
derekbrokeit / python_setup_NO_tkinter-framework.diff
Created December 17, 2012 03:21
Build Python without OSX Tkinter Framework auto detection
diff --git a/setup.py b/setup.py
index 6b47451..51cc779 100644
--- a/setup.py
+++ b/setup.py
@@ -1702,9 +1702,9 @@ class PyBuildExt(build_ext):
# AquaTk is a separate method. Only one Tkinter will be built on
# Darwin - either AquaTk, if it is found, or X11 based Tk.
platform = self.get_platform()
- if (platform == 'darwin' and
- self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
@derekbrokeit
derekbrokeit / gist:4269280
Created December 12, 2012 16:29
patch for pymol pmg_tk to install on OSX with free glut
--- pymol/modules/pmg_tk/skins/normal/__init__.py 2012-12-13 01:19:10.000000000 +0900
+++ pymol_new/modules/pmg_tk/skins/normal/__init__.py 2012-12-13 01:15:42.000000000 +0900
@@ -250,7 +250,7 @@
self.buttonArea.destroy()
def my_show(self,win,center=1):
- if sys.platform!='linux2':
+ if (sys.platform!='linux2') and (sys.platform!='darwin'):
win.show()
else: # autocenter, deiconify, and run mainloop