2024-05-18 21:43 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000358mercuryBugpublic2014-09-04 08:22
Reporterlpimmes 
Assigned Tozs 
PriorityurgentSeveritycrashReproducibilityalways
StatusclosedResolutionno change required 
PlatformOracle Linux 6.5OSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000358: mih files not found, but code works on OSX maverick
Description[oracle@localhost fileIO]$ mmc --version
Mercury Compiler, version 14.01, configured for x86_64-unknown-linux-gnu
Copyright (C) 1993-2014 The University of Melbourne
Steps To ReproducefileIO.m requires ../lpiUtil.m

[oracle@localhost fileIO]$ make
mmc --make --fully-strict -E -v --use-subdirs fileIO \
    --grade hlc.gc \
    -O 6 \
    --search-lib-files-dir ../lpiUtil \
    --init-file ../lpiUtil/lpiUtil.init \
    --link-object ../lpiUtil/liblpiUtil.a
** Error: file `Mercury/mihs/lpiUtil.mih' not found: file `lpiUtil.mih' not found
make: *** [fileIO] Error 1

.so file present; normally it would be absent.
[oracle@localhost lpiUtil]$ ls
liblpiUtil.a liblpiUtil.so lpiUtil.err lpiUtil.init lpiUtil.m lpiUtil.mh Makefile Mercury

[oracle@localhost lpiUtil]$ uname -a
Linux localhost.localdomain 3.8.13-16.2.1.el6uek.x86_64 0000001 SMP Thu Nov 7 17:01:44 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
[oracle@localhost lpiUtil]$

[oracle@localhost lpiUtil]$ mmc --version
Mercury Compiler, version 14.01, configured for x86_64-unknown-linux-gnu
Copyright (C) 1993-2014 The University of Melbourne
[oracle@localhost lpiUtil]$

Makefile for lpiUtil.m
[oracle@localhost lpiUtil]$ cat Makefile
# 05/28/2014
# make
# none.gc.stseg ;; works, i.e. compile, link
# hlc.gc ;; works, i.e, compile, link, provided you declare

GRADE = hlc.gc
#GRADE = java
default: liblpiUtil

liblpiUtil:
    mmc --make liblpiUtil

# To start over from scratch, type 'make clean'.
clean:
    $(RM) *~
    $(RM) -rf Mercury
    $(RM) liblpiUtil
    $(RM) *.err
    $(RM) *.mh
    $(RM) *.init
    $(RM) *.a
    $(RM) *.dylib
[oracle@localhost lpiUtil]$


fileIO.m (with lpiUtil.m)
Code compiles and runs perfectly on:
fileIO 497>uname -a
Darwin luke-immess-imac-2.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
fileIO 497>mmc --version
Mercury Compiler, version 14.01, configured for x86_64-apple-darwin13.1.0
Copyright (C) 1993-2014 The University of Melbourne
fileIO 497>

It is probably a compiler or linker option; but not sure how to proceed.
Any ideas? Thanks.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000781

lpimmes (reporter)

Adding:
mmc --lib-linkage static --make liblpiUtil

Same problem occurs when compiling fileIO.m that requires lpiUtil.m

[oracle@localhost fileIO]$ make
...
e-to-c --use-subdirs fileIO'
% Touching `Mercury/err_dates/fileIO.err_date'... done.
% Parsing module `fileIO' and imported interfaces...
% Module qualifying items...
% done.
% Expanding equivalence types...
% done.
% Converting parse tree to hlds...
% done.
% Post-processing type definitions...
% Checking typeclasses...
% Checking instance declaration types...
% Checking typeclass instances...
% Checking for cyclic classes...
% Checking for missing concrete instances...
% Checking functional dependencies on instances...
% Checking typeclass constraints...
... error log truncated, see `fileIO.err' for the complete log.
** Error: file `Mercury/mihs/lpiUtil.mih' not found: file `lpiUtil.mih' not found
make: *** [fileIO] Error 1

~0000782

lpimmes (reporter)

Problem fixed: you must use same GRADE for library as well as caller of that library.
mmc --lib-linkage static --grade ${GRADE} --make liblpiUtil

~0000783

zs (developer)

Before reporting another bug, please consider that the problem may not be in the Mercury system but in your understanding of it. The proper venue for such questions is the mercury-users mailing list, not the bug database.
+Notes

-Issue History
Date Modified Username Field Change
2014-09-03 23:09 lpimmes New Issue
2014-09-03 23:18 lpimmes Note Added: 0000781
2014-09-03 23:59 lpimmes Note Added: 0000782
2014-09-04 08:22 zs Note Added: 0000783
2014-09-04 08:22 zs Status new => closed
2014-09-04 08:22 zs Assigned To => zs
2014-09-04 08:22 zs Resolution open => no change required
+Issue History