Pelles C forum > General discussion

PNL Scientific Library CRASHES

(1/2) > >>

milen_prg:
I try to use this:
https://pnlnum.github.io/pnl/
with Pelles C. It depends only from libpnl.dll, which depends on libblas.dll, liblapack.dll.

It compiles without any problem with mingw64 gcc, but in Pelles C:

I use Pelles C compiler (Windows 10 Pro 64 bit) and try to compile simple example:

`#include <stdio.h>
#include <pnl/pnl_complex.h>

int main(int argc, char *argv[])
{
dcomplex z = Complex(-1, 0);
printf("%f\n", Csqrt(z).r);
return 0;
}
`

The compilation and linking is successful. Program exe starts with or without dlls. But crashes immediately at function Complex().

The IDE gives this messages:

C:\Users\mlap\Documents\pellesCmath1\pellesCmath1.exe.
POLINK: warning: Section '.idata$7' is not supported; image will probably not run.
POLINK: warning: Section '.idata$7' is missing contents flag; assuming DATA.
POLINK: warning: Section '.idata$5' is missing contents flag; assuming DATA.
POLINK: warning: Realigned section '.idata$5' in object 'libpnl.lib(0 1673985086 501 20 644 261 d†�)' (from 4 to 8 byte(s)). POLINK: warning: Section '.idata$4' is missing contents flag; assuming DATA. POLINK: warning: Realigned section '.idata$4' in object 'libpnl.lib(0              1673985086  501   20    644     261     
d†�)' (from 4 to 8 byte(s)).
POLINK: warning: Section '.idata$6' is missing contents flag; assuming DATA.
POLINK: warning: Section '.idata$7' is missing contents flag; assuming DATA.
POLINK: warning: Section '.idata$5' is missing contents flag; assuming DATA.
POLINK: warning: Realigned section '.idata$5' in object 'libpnl.lib(0 1673985086 501 20 644 261 d†�)' (from 4 to 8 byte(s)). POLINK: warning: Section '.idata$4' is missing contents flag; assuming DATA. POLINK: warning: Realigned section '.idata$4' in object 'libpnl.lib(0              1673985086  501   20    644     261     
d†�)' (from 4 to 8 byte(s)).
POLINK: warning: Section '.idata$6' is missing contents flag; assuming DATA.
POLINK: warning: Section '.idata$2' is missing contents flag; assuming DATA.
POLINK: warning: Realigned section '.idata$2' in object 'libpnl.lib(0 1673985086 501 20 644 261 d†�)' (from 4 to 1 byte(s)). POLINK: warning: Section '.idata$5' is missing contents flag; assuming DATA. POLINK: warning: Realigned section '.idata$5' in object 'libpnl.lib(0              1673985086  501   20    644     261     
d†�)' (from 4 to 8 byte(s)).
POLINK: warning: Section '.idata$4' is missing contents flag; assuming DATA.
POLINK: warning: Realigned section '.idata$4' in object 'libpnl.lib(0 1673985086 501 20 644 261 d†�)' (from 4 to 8 byte(s)). POLINK: warning: Section '.idata$4' is missing contents flag; assuming DATA. POLINK: warning: Realigned section '.idata$4' in object 'libpnl.lib(0              1673985086  501   20    644     261     
d†�)' (from 4 to 8 byte(s)).
POLINK: warning: Section '.idata$5' is missing contents flag; assuming DATA.
POLINK: warning: Realigned section '.idata$5' in object 'libpnl.lib(0 1673985086 501 20 644 261 `
d†�)' (from 4 to 8 byte(s)).
POLINK: warning: Section '.idata$7' is missing contents flag; assuming DATA.

Can you give some advice how to debug this and to try to make pnl library to work with this compiler.

frankie:
The import library libpnl.lib probably includes unsupported sections. The DLL should be effective anyway.
You should create a new import library from libpnl.dll using polib.exe with the command:

--- Code: ---polib libpnl.dll /MACHINE:X64 /OUT:libpnl.lib
--- End code ---
I have created the new import library, attached to the post, and compiled your code. It seems to work.
Let me know...

Don D:
I can confirm the same results as frankie. I had used polink to create a new libpnl.lib, and it worked fine on both PellesC v11 and v12RC2. In PellesC v12RC2 I noticed 2 extra harmless warnings regarding realigned sections from 4 to 8 bytes.

I assume you've added a path to your pnl lib, a path to your pnl includes, and libpnl.lib to your linker's library and object files.

BTW, on a PellesC v11 system, I used...

--- Code: ---polib libpnl.dll /list
--- End code ---
... on a copy of libpnl.dll in a new directory, just to preserve the original libpnl.lib.

milen_prg:
Thank, you, thank, you, very, very much!
This works! I would never find that, may be it even is not in the documentation! I play with applied software development, understand almost nothing in system software.

One notice:
The generated libpnl.lib with the command:
polib libpnl.dll /list
works, BUT there are 2 warnings:
POLINK: warning: Realigned section '.idata$5' in object 'libpnl.lib(libpnl.dll)' (from 4 to 8 byte(s)).
POLINK: warning: Realigned section '.idata$4' in object 'libpnl.lib(libpnl.dll)' (from 4 to 8 byte(s)).

The generated libpnl.lib with the command:
polib libpnl.dll /MACHINE:X64 /OUT:libpnl.lib
works without any warnings, so I use this command!

The two generated libpnl.lib files are with the same size (much smaller than the original), but are different in binary content.

Thank, you, again! Now I have power math lib for Pelles C.

Vortex:
Hi milen_prg,

In the module definition file pnl.def, correct the first line as the following :


--- Code: ---LIBRARY libpnl
--- End code ---

Building the import library from the module definition file :


--- Code: ---\PellesC\bin\polib.exe /MACHINE:x64 /DEF:pnl.def /OUT:libpnl.lib
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version