{"action":"created","issue":{"url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/152","labels_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/152/comments","events_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/152/events","html_url":"https://github.com/jacobwilliams/json-fortran/issues/152","id":105879585,"number":152,"title":"Name mangling issue with intel fortran","user":{"login":"appleparan","id":156580,"avatar_url":"https://avatars.githubusercontent.com/u/156580?v=3","gravatar_id":"","url":"https://api.github.com/users/appleparan","html_url":"https://github.com/appleparan","followers_url":"https://api.github.com/users/appleparan/followers","following_url":"https://api.github.com/users/appleparan/following{/other_user}","gists_url":"https://api.github.com/users/appleparan/gists{/gist_id}","starred_url":"https://api.github.com/users/appleparan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleparan/subscriptions","organizations_url":"https://api.github.com/users/appleparan/orgs","repos_url":"https://api.github.com/users/appleparan/repos","events_url":"https://api.github.com/users/appleparan/events{/privacy}","received_events_url":"https://api.github.com/users/appleparan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-10T19:17:06Z","updated_at":"2015-10-01T03:52:44Z","closed_at":null,"body":"First, I'm using Intel Fortran 12.1.0 20110811. I have succeed build and test. Tests working good, However, when I'm trying to link json-fortran, I got errors.\r\n\r\n1. just including module is alright\r\nWhen I just wrote `use json_module` and add include path & static library (`libjsonfortran.a`) to my compile & link option, it is fine. nothing happend.\r\n\r\n2. Simple printing json file. \r\n```\r\n\r\n        ! initialize the module\r\n        call json_initialize()\r\n\r\n        ! read the file\r\n        call json%load_file(filename = '../files/inputs/test1.json')\r\n\r\n        ! print the file to the console\r\n        call json%print_file()\r\n\r\n        ! clean up\r\n        call json%destroy()\r\n        if (json_failed()) stop 1\r\n\r\n```\r\nWhen  I just ran this code (with variable declaration and use modules), I got 'undefined reference to` error (well-known linking error, which means the program finds declaration but the implementation is not exists. ) \r\n```\r\n/home/ycse02/appleparan/src/patit/obj/IO/read_param.o: In function `read_param':\r\n/home/ycse02/appleparan/src/patit/src/IO/read_param.f90:29: undefined reference to `json_module_MP_json_initialize_'\r\n/home/ycse02/appleparan/src/patit/src/IO/read_param.f90:32: undefined reference to `json_module_MP_json_file_load_'\r\n/home/ycse02/appleparan/src/patit/src/IO/read_param.f90:34: undefined reference to `json_module_MP_json_file_print_to_console_'\r\n/home/ycse02/appleparan/src/patit/src/IO/read_param.f90:93: undefined reference to `json_module_MP_json_file_destroy_\r\n```\r\n\r\nweird thing is `_MP_` \r\n\r\nI also did 'nm -s libjsonfortran.a' and there were all `_mp_` infixes in module procedure. (I know this is related to ifort's name mangling)\r\n```\r\n00000000000251f0 T json_module_mp_get_current_line_from_file_stream_\r\n```\r\n3. When I also added `get` procedures, like `call json%get('version.major', i, found)` statements, in my code, I got compilation error like this.\r\n\r\n```\r\n/home/ycse02/appleparan/src/patit/src/IO/read_param.f90(36): error #8486: There is no matching specific subroutine for this type bound generic subroutine call.   [GET]\r\n    call json%get('fname_input', fname_in, json_found)\r\n```\r\n\r\nI thought compiler didn't find appropriate subroutine for `get` (because it is generic). Moreover, I assumed that this problem still be with strange `_MP_` infixes. Why this library has uppercase `_MP_` infixes? I used `FoBiS` to build `json-fortran`. Is this a `FoBiS` problem? or `FoBiS` option given in `build.sh`?"},"comment":{"url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/comments/144613319","html_url":"https://github.com/jacobwilliams/json-fortran/issues/152#issuecomment-144613319","issue_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/152","id":144613319,"user":{"login":"appleparan","id":156580,"avatar_url":"https://avatars.githubusercontent.com/u/156580?v=3","gravatar_id":"","url":"https://api.github.com/users/appleparan","html_url":"https://github.com/appleparan","followers_url":"https://api.github.com/users/appleparan/followers","following_url":"https://api.github.com/users/appleparan/following{/other_user}","gists_url":"https://api.github.com/users/appleparan/gists{/gist_id}","starred_url":"https://api.github.com/users/appleparan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleparan/subscriptions","organizations_url":"https://api.github.com/users/appleparan/orgs","repos_url":"https://api.github.com/users/appleparan/repos","events_url":"https://api.github.com/users/appleparan/events{/privacy}","received_events_url":"https://api.github.com/users/appleparan/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T03:52:44Z","updated_at":"2015-10-01T03:52:44Z","body":"No I just passed when compiling. I think the reason why they capitalized `_mp_` as they don't want module separator `_mp_` conflicts user defined subroutine which contains `_mp_`. For example, if I made a subroutine as `do_something_mp_do_again` inside a certain module `mod_anything`, that make a problem because compiler recognize `do_something` as module. You can find this issue at [this link](http://computer-programming-forum.com/49-fortran/50fb395e8298e922.htm) and I saw a post in Intel Fortran forum that explain it is hard to fix implementation to change all `_mp_`s to `_MP_`s. It is intel fortran problem and I think it is good idea to make a documentation because it could affect all Intel Fortran versions. \r\n\r\nP.S. I don't understand why fortran standard committee makes module as binary. Not only this issue, making interface file as binary (module) is a bad idea because it depends on compilers (gfortran, ifort and so on.)"}}