Open
Description
- I build the whole nupic.cpp library
cmake ...
make -j8 install
(any sequential code modifications and re-compilation trigger only rebuild for the changed files).
- but when I decide to build also the py bindings (ie to run py tests), the whole c++ core library is recompiled:
python ../../setup.py test
Output:
[==========] 338 tests from 41 test cases ran. (17708 ms total)
[ PASSED ] 338 tests.
real 0m17.713s
user 0m19.562s
sys 0m0.184s
(pyenv) mmm@mmm-U2442:/mnt/store/devel/HTM/htm-community/nupic.cpp/build/scripts$ python ../../setup.py test
setup.py: Calling /mnt/store/devel/HTM/htm-community/nupic.cpp/bindings/py/packaging/setup.py
-- REPOSITORY_DIR = /mnt/store/devel/HTM/htm-community/nupic.cpp
-- CMAKE_BINARY_DIR = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/scripts
-- CMAKE_BUILD_TYPE = Release
-- CMAKE_INSTALL_PREFIX = /home/mmm/devel/HTM/htm-community/nupic.cpp/build/Debug
-- FORCE_CPP11 = OFF
-- FORCE_BOOST = OFF
-- BINDING_BUILD = Python2
-- Environment var CXX =
GNU gold (GNU Binutils for Ubuntu 2.30) 1.15
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Using ld.gold as LINKER.
-- CMAKE_CXX_COMPILER_ID= GNU
-- CMAKE_CXX_COMPILER_VERSION=7.3.0
-- CMAKE_CXX_COMPILER = /usr/bin/g++-7
-- CMAKE_CXX_STANDARD = 11
-- PLATFORM = linux
-- BITNESS = 64
-- NEEDS_BOOST = ON
-- INTERNAL_CXX_FLAGS = -fvisibility-inlines-hidden;-static-libstdc++;-static-libgcc;-fdiagnostics-show-option;-m64;-fPIC;-Werror;-Wextra;-Wreturn-type;-Wunused;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers;-Wall;-pipe;-O2;-mtune=generic;-fuse-ld=gold;-fuse-linker-plugin;-flto-report;-flto
-- INTERNAL_LINKER_FLAGS= -m64;-Wl,--no-undefined;-O2;-flto
-- COMMON_COMPILER_DEFINITIONS_STR= -DHAVE_UNISTD_H -DNTA_COMPILER_GNU
-- COMMON_OS_LIBS = pthread;dl
-- external import
-- CMAKE_INSTALL_PREFIX = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty
-- CMAKE_BUILD_TYPE = Release
-- EXTERNAL_CXX_FLAGS = -fPIC
-- NEEDS_BOOST = ON
-- BINDING_BUILD = Python2
-- Obtaining yaml-cpp
-- obtaining Eigen
-- obtaining Boost
-- Obtaining gtest
-- obtaining PyBind11
-- obtaining MNIST data
-- Downloading/updating mnist
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/mnist_data/mnist-download
Scanning dependencies of target mnist-download
[100%] Built target mnist-download
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty
[ 82%] Built target yaml-cpp
[ 88%] Built target gtest
[ 94%] Built target gtest_main
[100%] Built target mnist_example
-- Results from external build:
-- yaml-cpp_INCLUDE_DIRS = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/yaml-cpp/yaml-cpp-src/include
-- yaml-cpp_LIBRARIES = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/yaml-cpp/yaml-cpp-build/libyaml-cpp.a
-- eigen_INCLUDE_DIRS = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/eigen/eigen-src
-- BOOST_ROOT = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src
-- Boost_INCLUDE_DIRS = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src
-- Boost_LIBRARIES = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_filesystem.a;/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_system.a
-- gtest_INCLUDE_DIRS = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/gtest/googletest-src/googletest/include
-- gtest_LIBRARIES = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/gtest/googletest-build/googletest/libgtest$<$<CONFIG:Debug>:d>.a
-- pybind11_SOURCE_DIR = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/pybind11/pybind11-src
-- pybind11_BINARY_DIR = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/pybind11/pybind11-build
-- mnist_INCLUDE_DIRS = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/mnist_data/mnist-src/include
-- mnist_SOURCE_DIR = /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/mnist_data/mnist-src
-- Configuring nupic_core src
-- MERGE_STATIC_LIBRARIES LIB_TARGET=nupic_core, STATIC_LIBS = nupic_core_solo;/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/yaml-cpp/yaml-cpp-build/libyaml-cpp.a;/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_filesystem.a;/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_system.a
-- MERGE_STATIC_LIBRARIES: nupic_core_solo
-- MERGE_STATIC_LIBRARIES: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/yaml-cpp/yaml-cpp-build/libyaml-cpp.a - non-target lib.
-- MERGE_STATIC_LIBRARIES: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_filesystem.a - non-target lib.
-- MERGE_STATIC_LIBRARIES: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_system.a - non-target lib.
-- ExpandStaticLib: LIB_TARGET=nupic_core_shared, src-lib=/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/yaml-cpp/yaml-cpp-build/libyaml-cpp.a
-- ExpandStaticLib: LIB_TARGET=nupic_core_shared, src-lib=/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_filesystem.a
-- ExpandStaticLib: LIB_TARGET=nupic_core_shared, src-lib=/mnt/store/devel/HTM/htm-community/nupic.cpp/build/ThirdParty/boost/Boost_download-src/stage/lib/libboost_system.a
-- Configuring nupic_core tests
-- Configuring Python interface
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/store/devel/HTM/htm-community/nupic.cpp/build/scripts
Scanning dependencies of target LibrarySource
[ 0%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/Anomaly.cpp.o
[ 1%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/AnomalyLikelihood.cpp.o
[ 2%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/BacktrackingTMCpp.cpp.o
[ 3%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/Cell.cpp.o
[ 3%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/Cells4.cpp.o
[ 4%] Building CXX object src/CMakeFiles/LibrarySource.dir/nupic/algorithms/Connections.cpp.o
[ 5%] Building CXX object src/CMakeFiles/LibrarySo
Hint: is it because a PY_BUILD=python2.7 cmake flag is added?
Current:
- c++ library is rebuild for py bindings even if compiler before
Expected behavior:
- bindings just link to the existing library/binary.