[Magic-dev] Re: further problems building on OS X
R. Timothy Edwards
tim.edwards at multigig.com
Fri Apr 25 11:45:56 EDT 2008
Dear Andrea,
> I run make in main tree and got no errors so I tought it was fine until
> I noticed there were no ext2sim nor ext2spice in shell path.
>
> Digging in I saw that they have been migrated in tcl space so they could
> be just accessed from magic console using exttosim and exttospice,
> unluckily I still got an error while doing it.
>
> My proof of concept is: run "magic foo.mag" draw a 4x4 m1 rect and then
> type ":extract all" and ":exttosim foo" and I got a
>
> "dlopen(/opt/local/lib/magic/tcl/exttosim.dylib, 6): Symbol not found:
> _ArgStr
> Referenced from: /opt/local/lib/magic/tcl/exttosim.dylib
> Expected in: flat namespace"
>
> Is this a known bug?
No, it's not.
The .dylib files should be compiled using the symbol map table in
magic/symbol.map. This file sets the routine name ArgStr() to be
global, so that the call in ext2sim.dylib can be linked to the
subroutine definition in tclmagic.dylib when ext2sim.dylib is loaded
(along with a bunch of other variable and subroutine symbol names).
I'm not very familiar with the OS-X linker, but in Linux, the linker
flags are defined (in file defs.mak) as:
LDDL_FLAGS = -shared -Wl,-soname,$@ \
-Wl,--version-script=${MAGICDIR}/magic/symbol.map
Others who use OS-X and subscribe to the magic-dev mailing list
may have more insight into this problem, so I'm CC'ing this message
to magic-dev.
> Why doesn't "make all" build separate cli ext2sim and ext2spice?
> I tried to run "make mains" but I got several errors when linking to
> libutils.a . Adding -ltk and -ltcl to ./ext2sim/Makefile reduced error
> lines number but there are still a lot of unreferenced symbols in
> libutils.a , has anyone reported this?
It's my fault for not substituting a script for the two executables.
The idea is that making ext2sim and ext2spice loadable modules means
that both programs can make direct use of the techfile paramters
rather than obtain all their information from the .ext file. But,
you can make simple scripts that call magic in "batch mode"
(magic -dnull -noconsole) that will be equivalent replacements for
the standalone ext2sim and ext2spice executables.
"make mains" is part of the non-Tcl compile. I recommend resolving
the problems with Tcl/Tk rather than reverting to the non-Tcl version.
However, if you want to do that, be sure to do "make clean" first,
then re-configure with "--without-tcl". Failure to do "make clean"
will result in lots of error messages.
Regards,
Tim
+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim) | email: tim.edwards at multigig.com |
| MultiGiG, Inc. | web: http://www.multigig.com |
| 100 Enterprise Way, Suite A-3 | phone: (831) 621-3283 |
| Scotts Valley, CA 95066 | cell: (240) 401-0616 |
+--------------------------------+-------------------------------------+
More information about the magic-dev
mailing list