getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ mumps


From: Yves Renard
Subject: Re: c++ mumps
Date: Thu, 28 Nov 2019 16:51:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1


Dear Nicolò,

The linker is called by the compiler. To create an executable file from your main program calling GetFEM, the compiler compile the program and then call the linker to link it with the C++ standard libraries. You have to specify that you want to link with GetFEM library (and with a few other too : Mumps, qhull, lapack). This depends on the compiler you use and where you compile GetFEM.


Best regards,


Yves


Le 27/11/2019 à 12:51, Nicolò Cambiaso a écrit :
Dear Yves,

You are right, I did not link the library with the program.
I did not even know I had to do it so I look for a guide (also in the GetFem+ mailing list ). Unfortunately, I managed to find only this guide: http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs, which is absolutely not clear to me.
Can I ask you how to create the linker and how to make it work?
I really appreciate the time that you are spending replying to my questions, even though for you are very trivial and basic.
Thank you very much for the help.

Best regards,

Nicolò


Il giorno mar 26 nov 2019 alle ore 13:51 Yves Renard <address@hidden> ha scritto:
Dear Nicolò,

These error are coming from the linker. May be you forgot to ling the Getfem library with your program.

Best regards,

Yves




Le 25/11/2019 à 12:21, Nicolò Cambiaso a écrit :
Dear Yves,

Yes, that was the problem, thank you.

Now I'm still looking at the tutorial about Thermo-elastic and electrical coupling (with MatLab it helped a lot and it was very clear) and adding the code the single line

>> getfem::mesh mesh;

gives me theese errors:

C:\Users\cambi\AppData\Local\Temp\ccsXaSdU.o prova1.cpp:(.text+0x285): undefined reference to `getfem::mesh::mesh(std::string)'

C:\Users\cambi\AppData\Local\Temp\ccsXaSdU.o prova1.cpp:(.text$_ZN5bgeot15block_allocator7dec_refEj[_ZN5bgeot15block_allocator7dec_refEj]+0x62): undefined reference to `bgeot::block_allocator::deallocate(unsigned int)'undefined reference to `getfem::mesh::mesh(std::string)'

C:\Users\cambi\AppData\Local\Temp\ccsXaSdU.o prova1.cpp:(.text$_ZN6getfem4meshD1Ev[_ZN6getfem4meshD1Ev]+0xbe): undefined reference to `getfem::context_dependencies::~context_dependencies()'

C:\Users\cambi\AppData\Local\Temp\ccsXaSdU.o prova1.cpp:(.rdata$.refptr._ZTVN6getfem4meshE[.refptr._ZTVN6getfem4meshE]+0x0): undefined reference to `vtable for getfem::mesh'

C:\Users\cambi\AppData\Local\Temp\ccsXaSdU.o prova1.cpp:(.rdata$.refptr._ZN5bgeot22static_block_allocator6pallocE[.refptr._ZN5bgeot22static_block_allocator6pallocE]+0x0): undefined reference to `bgeot::static_block_allocator::palloc'.

I have to say I'm pretty new to C++, so I'm very confused: shouldn't this line just define the existence of the mesh? Thank you very much for your help and your time, it's much appreciated.

Best Regards,
Nicolò Cambiaso



Il giorno mer 20 nov 2019 alle ore 14:26 Yves Renard <address@hidden> ha scritto:

Dear Nicolò,

If you already compiled GetFEM with its matlab interface and Mumps this
a priori means that mumps is installed on your system (on MinGW64 is I
understand well). May be Devc++ just needs the path for the mumps includes ?

Best regards,

Le 20/11/2019 à 10:27, Nicolò Cambiaso a écrit :
> Dear GetFem++ Users,
>
> Until now I've always used GetFemm++ with MatLab interface, and
> everything worked.
> Now I'm trying to use the C++ (Devc++ in particular) interface, but I
> get error message about MUMPs package like
> " C:\Program Files
> (x86)\Dev-Cpp\MinGW64\include\gmm\gmm_MUMPS_interface.h [Error]
> smumps_c.h: No such file or directory"
> after trying to compile this code:
>
> "#include "getfem_model_solvers.h"
> #include "getfem_export.h"
> #include "gmm.h"
> #include "getfem_mesher.h"
> #include "getfem_generic_assembly.h"
>
> using bgeot::size_type;
> using bgeot::base_node;
> using bgeot::base_small_vector;
> typedef getfem::model_real_plain_vector plain_vector;
>
> int main(void) {
>
> bgeot::dim_type elements_degree = 2; // Degree of the finite element
> methods
>
> }"
> I don't understand what's happening, because I've tried command like
> "gf_linsolve('mumps', spmat M, vec b)"  in the MatLab interface and it
> worked.
> Thank you for your time and help
>
> Best Regards,
>
> Nicolò Cambiaso


--

   Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
   INSA-Lyon
   20, rue Albert Einstein
   69621 Villeurbanne Cedex, FRANCE
   http://math.univ-lyon1.fr/~renard

---------


-- 

  Yves Renard (address@hidden)       tel : (33) 04.72.43.87.08
  INSA-Lyon 
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard

---------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]