On 3 June 2015 at 14:12, <highcalcula...@gmail.com> wrote:

> Hi,
>
> I have been trying to run a simple calculation with MPIR on my Windows 7
> machines for several days now. My only sources so far are the manual from
> version 2.6.0 (since 2.7.0 would not load from the mpir site) and some
> Google search results.
>

I am not having an issue accessing the manual for 2.7.0 from the website.
Is this the file you are having trouble accessing?


> I managed to do the following via MinGW:
>
> - run ./configure --disable-static --enable-shared
> - make
> - make check
>
> On one of my machines, everything went through, on the other, almost,
> there was one error during "make check": "FAIL: t-io_raw.exe", but it then
> went on.
>

Thanks for letting us know. Can you send us any log files in the directory
tests/mpz on that machine, as well as the file config.log. We will look
into the failure.


> (Is this all and now I can start using it or is a step missing?...)
>

That's it. You are good to go.


> Now I want to compile the following program called "mytest.cpp" with gcc;
> I tried typing "g++ mytest.cpp -o mytest" :
>

In general we are not able to provide assistance with using the gcc
compiler and linker. For this, perhaps you can refer to one of the many
websites about compiling and linking using gcc, since it is not at all
specific to MPIR.


>
> //-----------------------------------------------
> #include "mpir.h"
> #include "gmp.h"
> #include "gmp-impl.h"
>
> using namespace std;
>
> int main ()
> {
>     mpz_t z;
>
>     mpz_init(z);
>
>     return (0);
> }
> //-----------------------------------------------
>
> The answer from the MinGW command line was
>
> "C:\Users\....\...\Local\Temp\ccD1pbG8.o:mytest.cpp:(.text+0x20):
> undefined reference to '_imp____gmpz_init' "
>
>
I cannot make a guess based on this. It looks like it isn't linking against
mpir. This could be for any number of reasons.


> and some further lines with similar content.
>
> The program sits in the top folder of MPIR (C:/MPIR/mpir-2.7.0/), I have
> added this folder to the Windows PATH environment variable.
>

Did you installed MPIR on your system (sudo make install)?


> I can see the mpir.h file in this folder...(?...)
> What is missing? I read in the MPIR documentation chapter 3.1 that "All
> programs using MPIR must link against the 'libmpir' library..." I then
> tried to compile via
>
> g++ mytest.cpp -lmpir -o mytest
>
> which resulted in
>
> "C:/mingw/bin/ld.exe: cannot find -lmpir"
>

You have to tell it where to find MPIR, e.g. with gcc's -L option.


>
> Are the links to the mpz libraries missing (if so, do I have to use some
> -I flag? Or - where are they)?
>

If you don't install MPIR, the library is located in the .libs directory of
your MPIR source tree. (This is fairly standard for a lot of linux
libraries.)


>
> My next question (once this works) would be how (if) I can use MPIR in C
> code being called by Matlab (via mex-files).
> I am relatively new to C Programming and would appreciate any hints.
> Thanks.
>

I personally don't have any experience with Matlab. You might get lucky and
find someone else on the list able to answer your question.

But I would suggest calling the Matlab support hotline as they would better
be able to support you (and you likely paid them a lot of money to do so).

Bill.


>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "mpir-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mpir-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to mpir-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/mpir-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to