Coder Social home page Coder Social logo

cross compile error about corrade HOT 9 CLOSED

mosra avatar mosra commented on May 11, 2024
cross compile error

from corrade.

Comments (9)

mosra avatar mosra commented on May 11, 2024 1

Yay, glad to hear that! πŸŽ‰

Keeping this open until I add a better error message to the toolchain file as I mentioned above.

from corrade.

linuxaged avatar linuxaged commented on May 11, 2024 1

Yep, cross-building maybe not so friendly to a newcomer like me, but magnum is still a great project especially the architecture, i can hold on. Good job!

Fixed, thanks!

from corrade.

mosra avatar mosra commented on May 11, 2024 1

Since mosra/toolchains@c6eaa23 there's an explicit error message when Visual Studio generator is used with Emscripten, explaining what to do instead.

from corrade.

mosra avatar mosra commented on May 11, 2024

Hi!

This is a common issue on Windows -- CMake uses Visual Studio project files as a default generator on Windows, but Visual Studio projects insist on using MSVC as a compiler (so emcc supplied by the Emscripten toolchain will get ignored). Solution is to specify a different generator (e.g. -G Ninja, if you have Ninja installed). The troubleshooting docs contain more information, including how to use Ninja that's bundled in VS installations.

Since you're not the first person running into this, I'll look if this could be handled with a better error message in the toolchain file itself.

from corrade.

linuxaged avatar linuxaged commented on May 11, 2024

Yet, Get another error when generate Ninja project:

C:\workspace\corrade\build-emscripten>cmake .. -G Ninja -DCMAKE_MAKE_PROGRAM="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake"  -DCMAKE_BUILD_TYPE=Release  -DEMSCRIPTEN_PREFIX="C:/workspace/emsdk" -DCMAKE_INSTALL_PREFIX="C:/lib/emscripten/system"
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:50 (project):
  The CMAKE_CXX_COMPILER:

    C:/workspace/emsdk/em++.bat

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "C:/workspace/corrade/build-emscripten/CMakeFiles/CMakeOutput.log".
See also "C:/workspace/corrade/build-emscripten/CMakeFiles/CMakeError.log".

from corrade.

mosra avatar mosra commented on May 11, 2024

Windows is not my primary system and I don't know much about emsdk, so I'm afraid I won't be able to help much... :/

Does C:/workspace/emsdk/em++.bat exist at all? Alternatively, if you have em++.bat in PATH, CMake should be able to pick that up correctly as well.

from corrade.

linuxaged avatar linuxaged commented on May 11, 2024

My fault, have assigned wrong value to EMSCRIPTEN_PREFIX, em++.bat is located in emsdk/emscripten/1.38.30.
Ninja project has been generated! Thanks.

from corrade.

linuxaged avatar linuxaged commented on May 11, 2024

By the way, got another cmake error when building magnum target WASM,
there're UseCorrade.cmake CorradeLibSuffix.cmake files in my C:\lib\emscripten\system\share\cmake\Corrade folder, how did cmake not find them with find_path?

C:\workspace\magnum\build-emscripten>cmake .. -G Ninja -DCMAKE_MAKE_PROGRAM="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake"  -DCMAKE_BUILD_TYPE=Release  -DEMSCRIPTEN_PREFIX="C:/workspace/emsdk/emscripten/1.38.30" -DCMAKE_PREFIX_PATH="C:/lib/emscripten/system" -DCMAKE_INSTALL_PREFIX="C:/lib/emscripten/system" -DMAGNUM_DEPLOY_PREFIX="C:/http/magnum" -DWITH_SDL2APPLICATION=ON -DCORRADE_INCLUDE_DIR="C:/lib/emscripten/system/include"
CMake Error at modules/FindCorrade.cmake:291 (file):
  file failed to open for reading (No such file or directory):

    C:/workspace/magnum/_CORRADE_CONFIGURE_FILE-NOTFOUND
Call Stack (most recent call first):
  CMakeLists.txt:52 (find_package)


CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Corrade (missing: _CORRADE_MODULE_DIR
  _CORRADE_CONFIGURE_FILE Containers Utility)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  modules/FindCorrade.cmake:552 (find_package_handle_standard_args)
  CMakeLists.txt:52 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/workspace/magnum/build-emscripten/CMakeFiles/CMakeOutput.log".
See also "C:/workspace/magnum/build-emscripten/CMakeFiles/CMakeError.log".

from corrade.

mosra avatar mosra commented on May 11, 2024

Cross-compilation with CMake is painful, right? πŸ™ˆ

Have a look at this part of the troubleshooting guide -- in particular, adding -DCMAKE_FIND_ROOT_PATH=C:/lib/emscripten/system could help. Hopefully (this is one featurebug of CMake I still don't understand, even after 10 years of using it). And then you shouldn't need to specify -DCORRADE_INCLUDE_DIR.

The "nuclear" solution when everything goes wrong is opening CMake GUI in the directory and pointing all CORRADE_* variables to the dirs/files manually. But that's really the most desperate solution when everything else fails.

from corrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.