# Error loading complex PETSc, SLEPc Library

**URL:** <https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370>\
**Category:** General Discussion\
**Created:** [April 24, 2020, 8:07am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370 "2020-04-24T08:07:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![meindonut](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@meindonut](https://community.freefem.org/u/meindonut)\
**Post date:** [April 24, 2020, 8:07am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/1 "2020-04-24T08:07:39Z")

</div>

Hi,  
i’ve installed the newest Windows binarys and im not able to run complex PETSc examples because FreeFem can’t load PETSc-complex.dll even though the file exists.  
I have no problems with normal PETS examples.

Log:

– FreeFem++ v4.6 (Fri, Apr 03, 2020 2:08:08 PM - git v4.6)  
Load: lg\_fem lg\_mesh lg\_mesh3 eigenvalue  
1 : load “PETSc-complex”  
Load error: PETSc-complex  
fail:  
list prefix: ‘C:\Program Files (x86)\FreeFem++\.’ list suffix: ‘’ , ‘.dll’  
current line = 1  
Load error : PETSc-complex  
line number :1, PETSc-complex  
error Load error : PETSc-complex  
line number :1, PETSc-complex  
code = 2 mpirank: 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 24, 2020, 6:13pm UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/2 "2020-04-24T18:13:09Z")

</div>

I think there is something wrong with your `freefem++.pref`, because the list of prefixes seems messed up. Could you make sure the correct path with all the `.dll` is properly set in the list?

---

<div class="post-metadata">

**Author:** ![meindonut](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@meindonut](https://community.freefem.org/u/meindonut)\
**Post date:** [April 27, 2020, 6:44am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/3 "2020-04-27T06:44:47Z")

</div>

Hi prj, thanks for your reply.

My `freefem++.pref` looks like:

> loadpath += “!\.”  
> includepath += “!\idp”

The `freefem++.pref`, all `*.dll` files and `*.exe` files are in the folder:  
`C:\Program Files (x86)\FreeFem++`\

Other `*.dll` files load properly.

Is there somethng I overlook?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 27, 2020, 6:57am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/4 "2020-04-27T06:57:13Z")

</div>

That is weird. Could you try to run with the additional parameter `-v 10000` and paste the full log here, please?

---

<div class="post-metadata">

**Author:** ![meindonut](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@meindonut](https://community.freefem.org/u/meindonut)\
**Post date:** [April 27, 2020, 10:41am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/5 "2020-04-27T10:41:39Z")

</div>

I think these are the important lines when loading the working PETSc lib:

> ```
> 1 : load "PETSc" ****PETSc.cpp****
> 
> ```
> 
> – addInitFunct: 10000 1 PETSc.cpp  
> test LoadLibrary(C:\Program Files (x86)\FreeFem++\.\PETSc) = 0x1fbd0000  
> (load: loadLibary C:\Program Files (x86)\FreeFem++\.\PETSc = 0) callInitsFunct : 1
> 
> addInitFunct : 10000 call : 1 (  
> loadfile PETSc.cpp  
> PETSc (d)

Important Lines when loading the not working PETSc-complex lib:

> ```
> 1 : load "PETSc-complex" 
> 
> ```
> 
> test LoadLibrary(C:\Program Files (x86)\FreeFem++\.\PETSc-complex) = 0
> 
> try loadLibary: C:\Program Files (x86)\FreeFem++\.\PETSc-complex  
> fail: 126  
> test LoadLibrary(C:\Program Files (x86)\FreeFem++\.\PETSc-complex.dll) = 0
> 
> try loadLibary: C:\Program Files (x86)\FreeFem++\.\PETSc-complex.dll  
> fail: 126
> 
> Load error: PETSc-complex  
> fail:  
> list prefix: 'C:\Program Files (x86)\FreeFem++\.' list suffix: ‘’ , ‘.dll’  
> current line = 1

Full log:

> C:\Users\bbszi\Documents\Praktikum\_Moedder\FreeFem\>FreeFem++ loadlib.edp -v 10000  
> verbosity 10000  
> file: loadlib.edp  
> – FreeFem++ v4.6 (Fri, Apr 03, 2020 2:08:08 PM - git v4.6)  
> file :loadlib.edp verbosity= 10000  
> Load: callInitsFunct : 2
> 
> addInitFunct : -10000 call : 1 (  
> add ExistDestroy  
> )  
> addInitFunct : -20 call : 1 ( lg\_fem OneFFSlverVS 47 47  
> OneFFSlverVS 47 47  
> OneFFSlverVS 63 63  
> OneFFSlverVS 63 63  
> \*\* ChangeSolver SPARSESOLVER ← GMRES  
> \*\* ChangeSolver SPARSESOLVERSYM ← GMRES  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 49 49  
> OneFFSlverVS 49 49  
> \*\* ChangeSolver SPARSESOLVER ← UMFPACK  
> OneFFSlverVS 58 58  
> OneFFSlverVS 58 58  
> \*\* ChangeSolver SPARSESOLVERSYM ← CHOLMOD  
> OneFFSlverVS 47 47  
> OneFFSlverVS 47 47  
> OneFFSlverVS 63 63  
> OneFFSlverVS 63 63  
> \*\* ChangeSolver SPARSESOLVER ← GMRES  
> \*\* ChangeSolver SPARSESOLVERSYM ← GMRES  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 31 31  
> OneFFSlverVS 49 49  
> OneFFSlverVS 49 49  
> \*\* ChangeSolver SPARSESOLVER ← UMFPACK  
> OneFFSlverVS 58 58  
> OneFFSlverVS 58 58  
> \*\* ChangeSolver SPARSESOLVERSYM ← CHOLMOD
> 
> ```
> add ExistDestroy
> 
> add ExistDestroy
> 
> add ExistDestroy
> 
> ```
> 
> ) lg\_mesh glumesh2D lg\_mesh3 eigenvalue  
> –lex open :loadlib.edp  
> Block::open 0x10e390a0 0  
> 1 : load “PETSc-complex” test LoadLibrary(C:\Program Files (x86)\FreeFem++\.\PETSc-complex) = 0
> 
> try loadLibary: C:\Program Files (x86)\FreeFem++\.\PETSc-complex  
> fail: 126  
> test LoadLibrary(C:\Program Files (x86)\FreeFem++\.\PETSc-complex.dll) = 0
> 
> try loadLibary: C:\Program Files (x86)\FreeFem++\.\PETSc-complex.dll  
> fail: 126
> 
> Load error: PETSc-complex  
> fail:  
> list prefix: 'C:\Program Files (x86)\FreeFem++\.' list suffix: ‘’ , ‘.dll’  
> current line = 1  
> Load error : PETSc-complex  
> line number :1, PETSc-complex  
> error Load error : PETSc-complex  
> line number :1, PETSc-complex  
> code = 2 mpirank: 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [April 27, 2020, 1:58pm UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/7 "2020-04-27T13:58:33Z")

</div>

I have been able to reproduce the issue, it should be fixed for the next release, I’ll push a fix soon on the develop branch. In the meantime, could you please download [libssp-0.dll](http://jolivet.perso.enseeiht.fr/winfix/libssp-0.dll) (from my personal webpage) and put it in the FreeFEM folder with all the other .dll? This fixed the issue on my installation. Thank you for reporting this.

Here is the corresponding commit: [c01f2d7](https://github.com/FreeFem/FreeFem-sources/commit/c01f2d7700c9a3addf01b6ccfe85ff6237a6be38).

---

<div class="post-metadata">

**Author:** ![cyrillebreard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cyrillebreard](https://community.freefem.org/u/cyrillebreard)\
**Post date:** [May 28, 2020, 8:43am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/8 "2020-05-28T08:43:46Z")

</div>

> [@prj](#):
>
> ave been able to reproduce the issue, it should be fixed for the n

Hi Very much appreciated to provide a temporary fix with the libssp-0.dll, but I can’t download it from your personal webpage. Any help?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 28, 2020, 8:58am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/9 "2020-05-28T08:58:37Z")

</div>

I’ve removed it since then. Do you need it? I’ll upload it again if so.

---

<div class="post-metadata">

**Author:** ![cyrillebreard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cyrillebreard](https://community.freefem.org/u/cyrillebreard)\
**Post date:** [May 28, 2020, 10:16am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/10 "2020-05-28T10:16:34Z")

</div>

Yes please, thank you.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 28, 2020, 10:50am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/11 "2020-05-28T10:50:00Z")

</div>

No problem, good to know some of you are using PETSc/SLEPc in complex on Windows! The link should be up again. Let me know if you run into some other issue.

---

<div class="post-metadata">

**Author:** ![cyrillebreard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cyrillebreard](https://community.freefem.org/u/cyrillebreard)\
**Post date:** [June 8, 2020, 3:03am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/12 "2020-06-08T03:03:22Z")

</div>

Yes indeed. Thanks very much for prompt reply. And so far it is working.

---

<div class="post-metadata">

**Author:** ![jbc](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jbc](https://community.freefem.org/u/jbc)\
**Post date:** [March 15, 2022, 11:45am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/13 "2022-03-15T11:45:28Z")

</div>

Hi,

I have the same problem with the example “blasius-stability-1d-SLEPc-complex.edp” on windows 10 with FreeFem++ 4.7. It gives

13 : load “PETSc-complex”  
Load error: PETSc-complex  
fail:  
list prefix: ‘C:\Program Files (x86)\FreeFem++4.7\.’ list suffix: ‘’ , ‘.dll’  
current line = 13 mpirank 0 / 2  
Load error : PETSc-complex  
line number :13, PETSc-complex  
error Load error : PETSc-complex  
line number :13, PETSc-complex  
code = 2 mpirank: 0

The file PETSc-complex.dll is in the install directory of freefem++.  
My freefem++.pref file is

loadpath += “!.”  
includepath += “!\idp”

Is libssp-0.dll the solution for this problem ? Is this file available somewhere ?

Many thanks for your attention

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 15, 2022, 1:10pm UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/14 "2022-03-15T13:10:15Z")

</div>

Consider downloading the latest available `.exe`. This is fixed in version 4.10.

---

<div class="post-metadata">

**Author:** ![jbc](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jbc](https://community.freefem.org/u/jbc)\
**Post date:** [March 15, 2022, 2:22pm UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/15 "2022-03-15T14:22:15Z")

</div>

Thank you very much.  
PETSc-complex is now loading and some examples are working with it (Helmoltz and Maxwell).  
Some others give PETSC ERROR but I will build my own models now.

---

<div class="post-metadata">

**Author:** ![wanglongfei](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@wanglongfei](https://community.freefem.org/u/wanglongfei)\
**Post date:** [August 11, 2022, 4:45am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/16 "2022-08-11T04:45:46Z")

</div>

Hello  
我刚装的 freefem++ 4.11,也出现了同样的问题。  
Load error: PETSc  
fail:  
list prefix: 'D:\freefem++\FreeFem++\.' '!.' list suffix: ‘’ , ‘.dll’  
current line = 40  
Load error : PETSc  
line number :40, PETSc  
error Load error : PETSc  
line number :40, PETSc  
code = 2 mpirank: 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [August 11, 2022, 5:04am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/17 "2022-08-11T05:04:41Z")

</div>

You need to use `FreeFem++-mpi`, not `FreeFem++`.

---

<div class="post-metadata">

**Author:** ![wanglongfei](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@wanglongfei](https://community.freefem.org/u/wanglongfei)\
**Post date:** [August 11, 2022, 7:16am UTC](https://community.freefem.org/t/error-loading-complex-petsc-slepc-library/370/18 "2022-08-11T07:16:35Z")

</div>

Ok, thank you very much.
