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

make clean / distclean breaks the build #826

Closed
vitaly-krugl opened this issue Apr 16, 2014 · 9 comments · Fixed by #873
Closed

make clean / distclean breaks the build #826

vitaly-krugl opened this issue Apr 16, 2014 · 9 comments · Fixed by #873
Assignees
Milestone

Comments

@vitaly-krugl
Copy link
Member

Following instructions in the NuPIC README, I executed the following sequence

mkdir -p $NUPIC/build/scripts
cd $NUPIC/build/scripts
cmake $NUPIC
make clean / distclean
make -j3

The pertinent environment variables are:

NTAX_DEVELOPER_BUILD is NOT defined

$ echo $NUPIC
/Users/vkruglikov/nta/nupic
$ echo $NTA
/Users/vkruglikov/nta/nupic/build/release
$ echo $NTA_ROOTDIR 
/Users/vkruglikov/nta/nupic/build/release
$ echo $PYTHONPATH 
/Users/vkruglikov/Packages/Cython-0.15.1:/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages::/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages:/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages

The failure looks like this:

vkruglikov@vkruglikovs-mbp:~/nta/nupic/build/scripts (master)$ make -j3
[  6%] [ 12%] [ 18%] Building CXX object CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o
Building CXX object CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o
Building CXX object CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.cpp:24:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
         ^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyArray.cpp:30:
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyArray.hpp:39:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
         ^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:33:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728:
/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API
      NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
 ^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:45:
/Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.hpp:32:10: fatal error: 'nta/types/types.hpp' file not found
#include <nta/types/types.hpp> // For nta::Real.
         ^
1 warning and 1 error generated.
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o] Error 1
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o] Error 1
make[1]: *** [CMakeFiles/support.dir/all] Error 2
make: *** [all] Error 2

If I skip make clean / distclean, then the build completes successfully.

@roesenerm
Copy link

Hello All,

On the same note, when following the README installation instructions I
receive the following error when I issue the "make -j3" command:

[ 0%] Building CXX object
lang/py/support/CMakeFiles/libsupport.dir/NumpyVector.cpp.o

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: *** [lang/py/support/CMakeFiles/libsupport.dir/NumpyVector.cpp.o]
Error 127

make[1]: *** [lang/py/support/CMakeFiles/libsupport.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

[ 1%] [ 2%] Building CXX object
nta/math/CMakeFiles/libmath.dir/SparseMatrixAlgorithms.cpp.o

Building CXX object nta/math/CMakeFiles/libmath.dir/stl_io.cpp.o

clang: error: no input files

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: *** [nta/math/CMakeFiles/libmath.dir/SparseMatrixAlgorithms.cpp.o]
Error 127

make[2]: *** Waiting for unfinished jobs....

/bin/sh: -fPIC: command not found

make[2]: *** [nta/math/CMakeFiles/libmath.dir/stl_io.cpp.o] Error 127

make[1]: *** [nta/math/CMakeFiles/libmath.dir/all] Error 2

[ 3%] [ 4%] Building CXX object
nta/algorithms/CMakeFiles/libalgorithms.dir/bit_history.cpp.o

[ 5%] Building CXX object
nta/algorithms/CMakeFiles/libalgorithms.dir/Cell.cpp.o

clang: error: no input files

Building CXX object nta/algorithms/CMakeFiles/libalgorithms.dir/Cells4.cpp.o

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: ***
[nta/algorithms/CMakeFiles/libalgorithms.dir/bit_history.cpp.o] Error 127

make[2]: *** Waiting for unfinished jobs....

clang: error: no input files

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

/bin/sh: -fPIC: command not found

make[2]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/Cells4.cpp.o]
Error 127

make[2]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/Cell.cpp.o] Error
127

make[1]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/all] Error 2

make: *** [all] Error 2

I changed my .bashrc file to the following and download all the
requirements.

export NUPIC=~/nupic

export NTA=$NUPIC/build/release

export NTA_ROOTDIR=$NTA

export PYTHONPATH=$PYTHONPATH:$NTA/lib/python2.7/site-packages

Thank you,

Matt

On Wed, Apr 16, 2014 at 3:57 PM, vitaly-krugl notifications@github.comwrote:

Following instructions in the NuPIC README, I executed the following
sequence

mkdir -p $NUPIC/build/scripts
cd $NUPIC/build/scripts
cmake $NUPIC
make clean / distclean
make -j3

The pertinent environment variables are:

NTAX_DEVELOPER_BUILD is NOT defined

$ echo $NUPIC
/Users/vkruglikov/nta/nupic
$ echo $NTA
/Users/vkruglikov/nta/nupic/build/release
$ echo $NTA_ROOTDIR
/Users/vkruglikov/nta/nupic/build/release
$ echo $PYTHONPATH
/Users/vkruglikov/Packages/Cython-0.15.1:/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages::/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages:/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages

The failure looks like this:

vkruglikov@vkruglikovs-mbp:~/nta/nupic/build/scripts (master)$ make -j3
[ 6%] [ 12%] [ 18%] Building CXX object CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o
Building CXX object CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o
Building CXX object CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.cpp:24:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyArray.cpp:30:
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/PyArray.hpp:39:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:33:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728:
/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API
NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
^
In file included from /Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:45:
/Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.hpp:32:10: fatal error: 'nta/types/types.hpp' file not found
#include <nta/types/types.hpp> // For nta::Real.
^
1 warning and 1 error generated.
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o] Error 1
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o] Error 1
make[1]: *** [CMakeFiles/support.dir/all] Error 2
make: *** [all] Error 2

If I skip make clean / distclean, then the build completes successfully.


Reply to this email directly or view it on GitHubhttps://github.com//issues/826
.

Regards,

Matthew W. Roesener
Tel: +808.542.9978
Email: roesenerm@gmail.com
LinkedIn: http://www.linkedin.com/in/matthewroesener

@breznak
Copy link
Member

breznak commented Apr 17, 2014

Ok guys, thanks for reporting! The readme is wrong. make clean can be
used to clean up after previous builds, but requires running cmake ..
again.

On Thu, Apr 17, 2014 at 2:00 AM, roesenerm notifications@github.com wrote:

Hello All,

On the same note, when following the README installation instructions I
receive the following error when I issue the "make -j3" command:

[ 0%] Building CXX object
lang/py/support/CMakeFiles/libsupport.dir/NumpyVector.cpp.o

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: *** [lang/py/support/CMakeFiles/libsupport.dir/NumpyVector.cpp.o]
Error 127

make[1]: *** [lang/py/support/CMakeFiles/libsupport.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

[ 1%] [ 2%] Building CXX object
nta/math/CMakeFiles/libmath.dir/SparseMatrixAlgorithms.cpp.o

Building CXX object nta/math/CMakeFiles/libmath.dir/stl_io.cpp.o

clang: error: no input files

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: ***
[nta/math/CMakeFiles/libmath.dir/SparseMatrixAlgorithms.cpp.o]
Error 127

make[2]: *** Waiting for unfinished jobs....

/bin/sh: -fPIC: command not found

make[2]: *** [nta/math/CMakeFiles/libmath.dir/stl_io.cpp.o] Error 127

make[1]: *** [nta/math/CMakeFiles/libmath.dir/all] Error 2

[ 3%] [ 4%] Building CXX object
nta/algorithms/CMakeFiles/libalgorithms.dir/bit_history.cpp.o

[ 5%] Building CXX object
nta/algorithms/CMakeFiles/libalgorithms.dir/Cell.cpp.o

clang: error: no input files

Building CXX object
nta/algorithms/CMakeFiles/libalgorithms.dir/Cells4.cpp.o

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

make[2]: ***
[nta/algorithms/CMakeFiles/libalgorithms.dir/bit_history.cpp.o] Error 127

make[2]: *** Waiting for unfinished jobs....

clang: error: no input files

clang: error: no input files

/bin/sh: -DNDEBUG: command not found

/bin/sh: -DNDEBUG: command not found

/bin/sh: -fPIC: command not found

/bin/sh: -fPIC: command not found

make[2]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/Cells4.cpp.o]
Error 127

make[2]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/Cell.cpp.o]
Error
127

make[1]: *** [nta/algorithms/CMakeFiles/libalgorithms.dir/all] Error 2

make: *** [all] Error 2

I changed my .bashrc file to the following and download all the
requirements.

export NUPIC=~/nupic

export NTA=$NUPIC/build/release

export NTA_ROOTDIR=$NTA

export PYTHONPATH=$PYTHONPATH:$NTA/lib/python2.7/site-packages

Thank you,

Matt

On Wed, Apr 16, 2014 at 3:57 PM, vitaly-krugl notifications@github.comwrote:

Following instructions in the NuPIC README, I executed the following
sequence

mkdir -p $NUPIC/build/scripts
cd $NUPIC/build/scripts
cmake $NUPIC
make clean / distclean
make -j3

The pertinent environment variables are:

NTAX_DEVELOPER_BUILD is NOT defined

$ echo $NUPIC
/Users/vkruglikov/nta/nupic
$ echo $NTA
/Users/vkruglikov/nta/nupic/build/release
$ echo $NTA_ROOTDIR
/Users/vkruglikov/nta/nupic/build/release
$ echo $PYTHONPATH

/Users/vkruglikov/Packages/Cython-0.15.1:/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages::/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages:/Users/vkruglikov/nta/nupic/build/release/lib/python2.7/site-packages

The failure looks like this:

vkruglikov@vkruglikovs-mbp:~/nta/nupic/build/scripts (master)$ make -j3
[ 6%] [ 12%] [ 18%] Building CXX object
CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o
Building CXX object
CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o
Building CXX object
CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o
In file included from
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.cpp:24:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal
error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
^
In file included from
/Users/vkruglikov/nta/nupic/lang/py/support/PyArray.cpp:30:
In file included from
/Users/vkruglikov/nta/nupic/lang/py/support/PyArray.hpp:39:
/Users/vkruglikov/nta/nupic/lang/py/support/PyHelpers.hpp:34:10: fatal
error: 'nta/utils/Log.hpp' file not found
#include <nta/utils/Log.hpp>
^
In file included from
/Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:33:
In file included from
/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15:

In file included from
/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:

In file included from
/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728:

/Users/vkruglikov/nta/nupic-darwin64/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API
NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
^
In file included from
/Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.cpp:45:
/Users/vkruglikov/nta/nupic/lang/py/support/NumpyVector.hpp:32:10: fatal
error: 'nta/types/types.hpp' file not found
#include <nta/types/types.hpp> // For nta::Real.
^
1 warning and 1 error generated.
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/NumpyVector.cpp.o]
Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyHelpers.cpp.o]
Error 1
1 error generated.
make[2]: *** [CMakeFiles/support.dir/lang/py/support/PyArray.cpp.o]
Error 1
make[1]: *** [CMakeFiles/support.dir/all] Error 2
make: *** [all] Error 2

If I skip make clean / distclean, then the build completes successfully.


Reply to this email directly or view it on GitHub<
https://github.com/numenta/nupic/issues/826>
.

Regards,

Matthew W. Roesener
Tel: +808.542.9978
Email: roesenerm@gmail.com
LinkedIn: http://www.linkedin.com/in/matthewroesener


Reply to this email directly or view it on GitHubhttps://github.com//issues/826#issuecomment-40666897
.

Marek Otahal :o)

@vitaly-krugl
Copy link
Member Author

@breznak, I think you're suggesting that the (optional) make clean step (without distclean) should be moved to the line before cmake $NUPIC in the top-level README.md. Is this correct? Thx.

Something like this:

mkdir -p $NUPIC/build/scripts
cd $NUPIC/build/scripts
(optional) make clean   # to compile all the files again
cmake $NUPIC

@breznak
Copy link
Member

breznak commented Apr 17, 2014

@vitaly-krugl yes. I'm even not sure if mention it in readme at all (as it
can cause confusion). The usecase is:
`
cmake $NUPIC
make
..some work...

now if you want to ensure absolutely clean build from the beginning, call
clean:
make (dist)clean
cmake $NUPIC
make
....
`

--the conclusion is, we can't write in the readme just: "make clean; cmake;
make" because make clean needs existing Makefile from previous cmake
call.

@rhyolight
Copy link
Member

@breznak Can you fix the README with a PR that closes this ticket?

@breznak
Copy link
Member

breznak commented Apr 22, 2014

@rhyolight sure, I'm just not sure how to phrase it, as readme should imho
be short, not too detailed.
Would just a [1] link to the wiki do?

@rhyolight
Copy link
Member

I would say just remove the line (optional) make clean / distclean # to compile all the files again from the README and add a note about how to do a clean in https://github.com/numenta/nupic/wiki/Installing-and-Building-NuPIC.

@rhyolight rhyolight modified the milestones: Sprint 21, Sprint 20 Apr 25, 2014
@utensil
Copy link
Member

utensil commented Apr 26, 2014

Actually I always find this make distclean confusing, it's like the problem of chicken and eggs, a circular dependency.

You would not be able to run make clean util cmake is all set, but make distclean is supposed to start a fresh build, how could it depend on running cmake? What if I removed the makefile and updated CMakefile.txt and wanted to start a fresh build, how could I be ensured that the new makefile generated by new CMakefile.txt could really clean previous build generated by previous makefiles?

Probably I didn't express the confusion clearly enough, but I guess you can get it. Just feels weird and not right somehow.

@utensil
Copy link
Member

utensil commented Apr 26, 2014

Related to #788 . From https://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets :

distclean:
Delete all files in the current directory (or created by this makefile) that are created by configuring or building the program. If you have unpacked the source and built the program without creating any other files, ‘make distclean’ should leave only the files that were in the distribution. However, there is no need to delete parent directories that were created with ‘mkdir -p’, since they could have existed anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants