Page 1 of 1

Cannot find shared library

Posted: 28 Sep 2012, 14:34
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

Re: Cannot find shared library

Posted: 28 Sep 2012, 14:43
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...

Re: Cannot find shared library

Posted: 01 Oct 2012, 18:56
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

Re: Cannot find shared library

Posted: 02 Oct 2012, 08:01
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

Re: Cannot find shared library

Posted: 02 Oct 2012, 09:39
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

Re: Cannot find shared library

Posted: 04 Oct 2012, 18:12
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

Re: Cannot find shared library

Posted: 17 Nov 2014, 16:00
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:

Re: Cannot find shared library

Posted: 17 Nov 2014, 16:08
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

Re: Cannot find shared library

Posted: 17 Nov 2014, 19:00
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

Re: Cannot find shared library

Posted: 18 Nov 2014, 10:57
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