Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Replaced NTA_ROOTDIR by NTA #792

Merged
merged 13 commits into from
Apr 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ install:

# Add more environment variables
- "export PYTHONPATH=$PYTHONPATH:$NTA/lib/python$PY_VERSION/site-packages"
- "export NTA_ROOTDIR=$NTA"

script:
- "cd $TRAVIS_BUILD_DIR/build/scripts"
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,9 @@ set(CMAKE_SWIG_OUTDIR "${PYTHON_SITE_PACKAGES_DIR}/nupic/bindings")
#
message(STATUS "Checking environment...")
message(STATUS "Environment variables:")
set_environment_variable(PATH "${PROJECT_BUILD_RELEASE_DIR}/bin" ON)
set_environment_variable(PYTHONPATH "${PYTHON_SITE_PACKAGES_DIR}" OFF)
set_environment_variable(NUPIC "${PROJECT_SOURCE_DIR}" OFF)
set_environment_variable(LD_LIBRARY_PATH "${PROJECT_BUILD_TEMP_DIR}/lib" ON)
set_environment_variable(DYLD_LIBRARY_PATH "${PROJECT_BUILD_RELEASE_DIR}/lib" ON)
set_environment_variable(NTA "${PROJECT_BUILD_RELEASE_DIR}" OFF)
set_environment_variable(NTA_ROOTDIR "${PROJECT_BUILD_RELEASE_DIR}" OFF)
set_environment_variable(NTA_DATA_PATH "${PROJECT_BUILD_RELEASE_DIR}/share/prediction/data" OFF)
if(OSX)
set_environment_variable(MACOSX_DEPLOYMENT_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}" OFF)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Set the following environment variables in your `~/.bashrc` file. `$NUPIC` is th

export NUPIC=<path to NuPIC repository>
export NTA=$NUPIC/build/release
export NTA_ROOTDIR=$NTA
export PYTHONPATH=$PYTHONPATH:$NTA/lib/python<version>/site-packages

### Using command line
Expand Down
4 changes: 0 additions & 4 deletions docker/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ RUN /usr/local/bin/easy_install-2.7 pip
# Set NuPIC environment
ENV NUPIC /usr/local/src/nupic
ENV NTA $NUPIC/build/release
ENV NTA_ROOTDIR $NTA
ENV PYTHONPATH $PYTHONPATH:$NTA/lib/python2.7/site-packages
ENV BUILDDIR /tmp/ntabuild
ENV PY_VERSION 2.7
ENV NTA_DATA_PATH $NTA/share/prediction/data
ENV LDIR $NTA/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$LDIR
ENV USER root
ENV PYTHON /usr/local/bin/python2.7

Expand Down
5 changes: 0 additions & 5 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ ENV CXX clang++
# Set enviroment variables needed by NuPIC
ENV NTA /usr/bin/nta/eng
ENV NUPIC /usr/local/src/nupic
ENV BUILDDIR /tmp/ntabuild
ENV PY_VERSION 2.7
ENV PATH $NTA/bin:$PATH
ENV PYTHONPATH $NTA/lib/python$PY_VERSION/site-packages:$PYTHONPATH
ENV NTA_ROOTDIR $NTA
ENV NTA_DATA_PATH $NTA/share/prediction/data:$NTA_DATA_PATH
ENV LDIR $NTA/lib
ENV LD_LIBRARY_PATH $LDIR

# OPF needs this
ENV USER docker
Expand Down
12 changes: 6 additions & 6 deletions py/nupic/data/datasethelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def findDataset(datasetPath):
1. NTA_DATA_PATH (":" separated value similar to PATH)
2. ./data
3. ./
4. NTA_ROOTDIR
4. NTA
5. ~/nta/current/share/prediction/data (unix)

If the dataset is compressed (ends in .gz) returns the name of the compressed
Expand Down Expand Up @@ -106,7 +106,7 @@ def _getDataDirs():
1. NTA_DATA_PATH (":" separated value similar to PATH)
2. ./data
3. ./
4. NTA_ROOTDIR
4. NTA
5. ~/nta/current/share/prediction/data (unix)

"""
Expand All @@ -120,17 +120,17 @@ def _getDataDirs():
dataDirs.append(('data', "in local directory 'data'"))
dataDirs.append((".", "in current working directory"))

if "NTA_ROOTDIR" in os.environ:
d = os.path.join(os.environ['NTA_ROOTDIR'], 'share/prediction/data')
if "NTA" in os.environ:
d = os.path.join(os.environ['NTA'], 'share/prediction/data')
if os.path.isdir(d):
if d not in zip(*dataDirs)[0]:
dataDirs.append((d, 'in $NTA_ROOTDIR/share/prediction/data'))
dataDirs.append((d, 'in $NTA/share/prediction/data'))

if sys.platform != 'win32' and 'HOME' in os.environ:
d = os.path.join(os.environ['HOME'], 'nta/current/share/prediction/data')
if os.path.isdir(d):
if d not in zip(*dataDirs)[0]:
dataDirs.append((d, 'in $NTA_ROOTDIR/share/prediction/data'))
dataDirs.append((d, 'in $NTA/share/prediction/data'))

return dataDirs

Expand Down
12 changes: 6 additions & 6 deletions py/nupic/swarming/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ def runModelGivenBaseAndParams(modelID, jobID, baseDescription, params,


# -------------------------------------------------------------------------
# if NTA_ROOTDIR is not set in the environment, set it for the user so that
# if NTA is not set in the environment, set it for the user so that
# we can find data files expected to be in the share/prediction/data directory
if not "NTA_ROOTDIR" in os.environ:
os.environ['NTA_ROOTDIR'] = nupic.rootDir
if not "NTA" in os.environ:
os.environ['NTA'] = nupic.rootDir


# Run the experiment now
Expand Down Expand Up @@ -479,10 +479,10 @@ def runDummyModel(modelID, jobID, params, predictedField, reportKeys,


# -------------------------------------------------------------------------
# if NTA_ROOTDIR is not set in the environment, set it for the user so that
# if NTA is not set in the environment, set it for the user so that
# we can find data files expected to be in the share/prediction/data directory
if not "NTA_ROOTDIR" in os.environ:
os.environ['NTA_ROOTDIR'] = nupic.rootDir
if not "NTA" in os.environ:
os.environ['NTA'] = nupic.rootDir


# Run the experiment now
Expand Down
2 changes: 1 addition & 1 deletion tests/htmtest/htmtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void testPynodeLinking()
// std::string imagePath = Path::makeAbsolute("bed.bmp");
// if (!Path::exists(imagePath))
// {
// bool rc = Env::get("NTA_ROOTDIR", imagePath);
// bool rc = Env::get("NTA", imagePath);
// NTA_CHECK(rc);
// imagePath = Path::join(imagePath, "share/vision/data/pictures/clean/bed/bed.bmp");
// NTA_CHECK(Path::exists(imagePath));
Expand Down