MAGIC Magic Mailing List
 
 

From: Stefan Robert (srobert AT hermes DOT usherb.ca)
Date: Sun Mar 30 2003 - 15:47:58 EST

  • Next message: Stefan Robert: "Solved... partially! magic 7.2 and compile problems with MacOS X"

    Hi all,
    
    An update on my situation and I thought this might be a good thing to 
    share.
    
    I found out what caused my problem for compiling magic on my 
    installation of MacOS X. Three things:
    
    1) Tcl/Tk installed with fink
    
      Following Mike Doster example I solved this by removing tcl/tk with 
    fink and compiling the source code from sourceforge.net. (Please note 
    that I compiled the unix version, not the macosx version of the source 
    code. The macosx version does not build shared libraries by default... 
    and since I am not familiar with project builder I did not know how to 
    do this. The unix version shared library builds are activated by typing 
    : ./configure --enable-shared (see 
    http://www.tcl.tk/doc/howto/compile.html)
    
    2) Matlab 6
    
    Yes, to my surprise Matlab 6 installs a version of "ldd". However, 
    since on MacOS X we use "otool", this Matlab version of "ldd" runs 
    "otool" by default. This means that the magic config script finds and 
    believes that I have "ldd" on my mac. This tricks the script into using 
    cfield = 3 instead of cfield = 1 in the config script for this command 
    when the Matlab MacOS X "ldd" is in reality "otool":
    
    set tclshareddir=`$lddexe $wishexe | grep libtcl | cut -d':' -f1 | cut 
    -d' ' -f${cfield}`
    
    So I would propose to change the config script to look for "otool" 
    before "ldd" instead of the other way around (assuming that "otool" 
    does not exist for something else on other platforms). :
    
    ----- Start of suggested modifications (line 150) ----
    
    if ($?usingTcl) then
        set lddexe=`which otool`
        if ($status == 1) then
           set lddexe=`which ldd`
           if ($status == 1) then
              unset lddexe
           else
              set lddexe="ldd"
              set cfield=3
           endif
        else
           set lddexe="otool -L"
           set cfield=1
        endif
    
    ----- End of suggested modifications
    
    3) I tried to compile magic for X11 and OpenGL but I still get the same 
    "common" errors. The -fno-common flag is set... Since this goes beyond 
    my programming knowledge (as I am not a programmer) I just compiled 
    magic for X11. Did someone compile magic for X11 and OpenGL on MacOS X? 
    (Mike?)
    
    thank you for your help
    
    Stefan
    
    
    Le Vendredi, 28 mars 2003, à 20:03 America/Montreal, Michael Doster a 
    écrit :
    
    > Stefan,
    >
    > Check to make sure that -fno-common is in your gcc compilation line 
    > also,
    > because that's what the "common" errors usually mean.  I was able to
    > successfully compile Magic-7.2.32 for Mac OS X w/ the Tcl interface 
    > without
    > incident so I know it really does work.
    >
    > -- Mike Doster
    >
    >> Hi everyone,
    >>
    >> I am trying to compile magic 7.2.32 on MacOS X 10.2.4 and compile 
    >> fails
    >> at the end.
    >>
    >> Prior to making the files I installed Apple's latest X11 beta3 and by
    >> using fink, I installed tcl/tk version 8.4.
    >>
    >> First, I tried the recommended configuration using OpenGL + X11 and I
    >> got those error messages when compiling libgraphics.o
    >>
    >> --- linking libgraphics.o
    >> rm -f libgraphics.o
    >> ld -r grMain.o grLock.o grDStyle.o grText.o grCMap.o grClip.o
    >> grGlyphs.o grNull.o W3Dmain.o grTk1.o grTk2.o grTk3.o gr
    >> Tk4.o grTk5.o grTOGL1.o grTOGL2.o grTOGL3.o grTOGL4.o grTOGL5.o
    >> grTkCommon.o -o libgraphics.o
    >> ld: multiple definitions of symbol _grXdpy
    >> grTk1.o definition of _grXdpy in section (__DATA,__common)
    >> grTOGL1.o definition of _grXdpy in section (__DATA,__common)
    >> ld: multiple definitions of symbol _grXscrn
    >> grTk1.o definition of _grXscrn in section (__DATA,__common)
    >> grTOGL1.o definition of _grXscrn in section (__DATA,__common)
    >> ld: multiple definitions of symbol _grPixels
    >> grTk1.o definition of _grPixels in section (__DATA,__common)
    >> grTOGL2.o definition of _grPixels in section (__DATA,__common)
    >> ld: multiple definitions of symbol _grPlanes
    >> grTk1.o definition of _grPlanes in section (__DATA,__common)
    >> grTOGL2.o definition of _grPlanes in section (__DATA,__common)
    >> ld: multiple definitions of symbol _grCursors
    >> grTk5.o definition of _grCursors in section (__DATA,__common)
    >> grTOGL5.o definition of _grCursors in section (__DATA,__common)
    >> make[2]: *** [libgraphics.o] Error 1
    >>
    >> This error seemed to prevent compilation of the tcl shared libs. One 
    >> of
    >> the first error of compilation was:
    >>
    >> make[2]: *** No rule to make target `../graphics/libgraphics.o', 
    >> needed
    >> by `tclmagic.dylib'.  Stop.
    >>
    >> Ok, I suspected that choosing the X11+OpenGL fopr magic is not yet
    >> working for MacOS X. Am I right?
    >>
    >> Now I chose only X11 and libgraphics.o got compiled no problem (same
    >> thing with OpenGL). However, the tcl shared libs did not. I suspect I
    >> did not choose the right file for tcl/tk shared libs. In make config, 
    >> I
    >> answered the following questions like this:
    >>
    >> Tcl shared object library directory: /sw/lib
    >> Tcl shared object: libtcl8.4.dylib
    >> Tk shared object library directory: /sw/lib
    >> Tk shared object:  libtk8.4.dylib
    >>
    >> The error messages I got from the make.log contained the following:
    >>
    >> /usr/bin/libtool: can't locate file for: -llibtcl.dylib
    >> /usr/bin/libtool: file: -llibtcl.dylib is not an object file (not
    >> allowed in a library)
    >> /usr/bin/libtool: can't locate file for: -llibtk.dylib
    >> /usr/bin/libtool: file: -llibtk.dylib is not an object file (not
    >> allowed in a library)
    >>
    >> So now I suspect the libtcl.dylib and libtk.dylib are not the shared
    >> object files. I looked for a libtcl.so and libtk.so files (or 
    >> something
    >> similar) and found none on my system. In the fink installer (for those
    >> who know about it) it shows I have installed the tcltk, tcktk-dev and
    >> tcktk-shlibs.
    >>
    >> From all of this, I would like to know if someone knows where my
    >> problem is?
    >>
    >> I included the last portion of the make.log file where you can see the
    >> error messages for the Tcl/Tk shared libraries at the end of this 
    >> email.
    >>
    >> Best regards,
    >>
    >> Stefan Robert
    >> University of Sherbrooke
    >>
    >>
    >> --- making Tcl shared libraries
    >> for dir in magic ext2sim ext2spice plot router; do \
    >>        (cd $dir && make tcl-main); done
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -DMAGIC_WRAPPER
    >> -DTCL_DIR=\"/Users/stefan/cad/lib/magic/tcl
    >> \" -DHAVE_LIMITS_H -Dmacosx -DmacII -DCALMA_MODULE -DCIF_MODULE
    >> -DPLOT_AUTO -DNONMANHATTAN -DROUTE_AUTO -DUSE_NEW_MACROS
    >> -DCAD_DIR=\"/Users/stefan/cad\" -
    >> DMAGIC_VERSION="\"7.2\"" -DMAGIC_DATE="\"`date`\"" tclmagic.c -c -o
    >> tclmagic.o
    >> tclmagic.c: In function `TagCallback':
    >> tclmagic.c:155: warning: assignment discards qualifiers from pointer
    >> target type
    >> tclmagic.c: In function `_tcl_dispatch':
    >> tclmagic.c:351: warning: passing arg 3 of `Tcl_GetIndexFromObj' from
    >> incompatible pointer type
    >> tclmagic.c: In function `MakeWindowCommand':
    >> tclmagic.c:439: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >> tclmagic.c: In function `TxParseString':
    >> tclmagic.c:605: warning: assignment discards qualifiers from pointer
    >> target type
    >> tclmagic.c: In function `Tclmagic_Init':
    >> tclmagic.c:839: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >> tclmagic.c:845: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >> tclmagic.c:850: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >> tclmagic.c:861: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >> --- making magic Tcl library (tclmagic.dylib)
    >> rm -f tclmagic.dylib
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -o tclmagic.dylib -dynamiclib -flat_namespace
    >> -undefined su
    >> ppress -bind_at_load tclmagic.o ../cmwind/libcmwind.o
    >> ../commands/libcommands.o  ../database/libdatabase.o
    >> ../dbwind/libdbwind.o ../drc/libdrc.o ../debug/
    >> libdebug.o ../extract/libextract.o ../graphics/libgraphics.o
    >> ../macros/libmacros.o ../main/libmain.o ../misc/libmisc.o
    >> ../parser/libparser.o ../select/lib
    >> select.o ../signals/libsignals.o ../tech/libtech.o
    >> ../textio/libtextio.o ../tiles/libtiles.o ../undo/libundo.o
    >> ../windows/libwindows.o ../wiring/libwiring
    >> .o ../resis/libresis.o ../sim/libsim.o ../netlist/libnetlist.o
    >> ../netmenu/libnetmenu.o ../plow/libplow.o ../utils/libutils.o
    >> ../calma/libcalma.o ../cif/li
    >> bcif.o -lc -L/usr/X11R6/lib  -lX11  -lm -L/sw/lib -L/sw/lib
    >> -llibtcl.dylib -llibtk.dylib
    >> /usr/bin/libtool: can't locate file for: -llibtcl.dylib
    >> /usr/bin/libtool: file: -llibtcl.dylib is not an object file (not
    >> allowed in a library)
    >> /usr/bin/libtool: can't locate file for: -llibtk.dylib
    >> /usr/bin/libtool: file: -llibtk.dylib is not an object file (not
    >> allowed in a library)
    >> make[2]: *** [tclmagic.dylib] Error 1
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -DMAGIC_WRAPPER
    >> -DTCL_DIR=\"/Users/stefan/cad/lib/magic/tcl
    >> \" -DHAVE_LIMITS_H -Dmacosx -DmacII -DCALMA_MODULE -DCIF_MODULE
    >> -DPLOT_AUTO -DNONMANHATTAN -DROUTE_AUTO -DUSE_NEW_MACROS
    >> -DCAD_DIR=\"/Users/stefan/cad\" e
    >> xt2sim.c -c -o simwrap.o
    >> /usr/include/gcc/darwin/3.1/stdarg.h:59: warning: redefinition of 
    >> macro
    >> va_start
    >> /usr/include/gcc/darwin/3.1/varargs.h:71: warning: this is the 
    >> location
    >> of the previous definition
    >> ext2sim.c: In function `CmdExtToSim':
    >> ext2sim.c:363: warning: assignment discards qualifiers from pointer
    >> target type
    >> --- making exttosim Tcl library (exttosim.dylib)
    >> rm -f exttosim.dylib
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -o exttosim.dylib -dynamiclib -flat_namespace
    >> -undefined su
    >> ppress -bind_at_load simwrap.o \
    >>        ../extflat/libextflat.o ../magic/tclmagic.dylib -lc -lm
    >> -L/sw/lib -L/sw/lib -llibtcl.dylib -llibtk.dylib
    >> cc: ../magic/tclmagic.dylib: No such file or directory
    >> make[2]: *** [exttosim.dylib] Error 1
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -DMAGIC_WRAPPER
    >> -DTCL_DIR=\"/Users/stefan/cad/lib/magic/tcl
    >> \" -DHAVE_LIMITS_H -Dmacosx -DmacII -DCALMA_MODULE -DCIF_MODULE
    >> -DPLOT_AUTO -DNONMANHATTAN -DROUTE_AUTO -DUSE_NEW_MACROS
    >> -DCAD_DIR=\"/Users/stefan/cad\" e
    >> xt2spice.c -c -o spicewrap.o
    >> /usr/include/gcc/darwin/3.1/stdarg.h:59: warning: redefinition of 
    >> macro
    >> va_start
    >> /usr/include/gcc/darwin/3.1/varargs.h:71: warning: this is the 
    >> location
    >> of the previous definition
    >> ext2spice.c: In function `CmdExtToSpice':
    >> ext2spice.c:460: warning: assignment discards qualifiers from pointer
    >> target type
    >> --- making exttospice Tcl library (exttospice.dylib)
    >> rm -f exttospice.dylib
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -o exttospice.dylib -dynamiclib
    >> -flat_namespace -undefined
    >> suppress -bind_at_load spicewrap.o \
    >>        ../extflat/libextflat.o ../magic/tclmagic.dylib -lc -lm
    >> -L/sw/lib -L/sw/lib -llibtcl.dylib -llibtk.dylib
    >> cc: ../magic/tclmagic.dylib: No such file or directory
    >> make[2]: *** [exttospice.dylib] Error 1
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -DMAGIC_WRAPPER
    >> -DTCL_DIR=\"/Users/stefan/cad/lib/magic/tcl
    >> \" -DHAVE_LIMITS_H -Dmacosx -DmacII -DCALMA_MODULE -DCIF_MODULE
    >> -DPLOT_AUTO -DNONMANHATTAN -DROUTE_AUTO -DUSE_NEW_MACROS
    >> -DCAD_DIR=\"/Users/stefan/cad\" t
    >> clplot.c -c -o tclplot.o
    >> --- making Tcl auto-load module (tclplot.dylib)
    >> rm -f tclplot.dylib
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -o tclplot.dylib -dynamiclib -flat_namespace
    >> -undefined sup
    >> press -bind_at_load tclplot.o plotCmd.o plotGremln.o plotPS.o
    >> plotMain.o plotRutils.o plotVers.o plotPixels.o plotPNM.o  \
    >>          -lc -L/sw/lib -L/sw/lib -llibtcl.dylib -llibtk.dylib
    >> /usr/bin/libtool: can't locate file for: -llibtcl.dylib
    >> /usr/bin/libtool: file: -llibtcl.dylib is not an object file (not
    >> allowed in a library)
    >> /usr/bin/libtool: can't locate file for: -llibtk.dylib
    >> /usr/bin/libtool: file: -llibtk.dylib is not an object file (not
    >> allowed in a library)
    >> make[2]: *** [tclplot.dylib] Error 1
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -DMAGIC_WRAPPER
    >> -DTCL_DIR=\"/Users/stefan/cad/lib/magic/tcl
    >> \" -DHAVE_LIMITS_H -Dmacosx -DmacII -DCALMA_MODULE -DCIF_MODULE
    >> -DPLOT_AUTO -DNONMANHATTAN -DROUTE_AUTO -DUSE_NEW_MACROS
    >> -DCAD_DIR=\"/Users/stefan/cad\" t
    >> clroute.c -c -o tclroute.o
    >> --- making Tcl auto-load module (tclroute.dylib)
    >> rm -f tclroute.dylib
    >> cc -g  -I/sw/include -I/sw/include -I/usr/X11R6/include -I/sw/include
    >> -O2 -fno-common -I. -I.. -o tclroute.dylib -dynamiclib -flat_namespace
    >> -undefined su
    >> ppress -bind_at_load tclroute.o rtrCmd.o rtrMain.o rtrDcmpose.o
    >> ftrFdback.o rtrHazards.o rtrChannel.o rtrPaint.o rtrPin.o rtrSide.o
    >> rtrStem.o rtrTech.o rt
    >> rVia.o rtrTravers.o  \
    >>         ../garouter/libgarouter.o ../mzrouter/libmzrouter.o
    >> ../irouter/libirouter.o ../grouter/libgrouter.o ../gcr/libgcr.o -lc
    >> -L/sw/lib -L/sw/lib -llib
    >> tcl.dylib -llibtk.dylib
    >> /usr/bin/libtool: can't locate file for: -llibtcl.dylib
    >> /usr/bin/libtool: file: -llibtcl.dylib is not an object file (not
    >> allowed in a library)
    >> /usr/bin/libtool: can't locate file for: -llibtk.dylib
    >> /usr/bin/libtool: file: -llibtk.dylib is not an object file (not
    >> allowed in a library)
    >> make[2]: *** [tclroute.dylib] Error 1
    >> make[1]: *** [tcllibrary] Error 2
    >>
    >>
    >> ***** Other warnings I got in make.log file ******
    >> EFname.c: In function `EFHNIsGlob':
    >> EFname.c:85: warning: assignment discards qualifiers from pointer
    >> target type
    >> EFname.c: In function `EFHNIsGND':
    >> EFname.c:121: warning: assignment discards qualifiers from pointer
    >> target type
    >>
    >> /usr/include/gcc/darwin/3.1/stdarg.h:59: warning: redefinition of 
    >> macro
    >> va_start
    >> /usr/include/gcc/darwin/3.1/varargs.h:71: warning: this is the 
    >> location
    >> of the previous definition
    >>
    >> ExtBasic.c: In function `extOutputTrans':
    >> ExtBasic.c:760: warning: initialization discards qualifiers from
    >> pointer target type
    >>
    >> grTkCommon.c: In function `ImgLayerConfigureMaster':
    >> grTkCommon.c:362: warning: passing arg 5 of `Tk_ConfigureWidget' from
    >> incompatible pointer type
    >> grTkCommon.c: In function `ImgLayerCmd':
    >> grTkCommon.c:672: warning: passing arg 3 of `Tcl_GetIndexFromObj' from
    >> incompatible pointer type
    >> grTkCommon.c: In function `RegisterTkCommands':
    >> grTkCommon.c:952: warning: passing arg 3 of `Tcl_CreateCommand' from
    >> incompatible pointer type
    >>
    >> path.c: In function `PaExpand':
    >> path.c:216: warning: assignment discards qualifiers from pointer 
    >> target
    >> type
    >>
    >> /usr/include/gcc/darwin/3.1/stdarg.h:59: warning: redefinition of 
    >> macro
    >> va_start
    >> /usr/include/gcc/darwin/3.1/varargs.h:71: warning: this is the 
    >> location
    >> of the previous definition
    >> ext2sim.c: In function `CmdExtToSim':
    >> ext2sim.c:363: warning: assignment discards qualifiers from pointer
    >> target type
    >>
    >> /usr/include/gcc/darwin/3.1/stdarg.h:59: warning: redefinition of 
    >> macro
    >> va_start
    >> /usr/include/gcc/darwin/3.1/varargs.h:71: warning: this is the 
    >> location
    >> of the previous definition
    >> ext2spice.c: In function `CmdExtToSpice':
    >> ext2spice.c:460: warning: assignment discards qualifiers from pointer
    >> target type
    >>
    >
    >
    > #################################################################
    > #################################################################
    > #################################################################
    > #####
    > #####
    > #####
    > #################################################################
    > #################################################################
    > #################################################################
    >
    


  •  
     
    Questions? Contact Rajit Manohar
    cornell logo