etaler / Etaler

A flexable HTM (Hierarchical Temporal Memory) framework with full GPU support.
BSD 3-Clause "New" or "Revised" License
89 stars 14 forks source link

setDefaultBackend undefined #52

Closed alior101 closed 5 years ago

alior101 commented 5 years ago

Modifying example1 to have a default OpenCL backend fails compilation:

int main()
{
    //Create a SP that takes in 128 input bits and generates 32 bit representation
    auto gpu = std::make_shared<OpenCLBackend>();
    setDefaultBackend(std::make_shared<OpenCLBackend>());
    SpatialPooler sp({128}, {32});
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /workspaces/Etaler/build --config Debug --target example1 -- -j 6
[build] [ 80%] Built target Etaler
[build] Scanning dependencies of target example1
[build] [ 80%] Building CXX object examples/CMakeFiles/example1.dir/example1.cpp.o
[build] [100%] Linking CXX executable example1
[build] CMakeFiles/example1.dir/example1.cpp.o: In function `et::setDefaultBackend(std::shared_ptr<et::Backend>)':
[build] /workspaces/Etaler/./Etaler/Core/DefaultBackend.hpp:14: undefined reference to `et::g_default_backend_hold'
[build] collect2: error: ld returned 1 exit status
[build] make[3]: *** [examples/example1] Error 1
[build] examples/CMakeFiles/example1.dir/build.make:96: recipe for target 'examples/example1' failed
[build] CMakeFiles/Makefile2:187: recipe for target 'examples/CMakeFiles/example1.dir/all' failed
[build] CMakeFiles/Makefile2:199: recipe for target 'examples/CMakeFiles/example1.dir/rule' failed
[build] make[2]: *** [examples/CMakeFiles/example1.dir/all] Error 2
[build] make[1]: *** [examples/CMakeFiles/example1.dir/rule] Error 2
[build] make: *** [example1] Error 2
[build] Makefile:190: recipe for target 'example1' failed
[build] Build finished with exit code 2
marty1885 commented 5 years ago

Weird... Let me have a look. Is the problem re-creatable on Docker?

alior101 commented 5 years ago

yes

On Sun, Aug 4, 2019 at 7:56 AM Martin Chang notifications@github.com wrote:

Weird... Let me have a look. Is the problem re-creatable on Docker?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/etaler/Etaler/issues/52?email_source=notifications&email_token=AAXET3HOALLJLDRT6AFAD7DQCZORDA5CNFSM4IJDMQU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3P2OFA#issuecomment-517973780, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXET3AYIPJSMHMBORZKLI3QCZORDANCNFSM4IJDMQUQ .

marty1885 commented 5 years ago

@alior101 I think I have encountered this problem before and have fixed it. May you pull from master and see if the problem still exists?

alior101 commented 5 years ago

working after merge with master