[Yt-svn] yt-commit r678 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Thu Jul 17 13:21:39 PDT 2008
Author: mturk
Date: Thu Jul 17 13:21:39 2008
New Revision: 678
URL: http://yt.spacepope.org/changeset/678
Log:
Changing the means of specifying HDF5 installation to give precedence to
HDF5_DIR env var.
Modified:
trunk/yt/lagos/setup.py
Modified: trunk/yt/lagos/setup.py
==============================================================================
--- trunk/yt/lagos/setup.py (original)
+++ trunk/yt/lagos/setup.py Thu Jul 17 13:21:39 2008
@@ -3,9 +3,12 @@
import os, sys, os.path
import os.path
-try:
- H5dir = open("hdf5.cfg").read().strip().rstrip()
-except:
+
+def check_for_hdf5():
+ if "HDF5_DIR" in os.environ:
+ return os.environ["HDF5_DIR"]
+ elif os.path.exists("hdf5.cfg"):
+ return open("hdf5.cfg").read().strip().rstrip()
print "Reading HDF5 location from hdf5.cfg failed."
print "Please place the base directory of your HDF5 install in hdf5.cfg and restart."
print "(ex: \"echo '/usr/local/' > hdf5.cfg\" )"
@@ -17,14 +20,16 @@
config.make_config_py() # installs __config__.py
config.add_extension("PointCombine", "yt/lagos/PointCombine.c", libraries=["m"])
config.add_subpackage("hop")
+ H5dir = check_for_hdf5()
if H5dir is not None:
include_dirs=[os.path.join(H5dir,"include")]
library_dirs=[os.path.join(H5dir,"lib")]
config.add_extension("HDF5LightReader", "yt/lagos/HDF5LightReader.c",
libraries=["m","hdf5"],
library_dirs=library_dirs, include_dirs=include_dirs)
- sys.argv.extend(["config_fc","--f77flags","'-Dr16 -ffixed-line-length-132 -fno-second-underscore -DPYFORT -DNOMETALS -ggdb -O0'"])
if 0:
+ sys.argv.extend(["config_fc","--f77flags",
+ "'-Dr16 -ffixed-line-length-132 -fno-second-underscore -DPYFORT -DNOMETALS -ggdb -O0'"])
config.add_extension("EnzoFortranRoutines", \
["yt/lagos/solve_rate_cool.pyf", "yt/lagos/f_src/*.F"])
return config
More information about the yt-svn
mailing list