Sample Header Ad - 728x90

How to compile without optimizations -O0 using CMake

30 votes
4 answers
81428 views
I am using Scientific Linux (SL). I am trying to compile a project that uses a bunch of C++ (.cpp) files. In the directory user/project/Build, I enter make to compile and link all the .cpp files. I then have to go to user/run/ and then type ./run.sh values.txt To debug with GDB, I have to go to user/run and then type gdb ../project/Build/bin/Project and to run, I enter run -Project INPUT/inputfile.txt. However, I am trying to print out the value of variable using p variablename. However, I get the message s1 = . I have done some research online, and it seems I need to compile without optimizations using -O0 to resolve this. But where do I enter that? In the CMakeLists? If so, which CMakeLists? The one in project/Build or project/src/project?
Asked by user4352158 (471 rep)
Feb 28, 2015, 10:08 PM
Last activity: Jun 24, 2024, 07:12 AM