First of all, thanks so much to Stefan Schippers a...
# xschem
v
First of all, thanks so much to Stefan Schippers and the community for xschem. However, I need help compiling and more specifically, linking it on my 2019 macbook pro running 14.2.1 (23C71). At first the problem was that xpm library was absent. So I fixed that. But then it couldn’t find tcl and tk. But I thought magic uses these and so the were installed already. Somehow the configuration was ok but the linking didn’t work. Thanks in advance for any help! Here are the last few lines from the terminal session: Undefined symbols for architecture x86_64: “_Tcl_GetErrorLine”, referenced from: _source_tcl_file in xinit.o _source_tcl_file in xinit.o “_Tcl_MainEx”, referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [xschem] Error 1 make: * [all] Error 2 cd src && /Library/Developer/CommandLineTools/usr/bin/make install gcc -o xschem icon.o callback.o actions.o move.o check.o clip.o draw.o globals.o main.o netlist.o hash_iterator.o findnet.o scheduler.o store.o xinit.o select.o font.o editprop.o save.o paste.o token.o psprint.o node_hash.o hilight.o options.o vhdl_netlist.o svgdraw.o spice_netlist.o tedax_netlist.o verilog_netlist.o parselabel.o expandlabel.o in_memory_undo.o cairo_jpg.o -lm -L/opt/local/lib -ljpeg -lcairo -lX11 -lXpm -ltcl8.5 -ltk8.5 Undefined symbols for architecture x86_64: “_Tcl_GetErrorLine”, referenced from: _source_tcl_file in xinit.o _source_tcl_file in xinit.o “_Tcl_MainEx”, referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [xschem] Error 1 make: * [install] Error 2
m
@Vitit Kantabutra Quick question. Did you notice the instructions for the mac install in https://github.com/StefanSchippers/xschem/blob/master/README_MacOS.md?
v
Yes, and
There is one important thing that
I did one thing differently: Not all of my tools came from macports. And I hesitate to remove them and reinstall them, because doing so may break other applications. I’d rather learn how to edit the configuration to make linkinf xschem work.
👍 1
s
@Vitit Kantabutra I don't have a Mac to test things directly, but one of the problems is that default tcl-tk libraries are natively built for the Quartz native MacOS graphic system, while xschem is a X11 application so you need to have XQuartz and a version of tcl-tk compiled for The X11 emulation layer of XQuartz. But I hope some Mac owner kicks in here to give more precise answers.
@Vitit Kantabutra May be here there are some additional tips...
v
Thanks so much!
I copied and pasted the script under thge header “Download and compile xschem from source”. Once aga, the linking didn’t work, and I received this output: gcc -o xschem icon.o callback.o actions.o move.o check.o clip.o draw.o globals.o main.o netlist.o hash_iterator.o findnet.o scheduler.o store.o xinit.o select.o font.o editprop.o save.o paste.o token.o psprint.o node_hash.o hilight.o options.o vhdl_netlist.o svgdraw.o spice_netlist.o tedax_netlist.o verilog_netlist.o parselabel.o expandlabel.o in_memory_undo.o cairo_jpg.o -lm -L/opt/local/lib -ljpeg -lcairo -lX11 -lXpm -ltcl8.5 -ltk8.5 Undefined symbols for architecture x86_64: “_Tcl_GetErrorLine”, referenced from: _source_tcl_file in xinit.o _source_tcl_file in xinit.o “_Tcl_MainEx”, referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [xschem] Error 1 make: * [all] Error 2 cd src && /Library/Developer/CommandLineTools/usr/bin/make install gcc -o xschem icon.o callback.o actions.o move.o check.o clip.o draw.o globals.o main.o netlist.o hash_iterator.o findnet.o scheduler.o store.o xinit.o select.o font.o editprop.o save.o paste.o token.o psprint.o node_hash.o hilight.o options.o vhdl_netlist.o svgdraw.o spice_netlist.o tedax_netlist.o verilog_netlist.o parselabel.o expandlabel.o in_memory_undo.o cairo_jpg.o -lm -L/opt/local/lib -ljpeg -lcairo -lX11 -lXpm -ltcl8.5 -ltk8.5 Undefined symbols for architecture x86_64: “_Tcl_GetErrorLine”, referenced from: _source_tcl_file in xinit.o _source_tcl_file in xinit.o “_Tcl_MainEx”, referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [xschem] Error 1 make: * [install] Error 2
s
@Vitit Kantabutra I see the Tcl_GetErrorLine function which returns the line number in a script that caused an error is a new tcl8.6 addition. Will avoid calling this function in tcl version < 8.6. Xschem should compile with no problems in al tcl versions from tcl8.4 to tcl 9.0. Will fix that.
@Vitit Kantabutra it is now fixed, the offending function will be used only if tcl version >=8.6
v
Thank you so mkuch! I’ll get the new version.
Thanks. I download the new version, changed the flags and ran make, and still received these messages:
bison -d -o expandlabel.c expandlabel.y flex -l -oparselabel.c parselabel.l gcc -c -std=c99 -I/opt/X11/include -I/opt/X11/include/cairo -I/opt/local/include -O2 -o parselabel.o parselabel.c gcc -c -std=c99 -I/opt/X11/include -I/opt/X11/include/cairo -I/opt/local/include -O2 -o expandlabel.o expandlabel.c bison -o eval_expr.c eval_expr.y eval_expr.y58.9 18 syntax error, unexpected identifier, expecting string make[1]: * [eval_expr.c] Error 1 make: * [all] Error 2
By the way my OS has been upgraded to Sequoia 15.3 (24D60).
s
Thank you. It is probably a compatibility issue between bison version. WIll check.
Can you please tell me the bison version? (bison --version)
@Vitit Kantabutra This issue seems also resolved. I have a used more compatible way and removed the line causing the above error. It is due to incompatibilities with bison versions.
v
% bison --version bison (GNU Bison) 2.3
I’m not sure I did the right think, but I still have the error. Here’s what happened when I ran make: vkantabu@Vitits-MacBook-Pro xschem_git % make cd src && /Library/Developer/CommandLineTools/usr/bin/make gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o icon.o icon.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o callback.o callback.c callback.c33523: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if((dataset == sweepvar_wrap)) { ~~~~~~~~^~~~~~~~~~~~~~~~ callback.c33523: note: remove extraneous parentheses around the comparison to silence this warning if((dataset == sweepvar_wrap)) { ~ ^ ~ callback.c33523: note: use ‘=’ to turn this equality comparison into an assignment if((dataset == sweepvar_wrap)) { ^~ = 1 warning generated. gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o actions.o actions.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o move.o move.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o check.o check.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o clip.o clip.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o draw.o draw.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o globals.o globals.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o main.o main.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o netlist.o netlist.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o hash_iterator.o hash_iterator.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o findnet.o findnet.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o scheduler.o scheduler.c scheduler.c216127: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if((xctx->semaphore == 0)) go_back(what); ~~~~~~~~~~~~~~~~^~~~ scheduler.c216127: note: remove extraneous parentheses around the comparison to silence this warning if((xctx->semaphore == 0)) go_back(what); ~ ^ ~ scheduler.c216127: note: use ‘=’ to turn this equality comparison into an assignment if((xctx->semaphore == 0)) go_back(what); ^~ = scheduler.c335918: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if( (erc == 0) ) { ~~~~^~~~ scheduler.c335918: note: remove extraneous parentheses around the comparison to silence this warning if( (erc == 0) ) { ~ ^ ~ scheduler.c335918: note: use ‘=’ to turn this equality comparison into an assignment if( (erc == 0) ) { ^~ = 2 warnings generated. gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o store.o store.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o xinit.o xinit.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o select.o select.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o font.o font.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o editprop.o editprop.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o save.o save.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o paste.o paste.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o token.o token.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o psprint.o psprint.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o node_hash.o node_hash.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o hilight.o hilight.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o options.o options.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o vhdl_netlist.o vhdl_netlist.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o svgdraw.o svgdraw.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o spice_netlist.o spice_netlist.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o tedax_netlist.o tedax_netlist.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o verilog_netlist.o verilog_netlist.c bison -d -o expandlabel.c expandlabel.y flex -l -oparselabel.c parselabel.l gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o parselabel.o parselabel.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o expandlabel.o expandlabel.c bison -p kk -o eval_expr.c eval_expr.y gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o eval_expr.o eval_expr.c eval_expr.y9183: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] {(yyval.val) = (yyvsp[(1) - (4)].tptr) ? (*((yyvsp[(1) - (4)].tptr)->fnctptr))((yyvsp[(3) - (4)].val)) : 0.0;;} ^ 1 warning generated. gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o in_memory_undo.o in_memory_undo.c gcc -c -pipe -O2 -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/X11/include -o cairo_jpg.o cairo_jpg.c gcc -o xschem icon.o callback.o actions.o move.o check.o clip.o draw.o globals.o main.o netlist.o hash_iterator.o findnet.o scheduler.o store.o xinit.o select.o font.o editprop.o save.o paste.o token.o psprint.o node_hash.o hilight.o options.o vhdl_netlist.o svgdraw.o spice_netlist.o tedax_netlist.o verilog_netlist.o parselabel.o expandlabel.o eval_expr.o in_memory_undo.o cairo_jpg.o -lm -L/opt/local/lib -ljpeg -lcairo -lX11 -lXpm -ltcl8.5 -ltk8.5
Undefined symbols for architecture x86_64: “_Tcl_GetErrorLine”, referenced from: _source_tcl_file in xinit.o _source_tcl_file in xinit.o “_Tcl_MainEx”, referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [xschem] Error 1 make: * [all] Error 2
s
@Vitit Kantabutra I have made changes to avoid the compiler warnings. These are warnings. The real problem is the linker error at the end. Looks like some libraries are missing in the compile lines: -I/usr/include/tcl8.5 is not present in the gcc lines. May be header files tcl.hand tk.h are found somewhere. The final link line specifies tcl and tk 8.5. Is this the same version as the tcl.h and tcl.h that are included by the c files? I suspect that the #include <tcl.h> and #include <tk.h> lines in xschem.h will get tcl8.6 files and you are finally linking with tcl and tk 8.5. If this is the case change the final link to use -ltcl8.6 -ltk86
if the OS was upgraded rerun also the ./configure
v
Thanks. Where is the makeflle where I need to put in -ltcl8.6 -ltk86?
s
add these to the LDFLAGS in Makefile.conf
v
Ok, thanks.