Cannot find shared library

Numerical methods and mathematical models of Elmer
Post Reply
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Cannot find shared library

Post by mzenker »

Hi,

I want to use a UDF in a material property. I have compiled it and copied it into C:\Programme\Elmer7\share\elmersolver\lib\PhaseChangeProperties.dll. Now when I run the solver, I get the following error message:

Code: Select all

Load: Unable to open shared library: [PhaseChangeProperties.dll]
Can not find PhaseChangeProperties.dll.

Load: Unable to open shared library: [PhaseChangeProperties.dll.dll]
Can not find PhaseChangeProperties.dll.dll.

Load: Unable to open shared library: [./PhaseChangeProperties.dll]
Can not find ./PhaseChangeProperties.dll.

Load: Unable to open shared library: [./PhaseChangeProperties.dll.dll]
Can not find ./PhaseChangeProperties.dll.dll.

Load: Unable to open shared library: [C:\Programme\Elmer7\share\elmersolver\lib/PhaseChangeProperties.dll]
Can not find C:\Programme\Elmer7\share\elmersolver\lib/PhaseChangeProperties.dll.

Load: Unable to open shared library: [C:\Programme\Elmer7\share\elmersolver\lib/PhaseChangeProperties.dll.dll]
Can not find C:\Programme\Elmer7\share\elmersolver\lib/PhaseChangeProperties.dll.dll.
I have checked that the file is there. I use Elmer Rev. 5817 under Windows XP. Adding C:\Programme\Elmer7\share\elmersolver\lib to my PATH doesn't have an effect, as expected since Elmer looks there already.
Copying the dll into the project directory doesn't help either.

What do I do wrong?

Matthias
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Cannot find shared library

Post by mzenker »

Addendum: I have reverted back to Rev. 5730, recompiled my user function, and the error did not occur. So I suspect a bug introduced between the two revisions...
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Cannot find shared library

Post by mzenker »

Hi,

to state clearly what I believe to be the case: The current Windows binary distribution (Rev. 5817) might not allow for the use of user defined functions since it might contain a bug which has the effect that UDFs are not found. The previous one (Rev. 5730) does not have this problem.
It would be very helpful if someone from the Elmer team had a look into this case.

Thanks,

Matthias
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Cannot find shared library

Post by Juha »

Hi Matthias,

Is there a possibility that the UDF is compiled with different compiler
version to that ElmerSolver is compiled with? Or some similiar version
mixup?

Anyway, if you can post a test case, i can have a look if i can spot anything.

Regards,Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Cannot find shared library

Post by mzenker »

Hi Juha,

thank you for your reply.
The compilation was done with elmerf90 from the same distribution as Elmersolver.
I will set up a test case and post it later today or on thursday (wednesday is a holiday here), when I have my urgent simulations running.

Matthias
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Cannot find shared library

Post by mzenker »

Hi,

I have just tried to set up a test case, and to my surprise I cannot reproduce the problem. I have also checked with the case where the problem occurred initially, it seems to work now. I hope that the problem will not come back...

Sorry for the false alert! :oops:

Matthias
XisZero
Posts: 14
Joined: 11 Sep 2014, 12:10
Antispam: Yes

Re: Cannot find shared library

Post by XisZero »

Hi there,

I have the same error with the newest version (7.0 Rev 78cf1f8).

I imported a Project (which was running without flaws) of a previous version in the GUI. i also recompiled the UDF using the "compiler.." menu item. Still, no errors. If ihit start it says this:

Code: Select all

Loading user function library: [PCMUDF]...[phase]

Load: Unable to open shared library: [PCMUDF]
Can not find PCMUDF.

Load: Unable to open shared library: [PCMUDF.dll]
Can not find PCMUDF.dll.

Load: Unable to open shared library: [./PCMUDF]
Can not find ./PCMUDF.

Load: Unable to open shared library: [./PCMUDF.dll]
Can not find ./PCMUDF.dll.

Load: Unable to open shared library: [D:\Elmer7/share/elmersolver/lib/PCMUDF]
Can not find D:\Elmer7/share/elmersolver/lib/PCMUDF.

Load: Unable to open shared library: [D:\Elmer7/share/elmersolver/lib/PCMUDF.dll]
Can not find D:\Elmer7/share/elmersolver/lib/PCMUDF.dll.
here is the test case:
Attachments
case.sif
(2.95 KiB) Downloaded 327 times
PCMUDF.f90
(1.21 KiB) Downloaded 332 times
XisZero
Posts: 14
Joined: 11 Sep 2014, 12:10
Antispam: Yes

Re: Cannot find shared library

Post by XisZero »

Ok, I have found the Problem.

The compiler is creating an "a.exe" in the directory. I just renamed it to "PCMUDF.dll" and it worked.
But: is it possible to set the "preferences" for the compiler, so it can create the dll only?

Thanks in advance

X=0
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cannot find shared library

Post by annier »

Hi X=0(XisZero),
Thank you very much for making us learn about coding by writing a lucid and illustrative UDF for expressing the variation of enthalpy with temperature.

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
XisZero
Posts: 14
Joined: 11 Sep 2014, 12:10
Antispam: Yes

Re: Cannot find shared library

Post by XisZero »

Hi Anil,

I have learned a lot in this forum, so i´m glad if someone will find this interesting/helpful. for the interest, another thread I started about this:

viewtopic.php?f=3&t=3639

I will try to make some things work a bit better. One part is, that with temperature rising, the phase change takes place, while with temperatures decreasing, the phase gets back to normal state, with the corresponding enthalpies.
The main idea is, that a phase change occurs while heating up a phase change material, and when cooling, the "recrystallisation" takes place. It is part of my work on a PhD thesis. I will try to make working "dynamic" phase change UDF.

Greetings,

X=0
Post Reply