1. sptool is a quick way to compare standards to stellar spectra. Nice, I'd been looking for a tool like that.
2. GNU screen captions are useful especially when working in a screen-within-a-screen environment (who does that, really?)
3. finally got SPLAT to work... turns out I just hadn't reduced my damned data
4. kill -STOP and kill -CONT are really useful ways to pause programs that are sucking up resources if you want to resume them later. Haven't tried this on "real" code yet.
Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts
Monday, August 16, 2010
Saturday, May 1, 2010
RATRAN on Mac OS X
Mac OS X doesn't like the defaults built in to RATRAN. It died unhappily with errors like:
and
In order to get it to run, I had to do the following:
ld_classic: can't locate file for: -lcrt0.o and
ld: warning: in /usr/local/lib//libcfitsio.a, file is not of required architectureIn order to get it to run, I had to do the following:
- Install CFITSIO with
CFLAGS="-arch x86_64 -arch i386 -g -O2"to /usr/local/lib
- Edit the sky/Makefile OPT variable (line 23) to read:
OPT = -I. -O2 -fno-automatic -arch x86_64
export RATRAN=/path/to/Ratran
export RATRANRUN=/path/to/Ratran/run
Thursday, March 18, 2010
command line & escape key
Problem: in both the bash command line and ipython, if I hit escape twice, I can never again do history-search-backwards (i.e. when you type part of a command and type "up" and reverse-search through your command history). Any idea how to fix this?
Monday, March 1, 2010
Thursday, February 25, 2010
macvim crash
well, it finally happened.... my reliable, trusty editor crashed. That should be impossible. I am ready to call it quits for the week....
Process: MacVim [650]
Path: /Applications/Vim.app/Contents/MacOS/MacVim
Identifier: org.vim.MacVim
Version: 7.2 (49)
Code Type: X86 (Native)
Parent Process: Vim [649]
Date/Time: 2010-02-25 13:12:43.001 -0700
OS Version: Mac OS X 10.6.2 (10C540)
Report Version: 6
Interval Since Last Report: 871676 sec
Crashes Since Last Report: 26
Per-App Interval Since Last Report: 938504 sec
Per-App Crashes Since Last Report: 1
Anonymous UUID: 03159B9E-2257-4E38-8C4A-4D4DAF5641A7
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x99119480 __CFSetCallback + 0
1 com.apple.CoreFoundation 0x990c78bc ___CFBasicHashFindBucket1 + 444
2 com.apple.CoreFoundation 0x990cfaac CFBasicHashFindBucket + 252
3 com.apple.CoreFoundation 0x990e8293 CFSetGetValue + 131
4 com.apple.AppKit 0x961bae7e -[NSWindow _discardTrackingRect:] + 59
5 com.apple.AppKit 0x961badca -[NSView(NSInternal) _uninstallTrackingArea:] + 123
6 com.apple.AppKit 0x960d2c32 -[NSView(NSInternal) _uninstallRemovedTrackingAreas] + 293
7 com.apple.AppKit 0x960dac40 -[NSView(NSInternal) _updateTrackingAreas] + 646
8 com.apple.CoreFoundation 0x990ea4e0 CFArrayApplyFunction + 224
9 com.apple.AppKit 0x960daefb -[NSView(NSInternal) _updateTrackingAreas] + 1345
10 com.apple.CoreFoundation 0x990ea4e0 CFArrayApplyFunction + 224
11 com.apple.AppKit 0x960daefb -[NSView(NSInternal) _updateTrackingAreas] + 1345
12 com.apple.CoreFoundation 0x990ea4e0 CFArrayApplyFunction + 224
13 com.apple.AppKit 0x960daefb -[NSView(NSInternal) _updateTrackingAreas] + 1345
14 com.apple.AppKit 0x960da8db _handleInvalidCursorRectsNote + 392
15 com.apple.CoreFoundation 0x99135892 __CFRunLoopDoObservers + 1186
16 com.apple.CoreFoundation 0x990f218d __CFRunLoopRun + 557
17 com.apple.CoreFoundation 0x990f1864 CFRunLoopRunSpecific + 452
18 com.apple.CoreFoundation 0x990f1691 CFRunLoopRunInMode + 97
19 com.apple.HIToolbox 0x936f6f0c RunCurrentEventLoopInMode + 392
20 com.apple.HIToolbox 0x936f6bff ReceiveNextEventCommon + 158
21 com.apple.HIToolbox 0x936f6b48 BlockUntilNextEventMatchingListInMode + 81
22 com.apple.AppKit 0x960b0ac5 _DPSNextEvent + 847
23 com.apple.AppKit 0x960b0306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
24 com.apple.AppKit 0x9607249f -[NSApplication run] + 821
25 com.apple.AppKit 0x9606a535 NSApplicationMain + 574
26 org.vim.MacVim 0x0000238b _start + 209
27 org.vim.MacVim 0x000022b9 start + 41
Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x98d0c0ea kevent + 10
1 libSystem.B.dylib 0x98d0c804 _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x98d0bcc3 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x98d0ba68 _dispatch_worker_thread2 + 234
4 libSystem.B.dylib 0x98d0b4f1 _pthread_wqthread + 390
5 libSystem.B.dylib 0x98d0b336 start_wqthread + 30
Thread 2:
0 libSystem.B.dylib 0x98ce58da mach_msg_trap + 10
1 libSystem.B.dylib 0x98ce6047 mach_msg + 68
2 com.apple.CoreFoundation 0x990f277f __CFRunLoopRun + 2079
3 com.apple.CoreFoundation 0x990f1864 CFRunLoopRunSpecific + 452
4 com.apple.CoreFoundation 0x990f1691 CFRunLoopRunInMode + 97
5 com.apple.Foundation 0x91b24430 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 329
6 com.apple.Foundation 0x91aeb8d8 -[NSThread main] + 45
7 com.apple.Foundation 0x91aeb888 __NSThread__main__ + 1499
8 libSystem.B.dylib 0x98d12fbd _pthread_start + 345
9 libSystem.B.dylib 0x98d12e42 thread_start + 34
Thread 3:
0 libSystem.B.dylib 0x98d04856 select$DARWIN_EXTSN + 10
1 com.apple.CoreFoundation 0x99131ddd __CFSocketManager + 1085
2 libSystem.B.dylib 0x98d12fbd _pthread_start + 345
3 libSystem.B.dylib 0x98d12e42 thread_start + 34
Thread 4:
0 libSystem.B.dylib 0x98d0b182 __workq_kernreturn + 10
1 libSystem.B.dylib 0x98d0b718 _pthread_wqthread + 941
2 libSystem.B.dylib 0x98d0b336 start_wqthread + 30
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00515db0 ebx: 0x990c7711 ecx: 0x00516460 edx: 0xbfffcabc
edi: 0x00001041 esi: 0x00504270 ebp: 0xbfffca38 esp: 0xbfffc99c
ss: 0x0000001f efl: 0x00010246 eip: 0x99119480 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x97a20000
Wednesday, February 17, 2010
Sunday, February 14, 2010
Installing Snow Leopard
I'm going to attempt to install snow leopard today. This post will serve as a record of the difficulties I run into.
Things to install (and ensure they are 64-bit):
Things that have happened:
Things to install (and ensure they are 64-bit):
- ipython
- numpy
- scipy
- matplotlib
- stsci-python
- starlink
- gfortran
- latex
- idl (check)
Things that have happened:
- Had to restart again (twice) to install additional updates
- My bash command line looked funny - something about bash changed, but I don't know what. The fix was easy: commented out some code from http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html that I had been using to set the tab title
- My locate db broke. Needed repair:
sudo /usr/libexec/locate.updatedb - numpy svn failed to build:
python setup.py build
Running from numpy source directory.non-existing path in 'numpy/distutils': 'site.cfg'
F2PY Version 2_8111
numpy/core/setup_common.py:86: MismatchCAPIWarning: API mismatch detected, the C API version numbers have to be updated. Current C api version is 4, with checksum 59750b518272c8987f02d66445afd3f1, but recorded checksum for C API version 4 in codegen_dir/cversions.txt is 3d8940bf7b0d2a4e25be4338c14c3c85. If functions were added in the C API, you have to update C_API_VERSION in numpy/core/setup_common.pyc.
MismatchCAPIWarning)
blas_opt_info:
FOUND:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3)]
extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']
lapack_opt_info:
FOUND:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3)]
extra_compile_args = ['-faltivec']
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building library "npymath" sources
customize NAGFCompiler
Found executable /usr/local/bin/f95
customize AbsoftFCompiler
Could not locate executable f90
Found executable /usr/bin/f77
absoft: no Fortran 90 compiler found
absoft: no Fortran 90 compiler found
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Found executable /usr/local/bin/g77
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
C compiler: gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c'
gcc: _configtest.c
gcc _configtest.o -o _configtest
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
File "setup.py", line 210, in
setup_package()
File "setup.py", line 203, in setup_package
configuration=configuration )
File "/Users/adam/repos/numpy-svn/numpy/distutils/core.py", line 186, in setup
return old_setup(**new_attr)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/Users/adam/repos/numpy-svn/numpy/distutils/command/build.py", line 37, in run
old_build.run(self)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/Users/adam/repos/numpy-svn/numpy/distutils/command/build_src.py", line 152, in run
self.build_sources()
File "/Users/adam/repos/numpy-svn/numpy/distutils/command/build_src.py", line 163, in build_sources
self.build_library_sources(*libname_info)
File "/Users/adam/repos/numpy-svn/numpy/distutils/command/build_src.py", line 298, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "/Users/adam/repos/numpy-svn/numpy/distutils/command/build_src.py", line 385, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 670, in get_mathlib_info
raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
SOLUTION: Use the Mac OS X 10.6 python (/usr/bin/python). I will do this until I run into another problem. Numpy build successfully - Build/install matplotlib - failed! Completely!
- Acquired gcc/gfortran from hpc
- Followed instructions from hyperjeff on fortran install...
- Get rid of numpy 1.2.1:
mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/.not_numpy.bak - Try to install scipy. Fail on missing umfpack, follow hyperjeff's instructions (but make sure to edit the site.cfg in scipy, not just the one in numpy)
Had to add the following code:
sudo cp AMD/Lib/libamd.a /System/Library/Frameworks/Python.framework/Versions/2.6/lib
sudo cp UMFPACK/Lib/libumfpack.a /System/Library/Frameworks/Python.framework/Versions/2.6/lib
sudo cp AMD/Include/amd.h /System/Library/Frameworks/Python.framework/Versions/2.6/include
sudo cp UFconfig/UFconfig.h /System/Library/Frameworks/Python.framework/Versions/2.6/include
sudo cp UMFPACK/Include/*.h /System/Library/Frameworks/Python.framework/Versions/2.6/include - Installed fftw from fftw.org with simple ./configure, make, sudo make install - no compiler opts as they killed the install
- Get SoundSource from rogueamoeba
- Updated istatmenus
Thursday, November 19, 2009
wget
wget is very useful for acquiring data from, e.g., IRSA, the NASA Infrared Science Archive.
The important elements:
-nd: don't reproduce the host directory structure
-r: recursive. Grab the files referred to by the page, not just the page itself
-l#: number of recursion levels
-A: "accept" wildcard
wget -nd -r -l1 -A*g09*_b4_20.fits http://irsa.ipac.caltech.edu/data/IGA/images/The important elements:
-nd: don't reproduce the host directory structure
-r: recursive. Grab the files referred to by the page, not just the page itself
-l#: number of recursion levels
-A: "accept" wildcard
Wednesday, October 21, 2009
New python software
Wednesday, August 26, 2009
cython vs f2py
I had a go at optimizing some code this past week, and ended up learning to use both cython and f2py.
f2py is much easier to use. If you want to write a function in fortran and use it in python, all you do is write the code and add specifications using comments in the fortran code.
cython is more natural to code. The code style is C/fortran-like: think in terms of loops instead of arrays. The syntax is python-like, which makes coding somewhat clearer and simpler.
For my code, I found that cython was ~10% slower than fortran.
Check out the plfits in:
http://code.google.com/p/agpy/source/browse/#svn/trunk/
f2py is much easier to use. If you want to write a function in fortran and use it in python, all you do is write the code and add specifications using comments in the fortran code.
cython is more natural to code. The code style is C/fortran-like: think in terms of loops instead of arrays. The syntax is python-like, which makes coding somewhat clearer and simpler.
For my code, I found that cython was ~10% slower than fortran.
Check out the plfits in:
http://code.google.com/p/agpy/source/browse/#svn/trunk/
Wednesday, August 12, 2009
Quicksilver sounds
To switch sound source from the command line:
switchaudio
Use this to make scripts such as:
Then make triggers in Quicksilver by:
Follow-up: You can also control the volume!
http://discussions.apple.com/thread.jspa?threadID=585781
switchaudio
Use this to make scripts such as:
#!/bin/bash
/Users/adam/humor/SwitchAudioSource -s "Built-in Line Output"
afplay /Users/adam/humor/losinghorn.wav
/Users/adam/humor/SwitchAudioSource -s "Built-in Output"
Then make triggers in Quicksilver by:
- Go to trigger pane, make new hotkey trigger
- press "." to allow you to type a command
- make sure the action is "Run"
- hook up a hotkey
- if it doesn't work, just try again. Persist through crashes, they happen often.
Follow-up: You can also control the volume!
http://discussions.apple.com/thread.jspa?threadID=585781
osascript -e 'set volume output volume 100'
Sunday, July 5, 2009
Failure to compile 64 bit gtk on mac os
Attempted to install gtk+-2.17.2 on my mac. Had to install:
glib-2.21.2
which would not let me compile with multiple architectures, and
pkgconfig-0.9.0,
which won't configure because:
which is bs because I don't have any compiler flags set.
So, gtk+ seems hopeless.
UPDATE: 0.9.0 is not the latest version, 0.23.0 is. Dumb version numbering.
GTK is absurd to install. You need:
pkg-config
glib
cairo
pixman
pango (MUST be installed AFTER cairo)
atk
libtiff
libjpg
jpeg2000 - but I just passed a flag to not do this because it didn't install right. --without-libjasper
fontconfig I mean, really? at this point it's just ridiculous....
and finally, it died with this:
checking Pango flags... configure: error:
*** Pango not found. Pango built with Cairo support is required
*** to build GTK+. See http://www.pango.org for Pango information.
which meant that I had to reinstall Pango because I had installed it before Cairo.
I believe this is where the term dependency hell comes from.
Also, I don't think any of these are x86-64 compatible.
Then I'm STILL not done.
PyGTK dies with an import error on dsextras, which a painful google search traces to pygobject. pygobject makes and installs fine.... but then I find out it installed to /usr/local/lib/python2.6/site-packages/gtk-2.0/, which is obviously not on my python path since I installed a framework.
So:
./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.6/
in both pygobject and pygtk.
Oh, guess what? Need pycairo too. What happens there? What you'd guess:
ld warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libcairo.dylib, file is not of required architecture
so when I configure pygtk:
The following modules will be built:
atk
pango
The following modules will NOT be built:
pangocairo
gtk
gtk.glade
gtk.unixprint
Damn. That blows.
python-64 -c "import gtk"
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: mach-o, but wrong architecture
FAIL.
glib-2.21.2
which would not let me compile with multiple architectures, and
pkgconfig-0.9.0,
which won't configure because:
configure: configuring in glib-1.2.8
configure: running /bin/sh './configure' --prefix=/usr/local CC= CFLAGS= LDFLAGS= --cache-file=/dev/null --srcdir=.
configure: warning: CC=: invalid host type
configure: warning: CFLAGS=: invalid host type
configure: error: can only configure for one host and one target at a time
configure: error: /bin/sh './configure' failed for glib-1.2.8
which is bs because I don't have any compiler flags set.
So, gtk+ seems hopeless.
UPDATE: 0.9.0 is not the latest version, 0.23.0 is. Dumb version numbering.
GTK is absurd to install. You need:
pkg-config
glib
cairo
pixman
pango (MUST be installed AFTER cairo)
atk
libtiff
libjpg
jpeg2000 - but I just passed a flag to not do this because it didn't install right. --without-libjasper
fontconfig I mean, really? at this point it's just ridiculous....
and finally, it died with this:
checking Pango flags... configure: error:
*** Pango not found. Pango built with Cairo support is required
*** to build GTK+. See http://www.pango.org for Pango information.
which meant that I had to reinstall Pango because I had installed it before Cairo.
I believe this is where the term dependency hell comes from.
Also, I don't think any of these are x86-64 compatible.
Then I'm STILL not done.
PyGTK dies with an import error on dsextras, which a painful google search traces to pygobject. pygobject makes and installs fine.... but then I find out it installed to /usr/local/lib/python2.6/site-packages/gtk-2.0/, which is obviously not on my python path since I installed a framework.
So:
./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.6/
in both pygobject and pygtk.
Oh, guess what? Need pycairo too. What happens there? What you'd guess:
ld warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libcairo.dylib, file is not of required architecture
so when I configure pygtk:
The following modules will be built:
atk
pango
The following modules will NOT be built:
pangocairo
gtk
gtk.glade
gtk.unixprint
Damn. That blows.
python-64 -c "import gtk"
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: mach-o, but wrong architecture
FAIL.
Thursday, July 2, 2009
Installing 64 bit tcl/tk on Mac OS X
Everything is described in this post:
http://www.nabble.com/Error-compiling-tk-8.5.7-on-Mac-OS-X-10.5-td23790967.html
But here's a script too:
Concerns:
-might be necessary to do this in the macosx directory for some reason, though Aqua doesn't support 64 bits
-have to recompile python to get _tkinter to work (see a later post)
http://www.nabble.com/Error-compiling-tk-8.5.7-on-Mac-OS-X-10.5-td23790967.html
But here's a script too:
curl -O 'http://osdn.dl.sourceforge.net/sourceforge/tcl/t{cl,k}8.5.7-src.tar.gz'
for f in t*8.5.7*.gz; do tar zxf $f; done
cd tcl8.5.7/unix/
./configure --enable-framework --enable-64-bit
cd tk8.5.7/unix/
./configure --enable-framework --enable-64-bit
make -j 4 -C tcl8.5.7/unix
make -j 4 -C tk8.5.7/unix
sudo make install -C tcl8.5.7/unix
sudo make install -C tk8.5.7/unix
Concerns:
-might be necessary to do this in the macosx directory for some reason, though Aqua doesn't support 64 bits
-have to recompile python to get _tkinter to work (see a later post)
Wednesday, May 6, 2009
Quicksilver and Awesome
Set up f17-19 today to play amusing sounds. Also, recalled that I use ScreenSaverEngine to lock my screen with a shortcut key.
Quicksilver triggers are the way to do it. Mac is stupid w/o quicksilver.
Quicksilver triggers are the way to do it. Mac is stupid w/o quicksilver.
Tuesday, April 21, 2009
Python 64 bit!
I got python 64 bit to compile, but it required a number of tricky steps.
First, this guy has the instructions I followed:
captnswing
However, it didn't work entirely as advertised. I ran the configure as advertised:
then the make install, but /usr/local/bin/python pointed to the wrong place, so I replaced the symbolic link in my python path with the correct one:
Now python is 64 bit:
I haven't checked whether it works yet though...
Update: Had to reinstall with gnu readline installed. Also have to install PyQt4 and might have to recompile numpy...
numpy won't compile with python 2.6.2:
That sucks.
First, this guy has the instructions I followed:
captnswing
However, it didn't work entirely as advertised. I ran the configure as advertised:
./configure --enable-framework=/Library/Frameworks \
--enable-universalsdk=/ \
MACOSX_DEPLOYMENT_TARGET=10.5 \
--with-universal-archs=all \
--with-readline-dir=/usr/local
then the make install, but /usr/local/bin/python pointed to the wrong place, so I replaced the symbolic link in my python path with the correct one:
sudo rm /Library/Frameworks/Python.framework/Versions/2.6/bin/python
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/python-64 /Library/Frameworks/Python.framework/Versions/2.6/bin/python
Now python is 64 bit:
eta ~$ python -c "import sys; print sys.maxint"
9223372036854775807
I haven't checked whether it works yet though...
Update: Had to reinstall with gnu readline installed. Also have to install PyQt4 and might have to recompile numpy...
numpy won't compile with python 2.6.2:
C compiler: gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot / -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
compile options: '-Inumpy/core/include -Ibuild/src.macosx-10.5-universal-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c'
gcc: build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.c
In file included from numpy/core/include/numpy/ndarrayobject.h:26,
from numpy/core/include/numpy/noprefix.h:7,
from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
lipo: can't figure out the architecture type of: /var/folders/ni/ni+DtdqFGMeSMH13AvkNkU+++TI/-Tmp-//cceaWIvZ.out
In file included from numpy/core/include/numpy/ndarrayobject.h:26,
from numpy/core/include/numpy/noprefix.h:7,
from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
lipo: can't figure out the architecture type of: /var/folders/ni/ni+DtdqFGMeSMH13AvkNkU+++TI/-Tmp-//cceaWIvZ.out
error: Command "gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot / -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Inumpy/core/include -Ibuild/src.macosx-10.5-universal-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.c -o build/temp.macosx-10.5-universal-2.6/build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.o" failed with exit status 1
That sucks.
Monday, April 20, 2009
Hosting on my mac
I'm hosting my website off my mac; it should be accessible to the outside world now: eta.colorado.edu.
A few things went into this....
A few things went into this....
- Don't install the fink version. The two versions clash and depending on how you access your computer you could end up looking at entirely different directories (e.g. localhost and eta.colorado.edu referred to different sites for a while)
- The configuration file is /private/etc/apache2/httpd.conf
- I needed to change DirectoryIndex to index.htm (from index.html)
- uncommmented "LoadModule php5_module libexec/apache2/libphp5.so"
- had to allow override so that .htaccess files would work.
Wednesday, April 15, 2009
Mac stuff cont'd
Trying to get Apache server to run, and it's just a pain.
I frequently forget how to update the locate database because it's different on macs. Marcos' Mac Singularity has the instructions .
In short:
I frequently forget how to update the locate database because it's different on macs. Marcos' Mac Singularity has the instructions .
In short:
sudo /usr/libexec/locate.updatedb
Tuesday, April 14, 2009
Google has failed me
So, either no one on the internet has successfully installed 64-bit python on a mac (which I find nothing short of impossible) or google has totally failed. None of the hits for any combination of 64 bit, python, mac, etc. has shown a useful result. Wow.
Monday, November 24, 2008
.inputrc
New unix stuff!
This is, again, stuff I'd searched for forever but never found the right collection of terms. This is what bash readline is REALLY all about.
if you make an inputrc file, you can get awesome readline capabilities (similar to ipython). This post at lifehacker showed me how to do it. This site has a more complete description of how to use readline/inputrc.
Even better: VI command line editing .
There's also something called magic space but I don't know what purpose it serves all the time... it will replace 'magic' characters like !* and !& and !! with whatever command they represent if you hit space immediately after typing them (explained better here).
Wow. Awesome.
This is, again, stuff I'd searched for forever but never found the right collection of terms. This is what bash readline is REALLY all about.
if you make an inputrc file, you can get awesome readline capabilities (similar to ipython). This post at lifehacker showed me how to do it. This site has a more complete description of how to use readline/inputrc.
Even better: VI command line editing .
There's also something called magic space but I don't know what purpose it serves all the time... it will replace 'magic' characters like !* and !& and !! with whatever command they represent if you hit space immediately after typing them (explained better here).
Wow. Awesome.
Thursday, November 20, 2008
MOVIES!
Making movies is surprisingly difficult. No matter what language you use, apparently true movie files can only be made by stringing together images, i.e. there is no native movie-producing feature. Gnuplot can do some simple animations but to do anything sophisticated you need to start delving into variables, and for that I switch to a real language.
So, I returned to python. As usual, it took no more than a few hours of coding and learning to come up with something. But it bothers me that it took that long: I still think python is most deficient in its failure to create a default column-text reader like 'readcol' in IDL. I can't complain that much, though: I wrote my own in about 5 minutes.
Anyway, the key is to use the
I use
ImageMagick's convert can be used to stitch any kind of image into a movie given that you've installed an mpeg2 encoder (fink gave me
I had to use a smaller image size because a series of 1000x12kb files somehow chomped ~6-8 GB of RAM and swap space.
So, I returned to python. As usual, it took no more than a few hours of coding and learning to come up with something. But it bothers me that it took that long: I still think python is most deficient in its failure to create a default column-text reader like 'readcol' in IDL. I can't complain that much, though: I wrote my own in about 5 minutes.
Anyway, the key is to use the
.set_xdata and .set_ydata functions of a plot to update a canvas. I still don't have nearly as high a plotting speed as I'd like, but it works alright if I don't display to screen. Probably a different backend would be more effective but I don't like to mess with backends.I use
savefig(filename,dpi=50) to reduce the image quality so that it's easier for the animator to handle.ImageMagick's convert can be used to stitch any kind of image into a movie given that you've installed an mpeg2 encoder (fink gave me
mpeg2vidcodec ). The command is very simple:
convert -size 300x300 *.png movie.mpg
I had to use a smaller image size because a series of 1000x12kb files somehow chomped ~6-8 GB of RAM and swap space.
Subscribe to:
Posts (Atom)