Difference between revisions of "Tcl library path"

From Verific Design Automation FAQ
Jump to: navigation, search
Line 2: Line 2:
  
 
First, verify that you have tcl and tcl dev installed on your system. Have them installed if they are not.
 
First, verify that you have tcl and tcl dev installed on your system. Have them installed if they are not.
 +
 +
For Ubuntu-like systems:
 +
apt-get install tcl-dev
 +
For Fedora-like systems:
 +
dnf install tcl-devel
  
 
The "Makefile" provided by Verific has "-ltcl" option. The linker will look for the file /usr/lib/libtcl.so (for 32-bit build) or /usr/lib64/libtcl.so (for 64-bit build).
 
The "Makefile" provided by Verific has "-ltcl" option. The linker will look for the file /usr/lib/libtcl.so (for 32-bit build) or /usr/lib64/libtcl.so (for 64-bit build).

Revision as of 11:54, 1 February 2021

Q: When trying to build, I get the error message: "/usr/bin/ld: cannot find -ltcl". How do I correct that problem?

First, verify that you have tcl and tcl dev installed on your system. Have them installed if they are not.

For Ubuntu-like systems:

apt-get install tcl-dev

For Fedora-like systems:

dnf install tcl-devel

The "Makefile" provided by Verific has "-ltcl" option. The linker will look for the file /usr/lib/libtcl.so (for 32-bit build) or /usr/lib64/libtcl.so (for 64-bit build).

You can either:

1. In /usr/lib (or in /usr/lib64 for 64-bit build), make soft link libtcl.so pointing to your_lib_tcl.so and (for static build) libtcl.a to your_lib_tcl_.a. For example:

 [lib64]$ pwd
 /usr/lib64
 [lib64]$ ls -l *tcl*
 -rw-r----- 1 root root 2107226 Nov 29  2016 libtcl8.5.a
 -rwxr-xr-x 1 root root 1194938 Nov 29  2016 libtcl8.5.so
 lrwxrwxrwx 1 root root      11 Nov 29  2016 libtcl.a -> libtcl8.5.a
 lrwxrwxrwx 1 root root      12 Nov 29  2016 libtcl.so -> libtcl8.5.so
 [lib64]$

or:

2. In the Makefile, replace "-ltcl" with "-L /path/to/your/tcl/library -ltclX.y" where X is the major version and y is the minor. Depending on your PATH variable you may also need to adjust the #include <tcl.h> in commands/*.cpp, tclmain/TclMain.cpp (and tclmain/swig.i if it exists) with "#include "/path/to/your/tcl/headers/tcl.h"