CLion does not properly reload the CMake project - clion

I am using CLion on Linux:
CLion 2016.1.3
Build #CL-145.1617, built on June 7, 2016
JRE: 1.8.0_76-release-b198 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
to build a shared library, but somehow it refuses to reload the generated cmake project when I use the Reload CMake Project button from Tools->CMake menu.
When I do a complete reset with Tools->CMake->Reset Cache and Reload Project the generated cmake files are removed from the /home/username/.CLion2016.1/system/cmake/generated/my_project-c36f8f47/c36f8f47 folder, but no new files are generated.
The only way to update the project now is to restart the IDE. Somehow it can generate the files when the IDE starts, but I don't know why.
Does anyone have an idea on why this problem occurs?

I tracked the problem down to the configure_file command of cmake. When I removed the call to this command from my project the problem did not occur. However, when I tried to reproduce the issue in a minimal project, it also did not occur.
So my problem was solved by just avoiding the use of configure_file, but I could not confirm that the command itself was actually responsible. Some strange behavior indeed.

Related

building cmake from source for Visual Studio 2019

I get the following error, if trying to build cmake 3.18 from https://github.com/microsoft/CMake.
gmake: *** No rule to make target '/home/ubuntu/Projects/CMake/Source/cmStringTable.cxx'
The file by the way is not in any of the folders.
The system is ubuntu arm64.
It is said that this version must be used because of the activated CMake Server mode.
I can build cmake from kitware on the same machine without problems.
This is a known issue with Mircosoft's fork: https://github.com/microsoft/CMake/issues/90
User "tinco" writes:
I fixed it for myself by not using bootstrap and instead using cmake to compile itself.
I think the fix for this is to remove mention of cmStringTable from the bootstrap script. A more complete fix would be to have the bootstrap script generate the components instead of having them hardcoded.
So you should use your system CMake to build Microsoft's fork instead of using their bootstrap script.
It is said that this version must be used because of the activated CMake Server mode.
I wonder, though, who says this? The CMake Server mode was deprecated a while ago. Microsoft releases its own binaries as part of Visual Studio 2019's CMake tools for Windows. I am curious why you want to use this fork on Linux, rather than the upstream version.

Building OpenJDK8 on Windows x64

so I am trying to compile openjdk8 from sources, but I am stuck at missing files problem in the end of compilation process...
Here is the software that I use:
Windows 7 SP1 x64
Windows SDK for Windows 7.1
Microsoft .NET Framework 4
Visual Studio 2010 Express Edition
GNU make 3.82 (compiled by myself)
Freetype 2.3 (compiled by myself)
Oracle JDK 1.7 update 71
Direct X 9.0 (August 2009)
Cygwin
Here are the manuals which I was reading from:
Official README
Royvanrijn's build guide
Some other build guide
Build guide using MSYS
With all these guides I am able to let it compile, however during the Building Images - step , I get an error that some files are missing ( and they are indeed missing ) , which makes me think that something has gone wrong during the build...
There are several points where I afraid I might be doing something wrong...
Cygwin
Right now I use cygwin version 2.8. The openjdk configure script requires cygwin version >1.7 but fails to recognize that 2.8 is greater than 1.7 and throws me an error, so i've tweaked the script (made build work like 2 months ago)...
./configure
My configure command looks as follows:
./configure --disable-ccache --with-freetype=/cygdrive/c/freetype
Maybe I need more arguments here to make it work ( note that i've copied self compiled make executable to cygwin bin folder, so that i dont need to provide its location )
Visual Studio C++ 2010 Express
I would rather try Professional Trial version, but it cannot be found anywhere anymore... (except torrents...) I have a strong feeling that Express version is not suitable for openjdk build. I also get that error with missing ammintrin.h file, but it is easily resolved by creating the empty header file in the include folder of Visual Studio installation.
My basic procedure of building is:
Install all the software above
hg clone http://hg.openjdk.java.net/jdk8/jdk8
./get_source.sh
./configure --disable-ccache --with-freetype=/cygdrive/c/freetype`
make clean images
However, here how it ends :
Does anyone have any clue of how to solve this?
I found the proper fix: using the Cygwin installer, downgrade Grep to 2.27, which properly ignores CRLF line endings.
Run the Cygwin setup (e.g. setup-x86_64.exe)
Advance through the setup wizard until you get to the package selection
Choose "Full" from the View drop-down menu
Type "grep" into the search field
Click the icon in the New column until it shows a 2.x version (2.27 as of this writing)
Click Next and then Finish.
I found myself in the same position as you, except in my case I need OpenJDK build to be repeatable, so "run make repeatedly until it finishes" wasn't an acceptable solution.
Through some experimenting, I found the root cause:
grep was failing because the file being processed had Windows line endings (CRLF)
The Windows line endings were due to the fact that the file is generated by a Java app (fixpaths) which emits platform-native line endings
Identifying fixpaths led me to an old OpenJDK e-mail thread, which reported that some users were having the same problem and fixed it by downgrading.
This gave me the idea to try downgrading grep. I did so, and it worked.
So, after couple of days at this task my only approach was to ignore the errors with the missing files and continue extracting files... This resulted in still working jdk image, which i currently use. My guess is that the errors come frome Oracle boot jdk. Since i am compiling an openjdk, it cannot find oracleJDK files in its headers and thus produces errors.
So, if anyone also gets same errors a me, try to ignore the missing files error and continue the images build.

Using Android NDK on Windows without Cygwin?

Does anyone know if it's possible to use the NDK from Eclipse without having Cygwin installed? If not, what do I need to do in the Eclipse IDE to call the ndk-build executable from within Cygwin?
I ask because I get all kinds of 'invalid directory' messages when I try to compile sample NDK apps, owing to spaces in the directory paths.
There is a project on googlecode called vs-android that lets you build from visual studio, without cygwin.
I recently downloaded the lastest version of the ndk for windows and noticed that it includes a ndk-build.cmd that seems to let you build from windows cli. I need to give that a spin.
edit : it worked for me :)

How to use cmake's try_run under windows on network drives

I'm using CMake to build my project. The project uses some parts of the vxl (http://vxl.sourceforge.net) library. Since I don't need the full vxl lib, I build only the parts I need within my projcet by using cmake's ExternalProject. The Linux port of my project compiles without problems.
The Windows port also compiles fine, if I run everything locally (on C:) on my Windows box! My home dir is mounted as network drive. If I put the cmake build stuff to my home (lets say Z:\ProjectBuild), the vxl configuration (executed by ExternalProject) won't be correct.
The vxl cmake project carries out several tests (e.g. for data types) that use the cmake try_run() command. The created test exe in Z:\ProjectBuild\path\to\exe\ has a side-by-side configuration problem. Windows cannot resolve the path to debugging CRT dlls. If I do the same thing on C:, I don't run in any problems, however I want to have the build stuff in my home. The use of the Visual Studio command prompt didn't solve the problem.
I'm not sure, if it is a cmake problem (in terms of cmake configuration) or a Windows/Visual Studio problem (side-by-side configuration or path).
Any suggestions?
My machine:
Windows XP,
VS 2005 (SP1),
CMake 2.8.1
Thank you
Tobias
The problem seems to be solved. Using another mapped drive under Windows solves the problem. It seems to be sync problem with the Samba shares for my mapped home dir.
The created manifest for the little test application wasn't completely written and than VS embeds a empty manifest without any side-by-side configuration.

How to install OpenCV 2.0 on win32

I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot.
I found some instructions for building the release using cmake at http://opencv.willowgarage.com/wiki/InstallGuide . I downloaded the latest and greatest cmake, and tried to follow the instructions, but I was guessing. No joy.
I specified VC++9 when I did the "configure," but cmake built a VC++ 6 dsw file. No vcproj. I converted the dsw into a vc++9 vcproj anyway, just to see if it would work. Nope. It compiled lots of files, but many failed because it could not find omp.h. Sure enough, it's not there, anywhere. The build log said, 'A tool returned an error code from "Performing Custom Build Step".'
I am lost.
Ideally, I would like to find a full installation with all the files pre-built for Win32 vc++ 2008. Failing that, I need instructions that even I can follow. Short sentences and small words, but lots of them.
Please help!
UPDATE: I tried to build just CXCORE. It complained, "cannot open file 'VCOMPD.lib'" There's that OMP again.
For version 2.0, you must build the project from source.
Here's what you will need:
The OpenCV installer.
CMake. Here's the CMake installer.
Instructions for using CMake to install OpenCV-2.0.01-win32. Those instructions need an extra step if you are using a vc++ Express edition. In that case you must un-check ENABLE_OPENMP when running the CMake GUI.
Instructions for setting up an application project. (Thanks to mloskot for this find.)
If you've installed OpenCV-2.0.0a-win32.exe then it will install pre-built DLLs and libs. Then you just have to follow the instructions in this tutorial.
I recommend that you wipe the folder you previously installed OpenCV2.0 in and reinstall it.
Update:
Well sorry it didn't work out. I suggest the following then: check out the latest version from the SVN repository, https://code.ros.org/svn/opencv/trunk/opencv with any SVN client - I use TortoiseSVN.
Then run CMake (I see you've already installed it) on the source folder and then compile the Solution file. This should work - it does for me.
I apologize for my old answer - I had started off with OpenCV a few months ago in the same way and assumed that downloading the Gold version would still work - apparently not.
OMP
The OMP issue may arise from the checked Enable OpenMP in the CMake config. Try unchecking that .. might solve your initial problem.
I followed Jive Dadson's procedure to get OpenCV2.0 to work on Visual Studio 2010 Express (disabled OMP).
All went good until compilation of the generated stuff in Debug and Release. In both cases got this error: "LINK : fatal error LNK1181: cannot open input file '../../lib/Release/cv200.lib'"
in debug the only difference is that the library is cv200d.lib.
EDIT: I solved by downloading the latest svn snapshot for OpenCV2.0. One additional thing on Vista/7: it may be good to execute CMake as administrator.
Download OpenCV installer for Windows
Read OpenCV-2.0.0a-win32.Readme.Please.txt
Follow OpenCV with Visual C++ 6.0, 2005 Express, and 2008 Express in order to create project using OpenCV

Resources