{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/4177","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4177/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4177/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4177/events","html_url":"https://github.com/chapel-lang/chapel/pull/4177","id":165831912,"number":4177,"title":"Modifying chpl__header.h (splitting) and adding initial support for incremental compilation","user":{"login":"kushalsingh007","id":6381935,"avatar_url":"https://avatars.githubusercontent.com/u/6381935?v=3","gravatar_id":"","url":"https://api.github.com/users/kushalsingh007","html_url":"https://github.com/kushalsingh007","followers_url":"https://api.github.com/users/kushalsingh007/followers","following_url":"https://api.github.com/users/kushalsingh007/following{/other_user}","gists_url":"https://api.github.com/users/kushalsingh007/gists{/gist_id}","starred_url":"https://api.github.com/users/kushalsingh007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kushalsingh007/subscriptions","organizations_url":"https://api.github.com/users/kushalsingh007/orgs","repos_url":"https://api.github.com/users/kushalsingh007/repos","events_url":"https://api.github.com/users/kushalsingh007/events{/privacy}","received_events_url":"https://api.github.com/users/kushalsingh007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"assignees":[{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-07-15T16:52:18Z","updated_at":"2016-07-19T15:39:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/4177","html_url":"https://github.com/chapel-lang/chapel/pull/4177","diff_url":"https://github.com/chapel-lang/chapel/pull/4177.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/4177.patch"},"body":"\r\nThe changes made to chpl__header.h aim towards the following things\r\n* Previously the chpl__header.h file which was generated was not a\r\n  header file in the true sense, since it could not be included in\r\n  multiple locations (as it contained function definitions, variable\r\n  declarations etc)\r\n* These changes take care of the problems with the previous chpl__header.h\r\n  allowing it to be included separately into modules. The other part of\r\n  this file (previously chpl__header.h) which contained the defintions and other\r\n  related parts  needed for the compilation have been put into a file named \r\n  as chpl__defn.c which would contain the defintions, and declarations etc \r\n  that were previously a part of chpl__header.h but have been separated from it.\r\n* Another purpose of these changes is to allow seperate compilation of the\r\n  modules into object files. Since the new chpl__header.h file can be\r\n  included anywhere, we include it into the user modules and try to\r\n  compile them sepearetely (and later link them to the missing\r\n  components), this would make it easier to narrow down the changes\r\n  made in the files and would be a good choice for aiming towards an\r\n  approach based on incremental recompilation.\r\n* To allow the user modules to be compiled separately, the generated\r\n  makefile has been modified slightly, to include the new files for\r\n  which the corresponding object files need to be generated (user\r\n  modules). In case incremental compilation has been enabled via the\r\n  command line, then the variable CHPLUSEROBJ is set to the required\r\n  value, otherwise it remains unset.\r\n* Compiler is invoked to compile each and everyone of the\r\n  user module files which is specified in the makefile (this might/might\r\n  not, have some impact on the performance, however this can be taken care\r\n  of by modifying the makefiles later on). Note that this feature of\r\n  separate compilation only works after enabling incremental\r\n  compilation via the command line.\r\n\r\n\r\n\r\nThe changes to the Makefile allow the following \r\n* Based on the object files specified in the generated Makefile, now we\r\n  allow each of the object files to be compiled separately (and thus\r\n  generating a separate .o file).\r\n* The new object files consist mainly the object files corresponding to\r\n  user modules (which were not generated and compiled separately).\r\n* When the linker is called, all the object files that have been\r\n  generated (including a.out.tmp.o ) are linked together into a single\r\n  binary file, which later gets renamed to a.out (the final binary)\r\n* Note that this feature is only enabled when incremental\r\n  compilation is enabled via the command line. Otherwise the entire\r\n  thing works as it previously used to work.\r\n\r\n\r\nHowever the current approach does have some limitations \r\n* Adding a test-case highlighting the issues with having external header\r\n  files which contain things like variable definitions, function\r\n  definitions etc.\r\n* Currently such header files cannot be included with incremental\r\n  compilation enabled. Since chpl__header.h includes the external header\r\n  file and these external files are not ideal header files, so they\r\n  cannot be included in multiple locations. Therefore, causing multiple\r\n  symbols to be present while linking which causes errors.\r\n* Added .future containing more detailed description about the issue.\r\n* Also added .compopts and .good to satisfy the requirements for\r\n  testing.\r\n* Also skipifs have been added to the tests which fell under this category (after enabling incremental compilation)\r\n\r\nIncremental compilation can be enabled via --incremental flag (which would ensure separate compilation of user modules etc.) a separate environment variable has also been added to ease the task.\r\n\r\nIn absence of --incremental flag the compilation process works as usual , however the splitting of header file is still done (chpl__header.h to chpl__header.h + chpl__defn.c) .\r\n\r\nstd+gasnet testing done . Thanks to @lydia-duncan "},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/233673480","html_url":"https://github.com/chapel-lang/chapel/pull/4177#issuecomment-233673480","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/4177","id":233673480,"user":{"login":"kushalsingh007","id":6381935,"avatar_url":"https://avatars.githubusercontent.com/u/6381935?v=3","gravatar_id":"","url":"https://api.github.com/users/kushalsingh007","html_url":"https://github.com/kushalsingh007","followers_url":"https://api.github.com/users/kushalsingh007/followers","following_url":"https://api.github.com/users/kushalsingh007/following{/other_user}","gists_url":"https://api.github.com/users/kushalsingh007/gists{/gist_id}","starred_url":"https://api.github.com/users/kushalsingh007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kushalsingh007/subscriptions","organizations_url":"https://api.github.com/users/kushalsingh007/orgs","repos_url":"https://api.github.com/users/kushalsingh007/repos","events_url":"https://api.github.com/users/kushalsingh007/events{/privacy}","received_events_url":"https://api.github.com/users/kushalsingh007/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T15:39:24Z","updated_at":"2016-07-19T15:39:24Z","body":"I ordered and cleaned the commits ..Let me know if there is something else that needs to be done from my side."}}
{"actor":{"display_login":"kushalsingh007"}}