View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000413 | mercury | Bug | public | 2016-07-14 01:51 | 2016-07-14 09:44 | ||||
Reporter | lpimmes | ||||||||
Assigned To | juliensf | ||||||||
Priority | immediate | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | Mac OSx Maverick | OS | MAC | OS Version | 10.9.5 | ||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000413: foreign_type("Java", pckLst, "jpckLst" NOT compiling | ||||||||
Description | If above line commented out, then library file compiles (this one), and overall program utilizing library works. But, I need a way of mapping mercury data type, pckLst, to a java datatype. Other pragmas compile OK, i.e., the ones which utilized pckLst datatype. | ||||||||
Steps To Reproduce | Compile lpiUtil directory. Compile routerUtil directory. Makefile in each directory. Do > make ;; in each routerUtil # make mmc --lib-linkage static \ --grade hlc.gc \ --make librouterUtil \ --search-lib-files-dir ../lpiUtil \ --init-file ../lpiUtil/lpiUtil.init \ --link-object ../lpiUtil/liblpiUtil.a Making Mercury/int3s/routerUtil.int3 Making Mercury/ints/routerUtil.int Making Mercury/cs/routerUtil.c routerUtil.m:324: In clause for function `dijkstraPackets_e'/2: routerUtil.m:324: error: undefined symbol `pckLst/1'. routerUtil.m:324: There are `:- pragma foreign_type' declarations for type routerUtil.m:324: `routerUtil.pckLst'/0, so it is treated as an abstract type routerUtil.m:324: in all predicates and functions which are not implemented routerUtil.m:324: for those foreign types. ** Error making `Mercury/cs/routerUtil.c'. make: *** [librouterUtil] Error 1 routerUtil # pwd /Users/lukeimmes/m | ||||||||
Additional Information | Upload source.tar,gz, extract into two directories. Do make in lpiUtil, then do make in routerUtil. Makefile included in each. Thanks for your time. Final program to execute in mercury is dijkstraQueueIntMod. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2016-07-14 09:43 |
There is no bug here -- the problem is precisely what the error message says. The presence of the foreign_type pragma for the type pckLst/0 means that the compiler will not be able to compile the function dijkstra_Packets_e/2 in the Java grade. It will not be able to do this because the Mercury clause for that function refers to the function symbol pckLst/1. That symbol is part of the Mercury type definition for pckLst/0 and won't be visible in the Java grade (since the foreign_type pragma for Java will override that definition). There are two possible resolutions: 1 Use a different arrangement of types so that Mercury clause for dijkstra_Packets_e/2 doesn't depend on that function symbol. 2. Provide a Java foreign_proc for dijkstra_Packets_e/2, which will override the Mercury clause in the Java grade. |
juliensf (administrator) 2016-07-14 09:44 |
This is not a bug. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2016-07-14 01:51 | lpimmes | New Issue | |
2016-07-14 01:51 | lpimmes | File Added: source.tar.gz | |
2016-07-14 09:43 | juliensf | Note Added: 0000895 | |
2016-07-14 09:44 | juliensf | Note Added: 0000896 | |
2016-07-14 09:44 | juliensf | Status | new => closed |
2016-07-14 09:44 | juliensf | Assigned To | => juliensf |
2016-07-14 09:44 | juliensf | Resolution | open => no change required |