Errors when running and reloadding CMake project with CLion
I am trying to use fips with CLion but I'm ecountering trouble when running targets and reloading the CMake project. I've tried to use oryol with CLion, as in the Youtube video, and ecountered the same problem. Here is output from reloading (http://pastebin.com/7hgJA3Ez) the oryol CMake Project and running (http://pastebin.com/7hgJA3Ez) DebugText sample using CLion.
From first glance it looks like CLion is using gcc via mingw, fips currently assumes that on Windows the VStudio compilers are used (unless it's a cross-compiling scenario). I'll see if I can find a simple solution.
+1
I ran into this same scenario running fips from a MINGW64 prompt from the MSYS2 distribution. Cmake finds gcc, but is fed cl.exe compile switches.
I'd like to try my hand on figuring out how to make a msys2-make-release config, any tips on where to find info on that ?
gr. S
I don't have a solution sorry, I have installed MSYS2 now but cmake already fails to identify the compiler (I first ran ./fips set config linux-make-release to manualle select a Unix/GCC/make build, but then cmake fails with:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFIPS_CONFIG=linux-make-release -DFIPS_USE_CCACHE=OFF -DFIPS_AUTO_IMPORT=ON -BC:/msys64/home/aweissflog/fips-build/fips-hello-world/linux-make-release -HC:/msys64/home/aweissflog/fips-hello-world
-- The C compiler identification is unknown
CMake Error: Could not find cmake module file: C:/msys64/home/aweissflog/fips-build/fips-hello-world/linux-make-release/CMakeFiles/3.6.2/CMakeCCompiler.cmake
-- The CXX compiler identification is unknown
CMake Error: Could not find cmake module file: C:/msys64/home/aweissflog/fips-build/fips-hello-world/linux-make-release/CMakeFiles/3.6.2/CMakeCXXCompiler.cmake
System is unknown to cmake, create:
Platform/MINGW64_NT-6.1 to use this system, please send your config file to [email protected] so it can be added to cmake
CMake Error: File C:/msys64/home/aweissflog/fips-hello-world/C:/msys64/home/aweissflog/fips-build/fips-hello-world/linux-make-release/CMakeCache.txt does not exist.
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeSystemSpecificInformation.cmake:44 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
C:/msys64/home/aweissflog/fips-hello-world/CMakeLists.txt
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please send that file to [email protected].
-- Check for working C compiler: /mingw64/bin/cc.exe
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
Unknown extension ".c" for file
C:/msys64/home/aweissflog/fips-build/fips-hello-world/linux-make-release/CMakeFiles/CMakeTmp/testCCompiler.c
try_compile() works only for enabled languages. Currently these are:
C CXX
See project() command to enable other languages.
Call Stack (most recent call first):
C:/msys64/home/aweissflog/fips-hello-world/CMakeLists.txt
-- Check for working C compiler: /mingw64/bin/cc.exe -- broken
CMake Error at /usr/share/cmake-3.6.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/mingw64/bin/cc.exe" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/msys64/home/aweissflog/fips-hello-world/CMakeLists.txt
-- Configuring incomplete, errors occurred!
[ERROR] failed to generate build files for config 'linux-make-release'
[ERROR] 1 out of 1 configs failed!
A simple hello-world cmake project works though (it also prints warnings about an unknown platform, but is able to generate and build the project, so I'm not sure why running cmake through fips fails.
Slightly related, @fungos recently implemented a fix for Cygwin (but this just helps to automatically select the 'linux-make-debug' build configuration:
https://github.com/floooh/fips/commit/a056d39c1ae1a1cd569f305cdcdc80484160e059
Hi, When compiling on Msys2, cmake needs to generate MSYS Makefiles. I forked fips and quickly implemented mingw64-make-[release,debug,profiling], edited fips.cmake, added a toolchain file (copied linux toolchain file and made minor edits) and edited the gen.py file.
I committed the changes, but oryol fails to build on msys as it still detects windows and implements backtracing and other win related stuff. my fork is: https://github.com/sanderboer/fips.git
cheers.
off topic, I edited/hacked fips-include.cmake in oryol to set ORYOL_LINUX=1 when building on mingw64 Now it halts on the various static asserts on sizeof(SamplerState etc), it apparently does not return the right number. Quick tips or should I take this to the oryol repo issue list now ?
Hmm I'm not sure how compiling and linking GL programs on MingW would even work with the current build system setup, does MinGW have their own GL headers and GL wrapper DLLs that are called the same as on Linux? The Oryol Linux version links against various X-Window libs (via GLFW), and the GL DLLs are called differently on Windows and Linux, I don't think the Oryol build system would work in this half-unix/half-windows environment (the Cygwin stuff only works for simple command line tools for instance).
Maybe a stupid think to ask, but why are you not simply using the VS compiler on Windows (for instance the Community Edition), or compile on a real Linux? Would make your life much easier ;)
PS: I'm not sure why the static_asserts would fail, I only saw something similar when compiling on Visual Studio, that"s why these #ifdefs exists: https://github.com/floooh/oryol/blob/master/code/Modules/Gfx/Core/Enums.h#L493
Maybe mingw's gcc somehow tries to emulate that odd Visual Studio bitfield packing behaviour?
I have no problem compiling bare glfw gl programs on msys2, it is how I started learning gl . But you're right, it is a matter of taste. I just like the msys2 environment, use emacs, the whole deal. The compiled programs are proper windows executables which you can distribute with some mingw dlls. I started using it after I read this emacs win64 build guideline: https://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/
I ran into some typical win probs checking out a fresh fips on a windows shell, complaining that the proposed remotery commit does not exist etc, tried it again in msys2 and it worked. Probably something I did with ptyhon or cmake or git on windows. Just so tired of coralling cmake/git/python2 on windows. And, the entire point of fips'ing 3rdparty library is that windows is just very ineffective in keeping a sane dev environment together.
Anyway, thanks for the info, I'll try ifdeffing oryol here and there, if it fails, I'll just use msvc compile.
I've been thinking a bit more about this:
I guess for proper msys2 support it would make sense to handle this a bit like the RaspberryPi, it's a mostly Linux-like platform, but with some differences.
Have a look at the lines 10 to 19 here: https://github.com/floooh/fips/blob/master/cmake-toolchains/linux.cmake. The most important thing would be to give both FIPS and Oryol variables and defines to identify the MSYS2 platform:
FIPS_POSIX would be set, since MSYS2 is a Posix platform (like OSX, but unlike native Windows builds), definitely define a new FIPS_MSYS2 variable. I'm not sure what to do about FIPS_LINUX and/or FIPS_WINDOWS.
On the Oryol side, I would probaly neither define ORYOL_LINUX nor ORYOL_WINDOWS (see here: https://github.com/floooh/oryol/blob/master/fips-include.cmake#L88), but instead have an ORYOL_MSYS2 (together with ORYOL_POSIX).
From there on it should be possible to make the smallest required changes to Oryol and the CMakeLists.txt scripts to handle the platform, but it may be tricky for 3rd party code (for instance GLFW, or SoLoud).
Good luck :)
I just ran head first into this. Makes sense that it would be difficult to use a half posix/half windows solution. Honestly the most likely way to succeed from my perspective would be this:
https://github.com/Microsoft/vcpkg
If you can fipsify vcpkg packages then you are golden! (supposedly vcpkg is cross platform so should ease this.)