Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling the project with Unix #996

Open
Muqi-Zou opened this issue Feb 9, 2021 · 4 comments
Open

Error when compiling the project with Unix #996

Muqi-Zou opened this issue Feb 9, 2021 · 4 comments

Comments

@Muqi-Zou
Copy link

Muqi-Zou commented Feb 9, 2021

Hi:
I meet following error when trying to compile the project with command :
msbuild /p:Configuration=UnixRelease /p:Platform=x64 src/Reko-decompiler.sln

"/home/muqi/decompile_tool/reko/src/Reko-decompiler.sln" (default target) (1) ->
"/home/muqi/decompile_tool/reko/src/Native/NativeProxy.csproj" (default target) (64) ->
(AfterBuild target) -> 
  EXEC : CMake error : CMAKE_C_COMPILER not set, after EnableLanguage [/home/muqi/decompile_tool/reko/src/Native/NativeProxy.csproj]
  EXEC : CMake error : CMAKE_CXX_COMPILER not set, after EnableLanguage [/home/muqi/decompile_tool/reko/src/Native/NativeProxy.csproj]
  /home/muqi/decompile_tool/reko/src/Native/NativeProxy.csproj(167,5): error MSB3073: The command "cmake -DREKO_PATH="/home/muqi/decompile_tool/reko/src/../" -DCMAKE_BUILD_TYPE=UnixRelease -DREKO_PLATFORM=x64 -P "/home/muqi/decompile_tool/reko/src/Native/reko.cmake"" exited with code 1.

    16 Warning(s)
    3 Error(s)

I believe I have installed all require package for .Net Frame, C# and cmake, though I am not 100% sure. Meanwhile, running "cmake .. && make" in Native/build works good for me.
Here is the info of my desktop:

OS: Ubuntu 18.04.5 (LTS)
arch: x86_64
msbuild -version: 16.6.0.60701
cmake --version: cmake version 3.10.2
mono --version: Mono JIT compiler version 6.12.0.107 (tarball Thu Dec 10 05:22:56 UTC 2020)

@uxmal
Copy link
Owner

uxmal commented Feb 9, 2021

As an initial workaround, try setting the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER environment variables to something appropriate for your system, e.g. /usr/bin/gcc and /usr/bin/g++ respectively.

@Muqi-Zou
Copy link
Author

Muqi-Zou commented Feb 9, 2021

here is what I have tried:

  1. start with a new folder to download reko
  2. run following commands to install necessary packages:
msbuild /t:restore /p:Configuration=UnixRelease /p:Platform=x64 src/Reko-decompiler.sln
nuget restore src/Reko-decompiler.sln
  1. run following to set the CMAKE:
muqi@muqi-desktop:~/decompile_tool/reko$ which gcc
/usr/bin/gcc
muqi@muqi-desktop:~/decompile_tool/reko$ which g++
/usr/bin/g++
muqi@muqi-desktop:~/decompile_tool/reko$ which clang
/usr/bin/clang
muqi@muqi-desktop:~/decompile_tool/reko$ export CMAKE_C_COMPILER=/usr/bin/gcc
muqi@muqi-desktop:~/decompile_tool/reko$ export CMAKE_CXX_COMPILER=/usr/bin/g++

4(a). run msbuild /p:Configuration=UnixRelease /p:Platform=x64 src/Reko-decompiler.sln and same problem appears.
4(b). run cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/g++ -DREKO_PATH="/home/muqi/decompile_tool/reko/src/../" -DCMAKE_BUILD_TYPE=UnixRelease -DREKO_PLATFORM=x64 -P "/home/muqi/decompile_tool/reko/src/Native/reko.cmake" at ./reko/src/Native$

== Configuration ==
=> Build Type: UnixRelease
=> Generator : 
=> Platform  : x64

-- Building native libraries
CMake Error at CMakeLists.txt:3 (project):
  Generator

    Unix Makefiles

  does not support platform specification, but platform

    x64

  was specified.


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/muqi/decompile_tool/reko/src/Native/build/x64/UnixRelease/CMakeFiles/CMakeOutput.log".
CMake Error at reko.cmake:104 (message):
  [CMake] native configuration failed for:
  /home/muqi/decompile_tool/reko/src/Native
Call Stack (most recent call first):
  reko.cmake:36 (invoke_cmake)
  reko.cmake:139 (process_project)

@smx-smx
Copy link
Collaborator

smx-smx commented Mar 11, 2021

We're building on multiple CIs and i cannot reproduce this.
I'd try again on a fresh clone of the master branch in a new directory, but it looks like cmake is having troubles detecting a working C compiler on your system.

Does any other cmake project (like a hello world C project) work?

@Muqi-Zou
Copy link
Author

Yes, I think I updated my cmake as well.

muqi@muqi-desktop:~/decompile_tool/reko/src/Native$ which cmake
/usr/bin/cmake
muqi@muqi-desktop:~/decompile_tool/reko/src/Native$ cmake --version
cmake version 3.20.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

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

No branches or pull requests

3 participants