diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 0a7cc4739..50ec5ab68 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1105,6 +1105,16 @@ struct card *inp_readall(FILE *fp, const char *dir_name, const char* file_name, if (newcompat.ps && newcompat.a) pspice_compat_a(working); + /* another warning that codemodels or osdi libs have not been loaded successfully */ + if (ft_osdierror) { + fprintf(stderr, "Warning: OSDI libs have not been loaded successfully.\n"); + fprintf(stderr, " Any of the following steps may fail, if Verilog A models are involved!.\n\n"); + } + if (ft_codemodelerror) { + fprintf(stderr, "Warning: code models like analog.cm have not been loaded successfully.\n"); + fprintf(stderr, " Any of the following steps may fail, if code models are involved!.\n\n"); + } + struct nscope *root = inp_add_levels(working); inp_probe(working); diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 3e07b1beb..b3514919e 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -58,6 +58,7 @@ static void free_dlerr_msg(char *msg); #define RTLD_NOW 2 /* immediate function call binding */ #define RTLD_GLOBAL 4 /* symbols in this dlopen'ed obj are visible to other * dlopen'ed objs */ +#define F_OK 0 #endif /* ifndef HAS_WINGUI */ #include "ngspice/dllitf.h" /* the coreInfo Structure*/ @@ -405,9 +406,14 @@ int load_opus(const char *name) lib = dlopen(name, RTLD_NOW); // fprintf(stdout, "Lib %s has handle %p\n", name, lib); if (!lib) { - msg = dlerror(); - fprintf(stderr, "Error opening code model \"%s\"\n: %s\n", name, msg); - FREE_DLERR_MSG(msg); + int acc = access(name, F_OK); + if (acc != 0) { + fprintf(stderr, "Error opening code model \"%s\": No such file or directory!\n", + name); + } + else + fprintf(stderr, "Error opening code model \"%s\"\n", name); + return 1; }