[Yt-svn] yt-commit r402 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Mon Apr 14 15:22:42 PDT 2008
Author: mturk
Date: Mon Apr 14 15:22:42 2008
New Revision: 402
URL: http://yt.spacepope.org/changeset/402
Log:
Fixed some issues that could arise if you sudo to install.
Modified:
trunk/yt/lagos/setup.py
Modified: trunk/yt/lagos/setup.py
==============================================================================
--- trunk/yt/lagos/setup.py (original)
+++ trunk/yt/lagos/setup.py Mon Apr 14 15:22:42 2008
@@ -1,21 +1,24 @@
#!/usr/bin/env python
import os, sys, os.path
+import os.path
+try:
+ H5dir = open("hdf5.cfg").read().strip().rstrip()
+except:
+ print "Reading HDF5 location from hdf5.cfg failed: Not using HDF5 wrapper!"
+ H5dir = None
+
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('lagos',parent_package,top_path)
config.make_config_py() # installs __config__.py
config.add_extension("PointCombine", "yt/lagos/PointCombine.c", libraries=["m"])
- if not os.environ.has_key("HDF5_INSTALL"):
- print "You need to set the environment variable HDF5_INSTALL to point to your HDF5 base"
- #raise KeyError("HDF5_INSTALL")
- sys.exit(1)
- H5dir = os.environ["HDF5_INSTALL"]
- 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_hl","hdf5"],
- library_dirs=library_dirs, include_dirs=include_dirs)
+ 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_hl","hdf5"],
+ library_dirs=library_dirs, include_dirs=include_dirs)
sys.argv.extend(["config_fc","--f77flags","'-Dr16 -ffixed-line-length-none -fno-second-underscore -DPYFORT -DNOMETALS -ggdb -O0'"])
if 0:
config.add_extension("EnzoFortranRoutines", \
More information about the yt-svn
mailing list