I have a lot of code used by our group. The group gave me a document that explains how to set up the makefile. However, the postdoc entered the commands really fast before and got it to work for a similar project, so I didn't get to understand how the process works. Now that I am working on a different project, though similar to the one above, I need to run make for this new project but don't want to ask that postdoc again

The document explains that I have to do the following:

1. create a new Build directory and cd in there

2. Run ccmake with CMakeLists.txt located in the (root) source folder (I saw the postdoc type `ccmake ../CMakeLists.txt`)

3. then press 'c' and then g

However, I entered all those steps and do not see a makefile in Build, hence I'm getting an error. I'm confused at the 2nd step, I see the following:

CMAKE_BUILD_TYPE               Release                                      
 CMAKE_INSTALL_PREFIX          /usr/local                                   
 PRE_BUILD                     ON                                           

I'm not sure if I'm supposed to use Release for CMAKE_BUILD_TYPE? For step 3, I don't see anything in that Build folder. I remember the postdoc entered rm CMakeCache.txt, but I don't remember when or in which directory. What should I do?


Traditionally, if you are in the root directory of your code base, you should be able to do this:

mkdir Build
cd Build
cmake ..

ccmake is apparently a frontend to cmake, but I've never used it before so I don't know what pressing c and then g refers to, but I'm assuming this is probably or possibly a straight build. So I would just run the commands above and see how it goes. If that works, try again using ccmake just in case pressing c and g actually makes a significant difference.

Before you re-try the build, maybe delete your old Build folder just to keep things clean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.