<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> You don't indicate what type of libraries you built hypre with; static or shared. My guess is you ended up with shared<div><br></div><div> I think the answer to your difficulty is hidden in __cdecl (Satish will know much better than me). When you are looking for symbols in Windows shared libraries you have to prepend something to the function prototype to have it successfully found. For example the PETSc include files have these things <span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">__</span><span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures; color: rgb(180, 36, 25);"><b>declspec</b></span><span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">(dllimport) </span>The configure test fails because it does not provide the needed prototype. Likely you built PTScotch with static libraries so no problem.</div><div><br></div><div> The simplest fix would be to build static hypre libraries. I think it is a major project to get PETSc configure and macro system to work properly with external packages that are in Windows shared libraries since more use of __declspec would be needed.</div><div><br></div><div> Barry</div><div><br></div><div> The PETSc installation instructions should probably say something about external packages with Windows shared libraries.</div><div><br></div><div><br></div><div> </div><div><br></div><div><br></div><div><br><div><br><blockquote type="cite"><div>On Jul 19, 2023, at 10:52 AM, Daniel Stone <daniel.stone@opengosim.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm working on getting a petsc build running on windows. One necessary package to include is Hypre. I've been able to build Hypre seperately using cmake, and confirmed that the library works</div><div>by setting up a VS project to run some of the example programs.</div><div><br></div><div>My attempted petsc build is being done through cygwin. I've been able to (with varying degrees of difficulty), build a fairly plain petsc, and one that downloads and builds ptscotch (after some modifications</div><div>to both ptscotch and the config script). I am now attempting to include Hypre (using the --hypre-iclude and --hypre-lib flags, etc). Note that the same compilers are being used for both Hypre and for petsc</div><div>through cygwin - the new intel oneapi compilers (icx and ifx, after again varying amounts of pain to work around their awkwardness with the config script).</div><div><br></div><div>I'm seeing a problem when the config script does some tests on the included hypre lib. The source code looks like:</div><div><br></div><div>#include "confdefs.h"<br>#include "conffix.h"<br>/* Override any gcc2 internal prototype to avoid an error. */<br><br>#include "HYPRE.h"<br><br>char HYPRE_IJMatrixCreate();<br>static void _check_HYPRE_IJMatrixCreate() { HYPRE_IJMatrixCreate(); }<br><br>int main() {<br>_check_HYPRE_IJMatrixCreate();;<br> return 0;<br>}</div><div><br></div><div><br></div><div>As I understand this is a fairly standard type of stub program used by the config script to check that it is able to link to certain symbols in given libraries. Tests like this have succeeded in my builds that</div><div>include PTScotch.</div><div><br></div><div>I keep getting a linker error with the above test, including if I seperate it out and try to build it seperately:</div><div><br></div><div>unresolved external symbol "char __cdel HYPRE_IJMatrixCreate(void)" ....</div><div><br></div><div>Ok, it looks like a problem with either the library or linker commands. But here's the interesting thing - If I transplant this code into VS, with the same project setting that allows it to build the much more <br></div><div>nontrivial Hypre example programs, I get the same error:</div><div><br></div><div>Error LNK2001 unresolved external symbol "char __cdecl HYPRE_IJMatrixCreate(void)" (?HYPRE_IJMatrixCreate@@YADXZ) hypretry1 C:\Users\DanielOGS\source\repos\hypretry1\hypretry1\Source.obj 1</div><div><br></div><div>So it seems like there might be something about this type of stub program that is not working with my Hypre library. I don't fully understand this program - it's able to call the function with no arguments, but</div><div>it also needs to be linked against a library containing the function, apparently by wrapping it in a static void function? Not something I've seen before. <br></div><div><br></div><div>Does anyone have any insight into what might be going wrong - or really just any explaination of how the stub program works so I can figure out why it isn't in this case?</div><div><br></div><div>Many thanks,</div><div><br></div><div>Daniel<br></div></div>
</div></blockquote></div><br></div></body></html>