Discussion:
[Mingw-users] troubles compiling the GNU GMP under MinWG
Euchner, Martin
2017-07-24 11:50:35 UTC
Permalink
Dear experts,

I'm facing troubles compiling the GNU GMP under MinWG and would like to hear which mailing list (mingw-***@lists.sourceforge.net<mailto:mingw-***@lists.sourceforge.net> or gmp-***@gmplib.org<mailto:gmp-***@gmplib.org>) is most appropriate to following-up with detailed questions?

In addition, I'm wondering if MinWG correctly figured out my CPU processor?

I have Windows 7 Enterprise OS running on Intel(r) Core(tm) i3-2330M CPU using 64-bit OS (that's what System reported).

My ENV reports:
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
OS=Windows_NT
PROCESSOR_LEVEL=6
PROCESSOR_ARCHITEW6432=AMD64
PROCESSOR_ARCHITECTURE=x86
MSYSTEM=MINGW32
PROCESSOR_REVISION=2a07
NUMBER_OF_PROCESSORS=4

gcc is compiling using -mtune=sandybridge -march=sandybridge

This is setting correct?

With kind regards

Martin Euchner.
Eli Zaretskii
2017-07-24 14:31:02 UTC
Permalink
Date: Mon, 24 Jul 2017 11:50:35 +0000
I’m facing troubles compiling the GNU GMP under MinWG and would like to hear which mailing list
detailed questions?
It depends on what problems are you having. So it's hard to answer
that with only the information you provided.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-reques
Euchner, Martin
2017-07-24 15:20:32 UTC
Permalink
Dear Eli,

Thanks, and sorry for the too big attachment. I removed the compile log of GMP; here's where I got stuck with compiling the GMP demos:

$ cd demos

$ make factorize
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge factorize.c -o factorize
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x23): undefined reference to `__gmpz_powm'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x33): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x43): undefined reference to `__gmpz_cmp'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x6c): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x91): undefined reference to `__gmpz_powm_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x9d): undefined reference to `__gmpz_cmp'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x123): undefined reference to `__gmpz_clear'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x1a5): undefined reference to `__gmpz_cmp'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x229): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x252): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x27f): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x303): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x364): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x394): undefined reference to `__gmpz_init_set_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x3ac): undefined reference to `__gmpz_clear'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x3e8): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x3f8): undefined reference to `__gmpz_scan1'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x40a): undefined reference to `__gmpz_fdiv_q_2exp'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x459): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x473): undefined reference to `__gmpz_divisible_ui_p'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x487): undefined reference to `__gmpz_tdiv_q_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x4ab): undefined reference to `__gmpz_clear'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x4fa): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x57a): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x599): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x5cd): undefined reference to `__gmpz_inits'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x5ec): undefined reference to `__gmpz_sub_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x600): undefined reference to `__gmpz_scan1'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x61e): undefined reference to `__gmpz_tdiv_q_2exp'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x62e): undefined reference to `__gmpz_set_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x6b2): undefined reference to `__gmpz_divexact'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x6cd): undefined reference to `__gmpz_powm'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x6dd): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x70e): undefined reference to `__gmpz_add_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x79f): undefined reference to `__gmpz_clears'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x7e3): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x891): undefined reference to `__gmpz_inits'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x8a5): undefined reference to `__gmpz_init_set_si'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x8b5): undefined reference to `__gmpz_init_set_si'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x8c9): undefined reference to `__gmpz_init_set_si'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x8dd): undefined reference to `__gmpz_init_set_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x913): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x93c): undefined reference to `__gmpz_mul'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x953): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x96a): undefined reference to `__gmpz_add_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x97e): undefined reference to `__gmpz_sub'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x999): undefined reference to `__gmpz_mul'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x9bb): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x9e4): undefined reference to `__gmpz_gcd'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x9f4): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xa0c): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xa30): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xa6c): undefined reference to `__gmpz_mul'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xa83): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xa9a): undefined reference to `__gmpz_add_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xac0): undefined reference to `__gmpz_set'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb00): undefined reference to `__gmpz_mul'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb14): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb2f): undefined reference to `__gmpz_add_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb47): undefined reference to `__gmpz_sub'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb57): undefined reference to `__gmpz_gcd'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb67): undefined reference to `__gmpz_cmp_ui'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xb91): undefined reference to `__gmpz_divexact'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xbfb): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xc16): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xc31): undefined reference to `__gmpz_mod'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0xc95): undefined reference to `__gmpz_clears'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x89): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0xa6): undefined reference to `__gmpz_inp_str'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0xc5): undefined reference to `__gmp_printf'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x125): undefined reference to `__gmp_printf'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x16d): undefined reference to `__gmpz_init'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x197): undefined reference to `__gmpz_set_str'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x1a7): undefined reference to `__gmp_printf'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text.startup+0x205): undefined reference to `__gmp_printf'
collect2.exe: error: ld returned 1 exit status
make: *** [factorize] Error 1

Do you have any idea what needs to be changed to get the demos executable?

Regards,

Martin.


-----Original Message-----
From: Eli Zaretskii [mailto:***@gnu.org]
Sent: Monday, July 24, 2017 4:31 PM
To: MinGW Users List <mingw-***@lists.sourceforge.net>
Cc: Euchner, Martin <***@itu.int>
Subject: Re: [Mingw-users] troubles compiling the GNU GMP under MinWG
Date: Mon, 24 Jul 2017 11:50:35 +0000
I’m facing troubles compiling the GNU GMP under MinWG and would like
It depends on what problems are you having. So it's hard to answer that with only the information you provided.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.source
Eli Zaretskii
2017-07-24 15:46:55 UTC
Permalink
Date: Mon, 24 Jul 2017 15:20:32 +0000
$ make factorize
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge factorize.c -o factorize
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x23): undefined reference to `__gmpz_powm'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x33): undefined reference to `__gmpz_cmp_ui'
The GCC command line obviously lacks the reference to GMP library. I
would look at the Makefile which produced this command, probably some
variable isn't set there correctly or has an empty value.

Did the library itself build successfully?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Euchner, Martin
2017-07-24 18:13:30 UTC
Permalink
Dear Eli,

Many thanks for the hint.
Indeed, when I manually -lgmp then all works fine:
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge factorize.c -o factorize -lgmp

The -lgmp must be after the .c (or at the very end) but I did not manage to fix the Makefile accordingly. I'm not enough Makefile expert to get this fixed, and I leave to somebody else to fix that in the package.

Here's the stripped-down Makefile to be fixed:
CC = gcc
CFLAGS = -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge


Anyway, many thanks for your help!

Regards,

Martin.

-----Original Message-----
From: Eli Zaretskii [mailto:***@gnu.org]
Sent: Monday, July 24, 2017 5:47 PM
To: Euchner, Martin <***@itu.int>
Cc: mingw-***@lists.sourceforge.net
Subject: Re: [Mingw-users] troubles compiling the GNU GMP under MinWG
Date: Mon, 24 Jul 2017 15:20:32 +0000
$ make factorize
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge factorize.c -o factorize
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x23): undefined reference to `__gmpz_powm'
C:\Users\euchner\AppData\Local\Temp\ccEo6gbB.o:factorize.c:(.text+0x33): undefined reference to `__gmpz_cmp_ui'
The GCC command line obviously lacks the reference to GMP library. I would look at the Makefile which produced this command, probably some variable isn't set there correctly or has an empty value.

Did the library itself build successfully?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Eli Zaretskii
2017-07-24 18:35:19 UTC
Permalink
Date: Mon, 24 Jul 2017 18:13:30 +0000
Many thanks for the hint.
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge factorize.c -o factorize -lgmp
The -lgmp must be after the .c (or at the very end) but I did not manage to fix the Makefile accordingly. I'm not enough Makefile expert to get this fixed, and I leave to somebody else to fix that in the package.
CC = gcc
CFLAGS = -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -march=sandybridge
CFLAGS is not the whole story. There should also be LDFLAGS or LIBES
or something like that, which is specifically used on the link (as
opposed to compilation) command lines.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Paul J. Hentschel
2017-07-24 16:58:56 UTC
Permalink
Post by Euchner, Martin
$ cd demos
$ make factorize
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -
march=sandybridge factorize.c -o factorize
Try "make factorize.exe" instead of "make factorize" and see if that works.

Paul


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Euchner, Martin
2017-07-24 18:49:21 UTC
Permalink
Hi Paul,

Thank. That works indeed!

Regards,

Martin.

-----Original Message-----
From: Paul J. Hentschel [mailto:***@hpminc.com]
Sent: Monday, July 24, 2017 6:59 PM
To: 'MinGW Users List' <mingw-***@lists.sourceforge.net>
Subject: Re: [Mingw-users] troubles compiling the GNU GMP under MinWG
Post by Euchner, Martin
$ cd demos
$ make factorize
gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge -
march=sandybridge factorize.c -o factorize
Try "make factorize.exe" instead of "make factorize" and see if that works.

Paul


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Loading...