2024-03-29 17:58 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000413mercuryBugpublic2016-07-14 09:44
Reporterlpimmes 
Assigned Tojuliensf 
PriorityimmediateSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformMac OSx MaverickOSMACOS Version10.9.5
Product Version 
Target VersionFixed in Version 
Summary0000413: foreign_type("Java", pckLst, "jpckLst" NOT compiling
DescriptionIf 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 ReproduceCompile 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 InformationUpload 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.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000895

juliensf (administrator)

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.

~0000896

juliensf (administrator)

This is not a bug.
+Notes

-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
+Issue History