Installing OpenCV on linux: getting CMake Error












3















I am trying to install OpenCV on linux to use with nodejs.



I followed the instructions in https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html and got the version 4.0.0 of OpenCV from the release page.



When I run the following command in my opencv directory :



python ./platforms/js/build_js.py  --emscripten_dir ~/emsdk/ build_js


I get the following error:



Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:104 (message):
Could not find toolchain file:
~/emsdk/cmake/Modules/Platform/Emscripten.cmake
Call Stack (most recent call first):
CMakeLists.txt:131 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "./platforms/js/build_js.py", line 224, in <module>
builder.config()
File "./platforms/js/build_js.py", line 164, in config
execute(cmd)
File "./platforms/js/build_js.py", line 23, in execute
raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 1


I get the same error when I try and install OpenCV via (I have successfully installed OPenCV with these commands before, but I am not sure why now the same command is failing):



mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..


My cMake version is cmake version 3.5.1.



EDIT



Like it has been suggested, apt-get install cmake gcc g++ then cmake in a new directory solved the issue.
I still had other errors afterwards and at the end I had to downgrade my node js to v8.12.0 and install opencv via npm install opencv (that command gave lots of errors with the latest version of nodejs (11.2)).










share|improve this question




















  • 1





    it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

    – api55
    Nov 22 '18 at 14:59











  • Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

    – Tsyvarev
    Nov 22 '18 at 17:06






  • 1





    @api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

    – christegho
    Nov 23 '18 at 13:40
















3















I am trying to install OpenCV on linux to use with nodejs.



I followed the instructions in https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html and got the version 4.0.0 of OpenCV from the release page.



When I run the following command in my opencv directory :



python ./platforms/js/build_js.py  --emscripten_dir ~/emsdk/ build_js


I get the following error:



Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:104 (message):
Could not find toolchain file:
~/emsdk/cmake/Modules/Platform/Emscripten.cmake
Call Stack (most recent call first):
CMakeLists.txt:131 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "./platforms/js/build_js.py", line 224, in <module>
builder.config()
File "./platforms/js/build_js.py", line 164, in config
execute(cmd)
File "./platforms/js/build_js.py", line 23, in execute
raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 1


I get the same error when I try and install OpenCV via (I have successfully installed OPenCV with these commands before, but I am not sure why now the same command is failing):



mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..


My cMake version is cmake version 3.5.1.



EDIT



Like it has been suggested, apt-get install cmake gcc g++ then cmake in a new directory solved the issue.
I still had other errors afterwards and at the end I had to downgrade my node js to v8.12.0 and install opencv via npm install opencv (that command gave lots of errors with the latest version of nodejs (11.2)).










share|improve this question




















  • 1





    it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

    – api55
    Nov 22 '18 at 14:59











  • Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

    – Tsyvarev
    Nov 22 '18 at 17:06






  • 1





    @api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

    – christegho
    Nov 23 '18 at 13:40














3












3








3


2






I am trying to install OpenCV on linux to use with nodejs.



I followed the instructions in https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html and got the version 4.0.0 of OpenCV from the release page.



When I run the following command in my opencv directory :



python ./platforms/js/build_js.py  --emscripten_dir ~/emsdk/ build_js


I get the following error:



Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:104 (message):
Could not find toolchain file:
~/emsdk/cmake/Modules/Platform/Emscripten.cmake
Call Stack (most recent call first):
CMakeLists.txt:131 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "./platforms/js/build_js.py", line 224, in <module>
builder.config()
File "./platforms/js/build_js.py", line 164, in config
execute(cmd)
File "./platforms/js/build_js.py", line 23, in execute
raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 1


I get the same error when I try and install OpenCV via (I have successfully installed OPenCV with these commands before, but I am not sure why now the same command is failing):



mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..


My cMake version is cmake version 3.5.1.



EDIT



Like it has been suggested, apt-get install cmake gcc g++ then cmake in a new directory solved the issue.
I still had other errors afterwards and at the end I had to downgrade my node js to v8.12.0 and install opencv via npm install opencv (that command gave lots of errors with the latest version of nodejs (11.2)).










share|improve this question
















I am trying to install OpenCV on linux to use with nodejs.



I followed the instructions in https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html and got the version 4.0.0 of OpenCV from the release page.



When I run the following command in my opencv directory :



python ./platforms/js/build_js.py  --emscripten_dir ~/emsdk/ build_js


I get the following error:



Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:104 (message):
Could not find toolchain file:
~/emsdk/cmake/Modules/Platform/Emscripten.cmake
Call Stack (most recent call first):
CMakeLists.txt:131 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "./platforms/js/build_js.py", line 224, in <module>
builder.config()
File "./platforms/js/build_js.py", line 164, in config
execute(cmd)
File "./platforms/js/build_js.py", line 23, in execute
raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 1


I get the same error when I try and install OpenCV via (I have successfully installed OPenCV with these commands before, but I am not sure why now the same command is failing):



mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..


My cMake version is cmake version 3.5.1.



EDIT



Like it has been suggested, apt-get install cmake gcc g++ then cmake in a new directory solved the issue.
I still had other errors afterwards and at the end I had to downgrade my node js to v8.12.0 and install opencv via npm install opencv (that command gave lots of errors with the latest version of nodejs (11.2)).







javascript opencv cmake installation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 13:43







christegho

















asked Nov 22 '18 at 14:25









christeghochristegho

809




809








  • 1





    it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

    – api55
    Nov 22 '18 at 14:59











  • Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

    – Tsyvarev
    Nov 22 '18 at 17:06






  • 1





    @api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

    – christegho
    Nov 23 '18 at 13:40














  • 1





    it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

    – api55
    Nov 22 '18 at 14:59











  • Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

    – Tsyvarev
    Nov 22 '18 at 17:06






  • 1





    @api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

    – christegho
    Nov 23 '18 at 13:40








1




1





it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

– api55
Nov 22 '18 at 14:59





it looks like if the c++/c compiler are not there... do something like apt-get install cmake gcc g++ not sure what is your linux flavor so this command is for ubuntu. Remember to remove the CMakeCache.txt file or to do cmake in a clean directory

– api55
Nov 22 '18 at 14:59













Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

– Tsyvarev
Nov 22 '18 at 17:06





Does the file ~/emsdk/cmake/Modules/Platform/Emscripten.cmake exists or not actually? If it exists, try to replace ~ with exact path to home directory. If the file misses, you probably specify wrong emscripten directory.

– Tsyvarev
Nov 22 '18 at 17:06




1




1





@api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

– christegho
Nov 23 '18 at 13:40





@api55 apt-get install cmake gcc g++ did help, when I redid the cmake in a clean directory! thank you.

– christegho
Nov 23 '18 at 13:40












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433043%2finstalling-opencv-on-linux-getting-cmake-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433043%2finstalling-opencv-on-linux-getting-cmake-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Berounka

Sphinx de Gizeh

Different font size/position of beamer's navigation symbols template's content depending on regular/plain...