Thank you for all of the advice, but we are still having some problems.
We created libGHC.a as described by a response to our previous post, 
and linked it into our main project.  We are trying to compile a file 
"Main.hs" which includes a subset of the Main.hs file for GHC (the module 
declaration, imports, and the function parseModule, see code at the end of 
this message) using a Makefile (which also appears at the end of this 
message).  When we execute "make all"  we get a number of errors reporting 
undefined references to ThinAir of the form:

/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1974):
undefined reference to `ThinAir_tpl_closure' 

(the full error message appears below).

We do not have a model for where these "ThinAir" errors are coming from 
and how we can eliminate them. Any advice would be greatly appreciated. 

Kate Golder

========== make all : Error ===============================================
[kgolder @ zante testParse]$ make all
make: *** Warning: File `Makefile' has modification time in the future
(964897481 > 964897312)
ghc-4.08 -lHSlang -lThinAir -lHSrts -lGHC -L.
-L/usr/users/deforest/ghc-4.08/fptools-binaries/i386-unknown-linux
-no-link-chk -o TestParse -cpp
-i.:compiler/absCSyn:compiler/basicTypes:compiler/codeGen:compiler/coreSyn:compiler/cprAnalysis:compiler/deSugar:compiler/hsSyn:compiler/javaGen:compiler/main:compiler/nativeGen:compiler/parser:compiler/prelude:compiler/profiling:compiler/rename:comp
iler/simplCore:compiler/simplStg:compiler/specialise:compiler/stgSyn:compiler/stranal:compiler/typecheck:compiler/types:compiler/usageSP:compiler/utils:/home/lumberjacks/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/imports/lang/
 -fglasgow-exts Main.o  
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1974):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1978):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x197c):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1980):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1984):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1988):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x198c):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19a4):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19a8):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19ac):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19b0):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19b4):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19b8):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19bc):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19e4):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19e8):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19ec):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19f0):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19f4):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19f8):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x19fc):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a24):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a28):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a2c):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a30):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a34):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a38):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a3c):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a64):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a68):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a6c):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a70):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a74):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a78):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1a7c):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x1afc):
undefined reference to `ThinAir_thinAirIdMapRef_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x299f):
undefined reference to `ThinAir_tpl_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x29fc):
undefined reference to `ThinAir_tpl2_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x2a5b):
undefined reference to `ThinAir_tpl4_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x2abb):
undefined reference to `ThinAir_tpl6_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x2b1b):
undefined reference to `ThinAir_tpl8_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x2b7b):
undefined reference to `ThinAir_tpl10_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x2be8):
undefined reference to `ThinAir_tpl12_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x4057):
undefined reference to `ThinAir_thinAirIdMapRef_closure'
/usr/users/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/libGHC.a(TcModule.o)(.text+0x3fd3):
undefined reference to `ThinAir_go_fast1'
make: *** [all] Error 1
[kgolder @ zante testParse]$ 
======================================================================
========== Main.hs ====================================================
module Main where

import IO               ( hPutStr, stderr )
import HsSyn
import BasicTypes       ( NewOrData(..) )

import RdrHsSyn         ( RdrNameHsModule )
import FastString       ( mkFastCharString, unpackFS )
import StringBuffer     ( hGetStringBuffer )
import Parser           ( parse )
import Lex              ( PState(..), P, ParseResult(..) )
import SrcLoc           ( mkSrcLoc )

import Rename           ( renameModule )
import RnMonad          ( InterfaceDetails(..) )

import MkIface          ( startIface, ifaceDecls, endIface )
import TcModule         ( TcResults(..), typecheckModule )
import Desugar          ( deSugar )
import SimplCore        ( core2core )
import OccurAnal        ( occurAnalyseBinds )
import CoreLint         ( endPass )
import CoreUtils        ( coreBindsSize )
import CoreTidy         ( tidyCorePgm )
import CoreToStg        ( topCoreBindsToStg )
import StgSyn           ( collectFinalStgBinders, pprStgBindings )
import SimplStg         ( stg2stg )
import CodeGen          ( codeGen )
import CodeOutput       ( codeOutput )

import Module           ( ModuleName, moduleNameUserString )
import AbsCSyn          ( absCNop )
import CmdLineOpts
import ErrUtils         ( ghcExit, doIfSet, dumpIfSet )
import Maybes           ( maybeToBool, MaybeErr(..) )
import TyCon            ( isDataTyCon )
import Class            ( classTyCon )
import UniqSupply       ( mkSplitUniqSupply )

import FiniteMap        ( emptyFM )
import Outputable
import Char             ( isSpace )

main = testParse "Demodule.hs"

testParse filename = do
    buf <- hGetStringBuffer True{-expand tabs-} filename
    case parse buf PState{ bol = 0#, atbol = 1#,
                           context = [], glasgow_exts = glaexts,
                           loc = mkSrcLoc src_filename 1 } of

        PFailed err -> do
                printErrs err
                ghcExit 1
                return (error "parseModule") -- just to get the types right

        POk _ m@(HsModule mod _ _ _ _ _ _) -> 
                return (mod, m)
  where
        glaexts | opt_GlasgowExts = 1#
                | otherwise       = 0#
======================================================================
========== Makefile =====================================================
HC      = ghc-4.08

INTERFACE_FILES =
.:compiler/absCSyn:compiler/basicTypes:compiler/codeGen:compiler/coreSyn:compiler/cprAnalysis:compiler/deSugar:compiler/hsSyn:compiler/javaGen:compiler/main:compiler/nativeGen:compiler/parser:compiler/prelude:compiler/profiling:compiler/rename:compil
er/simplCore:compiler/simplStg:compiler/specialise:compiler/stgSyn:compiler/stranal:compiler/typecheck:compiler/types:compiler/usageSP:compiler/utils:/home/lumberjacks/deforest/ghc-4.08/fptools-binaries/lib/i386-unknown-linux/imports/lang/

HC_OPTS = -cpp -i$(INTERFACE_FILES) $(EXTRA_HC_OPTS) -fglasgow-exts

SRCS = Main.hs 
OBJS = Main.o 
.SUFFIXES : .o .hs .hi .lhs .hc .s

all: $(OBJS)
        $(HC) -lHSlang -lGHC -L.
-L/usr/users/deforest/ghc-4.08/fptools-binaries/i386-unknown-linux -o
TestParse $(HC_OPTS) $(OBJS) 

#NOTE: the space at the beginning of the previous line must be 
#      exactly one tab character (not spaces). 
#      This is true for all of the functions in the rest of the Makefile.


# Standard suffix rules
.o.hi:
        @:

.lhs.o:
        $(HC) -c $< $(HC_OPTS)

.hs.o:
        $(HC) -c $< $(HC_OPTS)


depend :
        $(HC) -M $(HC_OPTS) $(SRCS)




# DO NOT DELETE: Beginning of Haskell dependencies
Main.o : Main.hs
Main.o : compiler/hsSyn/HsSyn.hi
Main.o : compiler/basicTypes/BasicTypes.hi
Main.o : compiler/parser/RdrHsSyn.hi
Main.o : compiler/utils/FastString.hi
Main.o : compiler/utils/StringBuffer.hi
Main.o : compiler/parser/Parser.hi
Main.o : compiler/parser/Lex.hi
Main.o : compiler/basicTypes/SrcLoc.hi
Main.o : compiler/rename/Rename.hi
Main.o : compiler/rename/RnMonad.hi
Main.o : compiler/main/MkIface.hi
Main.o : compiler/deSugar/Desugar.hi
Main.o : compiler/simplCore/SimplCore.hi
Main.o : compiler/simplCore/OccurAnal.hi
Main.o : compiler/coreSyn/CoreLint.hi
Main.o : compiler/coreSyn/CoreUtils.hi
Main.o : compiler/coreSyn/CoreTidy.hi
Main.o : compiler/stgSyn/CoreToStg.hi
Main.o : compiler/stgSyn/StgSyn.hi
Main.o : compiler/simplStg/SimplStg.hi
Main.o : compiler/codeGen/CodeGen.hi
Main.o : compiler/main/CodeOutput.hi
Main.o : compiler/basicTypes/Module.hi
Main.o : compiler/absCSyn/AbsCSyn.hi
Main.o : compiler/main/CmdLineOpts.hi
Main.o : compiler/main/ErrUtils.hi
Main.o : compiler/utils/Maybes.hi
Main.o : compiler/types/TyCon.hi
Main.o : compiler/types/Class.hi
Main.o : compiler/basicTypes/UniqSupply.hi
Main.o : compiler/utils/FiniteMap.hi
Main.o : compiler/utils/Outputable.hi
# DO NOT DELETE: End of Haskell dependencies
======================================================================


Reply via email to