转载至:Synopsys EDA Tools安装和使用过程中出现的问题及解决方法 - 知乎
TCP端口被占用
错误信息:
(lmgrd) Failed to open the TCP port number in the license.
License文件中通常使用27000端口,如果这个端口被占用,使用如下命令查看占用进程的PID:
sudo lsof -i:27000
然后用如下命令杀死进程:
sudo kill -9 <PID>
启动了多个snpslmd(OpenSUSE)
在OpenSUSE中,启动lmgrd的时候会提示:
13:48:56 (lmgrd) Started snpslmd (internet tcp_port 59331 pid 2024)
13:48:56 (snpslmd) FlexNet Licensing version v11.14.1.3 build 212549 x64_lsb
13:48:56 (snpslmd) Cannot open daemon lock file
13:48:56 (snpslmd) EXITING DUE TO SIGNAL 41 Exit reason 9
13:48:56 (lmgrd) snpslmd exited with status 41 (Exited because another server was running)
13:48:56 (lmgrd) MULTIPLE "snpslmd" license server systems running.
13:48:56 (lmgrd) Please kill, and run lmreread
13:48:56 (lmgrd)
13:48:56 (lmgrd) This error probably results from either:
13:48:56 (lmgrd) 1. Another copy of the license server manager (lmgrd) is running.
13:48:56 (lmgrd) 2. A prior license server manager (lmgrd) was killed with "kill -9"
13:48:56 (lmgrd) (which would leave the vendor daemon running).
13:48:56 (lmgrd) To correct this, do a "ps -ax | grep snpslmd"
13:48:56 (lmgrd) (or equivalent "ps" command)
13:48:56 (lmgrd) and kill the "snpslmd" process.
说启动了多个snpslmd,但是又kill不掉。
首先去snpslmd所在目录scl/amd64/bin/
下新建文件“gen-snpslmd-hack.c”,文件内容为:
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <dlfcn.h>
#include <string.h>
static int is_root = 0;
static int d_ino = -1;
static DIR *(*orig_opendir)(const char *name);
static int (*orig_closedir)(DIR *dirp);
static struct dirent *(*orig_readdir)(DIR *dirp);
DIR *opendir(const char *name)
{
if (strcmp(name, "/") == 0)
is_root = 1;
return orig_opendir(name);
}
int closedir(DIR *dirp)
{
is_root = 0;
return orig_closedir(dirp);
}
struct dirent *readdir(DIR *dirp)
{
struct dirent *r = orig_readdir(dirp);
if (is_root && r)
{
if (strcmp(r->d_name, ".") == 0)
r->d_ino = d_ino;
else if (strcmp(r->d_name, "..") == 0)
r->d_ino = d_ino;
}
return r;
}
static __attribute__((constructor)) void init_methods()
{
orig_opendir = dlsym(RTLD_NEXT, "opendir");
orig_closedir = dlsym(RTLD_NEXT, "closedir");
orig_readdir = dlsym(RTLD_NEXT, "readdir");
DIR *d = orig_opendir("/");
struct dirent *e = orig_readdir(d);
while (e)
{
if (strcmp(e->d_name, ".") == 0)
{
d_ino = e->d_ino;
break;
}
e = orig_readdir(d);
}
orig_closedir(d);
if (d_ino == -1)
{
puts("Failed to determine root directory inode number");
exit(EXIT_FAILURE);
}
}
然后使用如下命令编译:
gcc -ldl -shared -fPIC gen-snpslmd-hack.c -o snpslmd-hack.so
这里可能要安装gcc:
sudo zypper install gcc
接着关闭lmgrd:
lmdown
在lmgrd所在路径下执行如下命令激活证书:
LD_PRELOAD=./snpslmd-hack.so ./lmgrd -c /usr/software/synopsys/license/Synopsys.dat
如果激活成功,可以把环境变量里激活的指令换成:
alisa crack='LD_PRELOAD=/usr/software/synopsys/scl/scl/2018.06/linux64/bin/snpslmd-hack.so lmgrd -c /usr/software/synopsys/license/Synopsys.dat'
但这样激活成功后,verdi会打不开,启动verdi时terminal返回:
Segmentation fault (core dumped)
后来我发现出现这种情况是因为之前设定的LD_PRELOAD
环境变量影响了verdi的启动,所以在每次激活后再加一句如下指令即可:
unsetenv LD_PRELOAD