Page 1 of 2

My observation about CL Compiler setup

Posted: Thu Sep 04, 2008 9:25 am
by hbr_in
Hi,

After working for 2 whole days just to setup a custom compiler, below are my observation about CL Compiler Configuration. Hope it would help u to improve CL.


1, There is no way to mention "release" as configuration for workspace. Either its debug or we need to manually define a new one.

2. Project Build and project only->build, doesn't like custom compilers as seen from below code. Single file compile works but not project compile. It just says noting to be built for all and returns.

Code: Select all

Building: "C:/cygwin/bin/make.EXE"  -j 1 -f "codelite_wrkspc_wsp.mk" type=Debug
----------Building project:[ prj_bootloader - Release ]----------
make[1]: Nothing to be done for `all'.
0 errors, 0 warnings, total time: 00:00:00 seconds
----------Build Ended----------

Code: Select all

Building: "C:/cygwin/bin/make.EXE"  -j 1 -f "prj_bootloader.mk" type=Release
----------Building project:[ prj_bootloader - Release ]----------
make: Nothing to be done for `all'.
0 errors, 0 warnings, total time: 00:00:00 seconds
----------Build Ended----------
I have another project that uses gcc as compiler. For this project, project-> build, project only->build all works well

3. project build/clean doesn't respect working directory & project settings value
i have shown it with proof that the CL executes the custom compiler command from project dir & not from workingdir as mentioned in project settings dialog

4. workspace makefile's are overwritten each time before compilation below command is given
a. workspace->build/rebuild/clean
b. project->build/rebuild/clean
c. project only->build/rebuild/clean

If we have made any changes to these makefiles for testing purpose, they are lost. Since the custom compiler support is broken. i made few changes to these Makefile & found that it is of no use.

Shouldn't Makefile written during
1. Initial Workspace/Project Setup
2. Any changes in Global Build Settings & related project Settings
3. When Makefile is exported

6. Project Makefile is over-written each time
a. workspace->build/rebuild/clean

5. No option to auto detect compilers, at least popular ones. Its always assumed that gcc, g++, vc exists. An Auto-Detect Feature would be good.

TIA

Regards
Gururaja

Re: My observation about CL Compiler setup

Posted: Thu Sep 04, 2008 9:42 am
by eranif
hbr_in wrote:1, There is no way to mention "release" as configuration for workspace. Either its debug or we need to manually define a new one.
I dont see the problem here
hbr_in wrote:2. Project Build and project only->build, doesn't like custom compilers as seen from below code. Single file compile works but not project compile. It just says noting to be built for all and returns.
I will quote the change log for revision 2061 (the current SVN revision is 2071)
------------------------------------------------------------------------
r2061 | eranif | 2008-09-02 16:57:31 +0200 (Tue, 02 Sep 2008) | 3 lines
- Fixed bug in 'Compile Single File' & Custom build where the working directory was not honored
- $(*File*) related macros now converts the path/full path to use Unix style slashes ('/') on all platforms
------------------------------------------------------------------------
hbr_in wrote:3. project build/clean doesn't respect working directory & project settings value
i have shown it with proof that the CL executes the custom compiler command from project dir & not from workingdir as mentioned in project settings dialog
See the above change log
hbr_in wrote:4. workspace makefile's are overwritten each time before compilation below command is given
a. workspace->build/rebuild/clean
b. project->build/rebuild/clean
c. project only->build/rebuild/clean
This is not true. Makefiles are generated incase of:

[*]User has added a new file
[*]First time compilation
[*]User has opened the 'Project Settings' dialog, and dismissed it with 'Ok' in this case the project is marked as dirty


Btw, there is a nice big comment on top of the file, please respect it:
##
## Auto Generated makefile, please do not edit
##
Since you chose to ignore it - I cant do anything about it. If you want to use these makefile manually (e.g. from custom build) - rename them
hbr_in wrote:Shouldn't Makefile written during
1. Initial Workspace/Project Setup
2. Any changes in Global Build Settings & related project Settings
3. When Makefile is exported
They are
hbr_in wrote:. No option to auto detect compilers, at least popular ones.
A patch would be nice
hbr_in wrote:. No option to auto detect compilers, at least popular ones. Its always assumed that gcc, g++, vc exists. An Auto-Detect Feature would be good.
CodeLite does not assume they exist, it provides you with default settings that will work for 95% of the time.


Eran

Re: My observation about CL Compiler setup

Posted: Thu Sep 04, 2008 10:47 am
by hbr_in
eranif wrote:
hbr_in wrote: 1, There is no way to mention "release" as configuration for workspace. Either its debug or we need to manually define a new one.
I dont see the problem here
Debug mode is used to send -g option, no optimization as command arguments to compiler,
Release Mode - Full optimization as specified by some predefined value, no debug mode
eranif wrote: I will quote the change log for revision 2061 (the current SVN revision is 2071)
------------------------------------------------------------------------
r2061 | eranif | 2008-09-02 16:57:31 +0200 (Tue, 02 Sep 2008) | 3 lines
- Fixed bug in 'Compile Single File' & Custom build where the working directory was not honored
- $(*File*) related macros now converts the path/full path to use Unix style slashes ('/') on all platforms
------------------------------------------------------------------------
I said "Project Build and project only->build doesn't like custom compilers" and not custom build. I added a new compiler & used compiler from project->settings->compiler configuration. NOT CUSTOM BUILD

I will keep a watch on svn log from now on. sorry for that. i just used to check at development build page
eranif wrote:
hbr_in wrote:4. workspace makefile's are overwritten each time before compilation below command is given
a. workspace->build/rebuild/clean
b. project->build/rebuild/clean
c. project only->build/rebuild/clean
This is not true. Makefiles are generated incase of:

[*]User has added a new file
[*]First time compilation
[*]User has opened the 'Project Settings' dialog, and dismissed it with 'Ok' in this case the project is marked as dirty
No. Present CL I use (svn ver 2060) overwrites makefiles.

Here is what i did

1. Opened the codelite_wrkspc_wsp.mk & prj_bootloader.mk in Notepad++. notepad++ has a feature to Detect File-Status Changes outside notepad++
2. Did below steps one by one & found which all steps trigger a "file status change" inside notepad++.
a. workspace->build/rebuild/clean
b. project->build/rebuild/clean
c. project only->build/rebuild/clean

3. Noting the triggers, i came to the above conclusion
eranif wrote: Makefiles are generated incase of:
[*]User has opened the 'Project Settings' dialog, and dismissed it with 'Ok' in this case the project is marked as dirty
No. Project makefile did not change/update
1. when i opened project->settings window and closed with ok or with cancel
2. when i opened project->settings window and made some changes to compiler->command options & clicked ok to close the window.

They changed only
1. irrespective of any changes inside project-settings, project makefiles updated when i gave
a. workspace->build/rebuild/clean
2. If previous any changes were done to project-settings window or project settings window is dismissed clicking on OK, then upon next
b. project->build/rebuild/clean
c. project only->build/rebuild/clean
project makefiles are updated.
eranif wrote: Btw, there is a nice big comment on top of the file, please respect it:
Yes i am sorry. But i thought that was one of the way to overcome my above issue with CL.

I am giving these feedback to help/improve CL and make it a better IDE for Programmers. Please dont take it otherwise. I am really happy by the way CL is comming up. I just need to eliminate the other IDE i use. If i get it to work properly, then i can inform my other teammates to switchover to CL.

TIA

Regards
Gururaja

Re: My observation about CL Compiler setup

Posted: Thu Sep 04, 2008 10:59 am
by eranif
hbr_in wrote:Debug mode is used to send -g option, no optimization as command arguments to compiler,
Release Mode - Full optimization as specified by some predefined value, no debug mode
I know what is 'release mode' - give me some credit ;)

You easily define it, or submit a feature request for it, posting it here will probably get lost
hbr_in wrote:Here is what i did

1. Opened the codelite_wrkspc_wsp.mk & prj_bootloader.mk in Notepad++. notepad++ has a feature to Detect File-Status Changes outside notepad++
2. Did below steps one by one & found which all steps trigger a "file status change" inside notepad++.
a. workspace->build/rebuild/clean
b. project->build/rebuild/clean
c. project only->build/rebuild/clean

3. Noting the triggers, i came to the above conclusion
A small correction: All I said it true (even for your version of CodeLite) except that it will regenerate the makefile whenever you open the 'Settings...' dialog
Btw, there is no project only->rebuild

Try running the same command again and again and you will see that notepad++ does notifies about file changes.
hbr_in wrote:1. when i opened project->settings window and closed with ok or with cancel
True, my mistake.

Re: My observation about CL Compiler setup

Posted: Thu Sep 04, 2008 11:30 am
by hbr_in
[quote="eranif]I know what is 'release mode' - give me some credit ;)[/quote]
Please take it. U r doing a wonderful job with CL

Shouldn't th eworkspace & project makefile regenerate only when
1. Initial Workspace/Project Setup
2. Any changes in Global Build Settings &/or related project Settings
3. When Makefile is exported

Not during workspace build/clean/rebuild

[quote="eranif]
Btw, there is no project only->rebuild
[/quote]
Sorry, copy-paste mistake, i take it

Regards
Gururaja

Re: My observation about CL Compiler setup

Posted: Sun Sep 14, 2008 10:19 am
by hbr_in
Hi,

Today i tried CL development build svn build revision 2128, .

1. Sorry to say that the CL still fails to honor working directory & intermediate directory. it still runs the compiler command in workspace directory.

2. when i set the intermediate directory to "C:/prj/sd_fat/testing/bootloader/prj/Release", i get below error

Code: Select all

Building: 
"C:/cygwin/bin/make.EXE"  -j 1 -f "prj_bootloader.mk" type=Release C:/prj/sd_fat/testing/bootloader/prj/Release/command.o
----------Building project:[ prj_bootloader -  ] (Single File Build)----------
prj_bootloader.mk:60: *** target pattern contains no `%'.  Stop.
1 errors, 0 warnings, total time: 00:00:00 seconds
----------Build Ended----------


3. I checked my prj_bootloader.mk.

Code: Select all

all: $(OutputFile)

$(OutputFile): makeDirStep PrePreBuild $(Objects)
	@makedir $(@D)
	$(LinkerName) $(OutputSwitch)$(OutputFile) $(Objects) $(LibPath) $(Libs) $(LinkOptions)

makeDirStep:
	@makedir "Release"
Acccording to this make config, makedirstep should run before $(Objects). But is doesnt. How i know it. There was no "Release" directory anywhere: noting in prj_bootloader directory nor anywhere in $(workingdirectory). Dont know whats happening.

4. Also if i go to project->project settings & change intermediate/working directory fields, apply field doesnt get highlighted.

5. i checked your makefile thoroughly & i no where see the makefile shifting to working directory before exeuting the $(Objects). can i know why.

6. Looking at the main makefile(workspace makefile), we can easily makeout that CL moves to project directory & calls the project makefile which then call the $(objects) directly. It doesnt even call makeDirStep option.

what is suppose to happen
a. CL should 1st honor the working directory. Create if working directory doesnt exist & move to it.
b. check for intermediate directory, if it doesnt exist create it. Then Move to it
c. call compiler commands.


I am sorry to say that the new versions are not helping me to switch completely to CL.
I still need to stay with IDE from my Custom Compiler.
Hoping that soon u will have a working solution

Regards
Gururaja

Re: My observation about CL Compiler setup

Posted: Sun Sep 14, 2008 11:43 am
by eranif
hbr_in wrote:2. when i set the intermediate directory to "C:/prj/sd_fat/testing/bootloader/prj/Release", i get below error
Try to compile the entire project (F7), and then compile single file.
hbr_in wrote:Acccording to this make config, makedirstep should run before $(Objects). But is doesnt. How i know it. There was no "Release" directory anywhere: noting in prj_bootloader directory nor anywhere in $(workingdirectory). Dont know whats happening.
You are not looking at the makefile correctly,

Code: Select all

$(OutputFile): makeDirStep  $(Objects)
this means that the makeDirStep is called only when the target is $(OutputFile), which is not your case. Like I said: Compile the entire project once (at least).
hbr_in wrote:4. Also if i go to project->project settings & change intermediate/working directory fields, apply field doesnt get highlighted.
Confirmed, this looks like an old bug. You can simply click OK
hbr_in wrote:1. Sorry to say that the CL still fails to honor working directory & intermediate directory. it still runs the compiler command in workspace directory.
If you are using the CL built-in makefile generator (which I believe you are) - there is no 'WorkingDirectory' the execution of makefile is simple:
CodeLite executes the workspace makefile, which in turn, cd to the project directory and executes the project's makefile.
There is nothing to honor about $(IntermediateDirectory), CL is not cd to this directory - it only generates the file to that directory.
hbr_in wrote:5. i checked your makefile thoroughly & i no where see the makefile shifting to working directory before exeuting the $(Objects). can i know why.
Read my previous answer: workspace makefile, calls the project makefile. You can assume that when the project makefile is called, CL is already in the project directory.
hbr_in wrote:6. Looking at the main makefile(workspace makefile), we can easily makeout that CL moves to project directory & calls the project makefile which then call the $(objects) directly. It doesnt even call makeDirStep option.
This is because the 'makeDirStep' is called only for 'all' target and not for each file. When compiling single makefile like this:

Code: Select all

"C:/cygwin/bin/make.EXE"  -j 1 -f "prj_bootloader.mk" type=Release C:/prj/sd_fat/testing/bootloader/prj/Release/command.o
The target is 'C:/prj/sd_fat/testing/bootloader/prj/Release/command.o', so the 'all' target is not being executed at all.

To workaround this, compile the project (NOT SINGLE FILE) at least once.
hbr_in wrote:a. CL should 1st honor the working directory. Create if working directory doesnt exist & move to it.
No. There is no 'Working directory' are you referring to 'Intermediate Directory'?
working directory should already exist before switching to it. (Unless you are referring to 'Intermediate Directory' and in that case, there is a bug when compiling single file which does not call makeDirStep, as a workaround, build the entire project at least once - this will go through the makeDirStep)
hbr_in wrote:I am sorry to say that the new versions are not helping me to switch completely to CL.
I still need to stay with IDE from my Custom Compiler.
We are working on it, and I believe we have a little communication problem here :(
Try to join irc channel #codelite at irc.freenode.net - maybe talking directly, we can work it out faster

Eran

Re: My observation about CL Compiler setup

Posted: Sun Sep 14, 2008 11:52 am
by eranif
Having a look at the project settings, made me think that I believe that you are mixing the 'Command' -> working directory and thinks that it affects the compiler.

Please read this (from codelite wiki, yes it exist, and it even has some useful informatin;)):
http://codelite.org/LiteEditor/ProjectSettings

Eran

Re: My observation about CL Compiler setup

Posted: Sun Sep 14, 2008 2:13 pm
by hbr_in
1. i still cannot set release as configuration type. its still show only "debug, new edit> in configuration manager
eranif wrote:
hbr_in wrote:2. when i set the intermediate directory to "C:/prj/sd_fat/testing/bootloader/prj/Release", i get below error
Try to compile the entire project (F7), and then compile single file.
2. Tried workspace clean, project clean project only clean. Thne tried F7 & got below result.

Code: Select all

Building: 
"C:/cygwin/bin/make.EXE"  -j 1 -f "codelite_wrkspc_wsp.mk" type=Debug
----------Building project:[ lpdsp_bootloader - Release ]----------
make[1]: Nothing to be done for `all'.
0 errors, 0 warnings, total time: 00:00:00 seconds
----------Build Ended----------
Then i tried changing the Build settings, Just changed something & then saved & then again reverted back & then saved. Now build works.
eranif wrote:If you are using the CL built-in makefile generator (which I believe you are) - there is no 'WorkingDirectory' the execution of makefile is simple:
CodeLite executes the workspace makefile, which in turn, cd to the project directory and executes the project's makefile.
There is nothing to honor about $(IntermediateDirectory), CL is not cd to this directory - it only generates the file to that directory.
Then why are u having working directory in project settings. If the workspace makefile cant move on to working directory, then simple remove it na.
eranif wrote:Read my previous answer: workspace makefile, calls the project makefile. You can assume that when the project makefile is called, CL is already in the project directory.
I have read all ur settings & makefile some 100 times but still couldnt understand why u r not hanoring workingdirectory. u r not understanding the sole purpose of working directory. WORKING DIRECTORY IS WHERE U WOULD START UR COMPILER NO MATTER WHERE U R.
eranif wrote: This is because the 'makeDirStep' is called only for 'all' target and not for each file. When compiling single makefile like this:

Code: Select all

"C:/cygwin/bin/make.EXE"  -j 1 -f "prj_bootloader.mk" type=Release C:/prj/sd_fat/testing/bootloader/prj/Release/command.o
The target is 'C:/prj/sd_fat/testing/bootloader/prj/Release/command.o', so the 'all' target is not being executed at all.
I will bet this is not happening. i have set "'C:/prj/sd_fat/testing/bootloader/prj/" as wrking directory & release as intermediate directory but still the single file build goes to project direcorty & then builds there & places the object file inside intermediate directoy i.e., release directoy. I can BET ON this.


According to me & most of the people & most of the Other IDE i have seen.

1. No matter where ur project files are, no matter where project setting files are, U should 1st move to $(WORKINGDIR) folder if u have set it. If it doesnt exist then create it & then move to it.
2. call the custom compiler with option as -o $(RELEASE) or $(DEBUG) according to project setting

And definetly CL is not looking at working dir at any time. Not during Workspace build, Project build, project only build or single file build. I am sure on this.

Can u tell me where u r using the Working dir field in compillation. Is it a dummy field.

But right now i am happy that atleast custom build is working. it goes to working dir before running compiler command. Thanks really for that. i can now breath a little.

The CL wiki http://codelite.org/LiteEditor/ProjectSettings clearly says
1. Working Directory Sets the working directory of the executed program . Coule u tel me whats ur opinion about the working directory
eranif wrote: We are working on it, and I believe we have a little communication problem here :(
Try to join irc channel #codelite at irc.freenode.net - maybe talking directly, we can work it out faster
i really really appreciate ur enthu & support when i am asking u all these. but i just want to get things better so that i can recommend CL to every one in my team. The quickest solution to all these is that i move my present working dir to CL project dir. but then i have do the same to my other projects inside my custom compiler IDE & it takes a lot of time to finish it & my team wont agree to it.

I havent used irc channels before so i think i will take some time before i can meet u there

Reagrds
Gururaja

Re: My observation about CL Compiler setup

Posted: Sun Sep 14, 2008 2:31 pm
by eranif
hbr_in wrote:Then why are u having working directory in project settings
Working directory is for the executed program not for the compilations. 'Project Settings' is not all about compiling. It also includes information required for debugging and executing the built program.
hbr_in wrote:I have read all ur settings & makefile some 100 times but still couldnt understand why u r not hanoring workingdirectory.
I will explain it again: Working Directory which is set in the project settings, is not for the compilation - it is for the executed program.
hbr_in wrote:u r not understanding the sole purpose of working directory
Trust me I do.
hbr_in wrote:WORKING DIRECTORY IS WHERE U WOULD START UR COMPILER NO MATTER WHERE U R.
Side note: Please dont write in CAPS
The compiler *always* starts from the project directory - and there is no way to change it.
hbr_in wrote:I will bet this
hbr_in wrote:I will bet this is not happening. i have set "'C:/prj/sd_fat/testing/bootloader/prj/" as wrking directory & release as intermediate directory but still the single file build goes to project direcorty & then builds there & places the object file inside intermediate directoy i.e., release directoy. I can BET ON this.
is not happening. i have set "'C:/prj/sd_fat/testing/bootloader/prj/" as wrking directory & release as intermediate directory but still the single file build goes to project direcorty & then builds there & places the object file inside intermediate directoy i.e., release directoy. I can BET ON this.
What will not happening? I was simply explained to you that the makeDirStep is not being called when executing target other than the 'all' target - this one is a bug in CL (which I already fixed in SVN)

Again, CL will not change directory according to what you have set in the working directory, since he was never designed to do so.
The build process works like this:

cd to workspace directory - executes makefile
makefile: cd project directory
execute project makefile
hbr_in wrote:Working Directory Sets the working directory of the executed program
The key word here is 'executed program' --> I was referring to the output of the build, (e.g. the executable)

Eran