Dear all, I am able to build glpk v4.65 with --disable-reentrant. Unfortunately, Heinrich’s solution does not work for me. Thank you for all suggestions, Mike Von: Chris Matrakidis <address@hidden> Gesendet: Samstag, 17. März 2018 00:33 An: address@hidden Cc: help-glpk <address@hidden>; Heinrich Schuchardt <address@hidden> Betreff: Re: [Help-glpk] Compiling and linking problems Dear Mike, The config.h you provided looks correct. Until we find a more permanent solution, you have two options: a) run configure with --disable-reentrant, or b) follow Heinrich's solution This has been discussed in the past[1] and Andrew seems to favour option a. On 17 March 2018 at 01:23, Heinrich Schuchardt <address@hidden> wrote: Hello Mike,
https://stackoverflow.com/questions/6394512/standard-c-library-in-mingw writes: "MinGW is designed to build native Windows code, and as such it builds against Windows' native libc."
So probably you want to change this line in src/env/stdc.c:
-#elif defined(__WOE__) +#elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WOE__)
Please, reply if this works. Then Andrew could update it in the next version of GLPK.
There might be more lines needing such a change:
examples/glpsol.c:956:#ifndef __WOE__ src/env/time.c:88:#elif defined(__WOE__) src/env/dlsup.c:107:#elif defined(__WOE__) src/env/tls.c:85:#ifdef __WOE__ src/env/stdc.c:52:#elif defined(__WOE__)
Best regards
Heinrich
On 03/15/2018 02:35 PM, address@hidden wrote: > Dear GLPK-Team, > > > > I have got some problems with building glpk 4.65 on Windows 10 with > msys/mingw. > > > > I tried to build it with: > > ./configure --enable-static --disable-shared > > make > > > > Configure finished without problems. All sources are compiled without > errors. > > But it ends with the following issues: > > … > > /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o glpsol.exe > glpsol.o ../src/libglpk.la -lm > > libtool: link: gcc -g -O2 -o glpsol.exe glpsol.o ../src/.libs/libglpk.a > > ../src/.libs/libglpk.a(libglpk_la-stdc.o): In function `glp_xgmtime': > > C:\Users\Mike\Documents\Projekte\CMPL-1-12\Cmpl\data\glpk-4.65\src/env/stdc.c:81: > undefined reference to `gmtime_r' > > ../src/.libs/libglpk.a(libglpk_la-stdc.o): In function `glp_xstrtok': > > C:\Users\Mike\Documents\Projekte\CMPL-1-12\Cmpl\data\glpk-4.65\src/env/stdc.c:93: > undefined reference to `strtok_r' > > collect2.exe: error: ld returned 1 exit status > > make[2]: *** [glpsol.exe] Error 1 > > make[2]: Leaving directory > `/Documents/Projekte/CMPL-1-12/Cmpl/data/glpk-4.65/examples' > > make[1]: *** [all-recursive] Error 1 > > make[1]: Leaving directory > `/Documents/Projekte/CMPL-1-12/Cmpl/data/glpk-4.65' > > make: *** [all] Error 2 > > > > > > I have seen that in stdc.c are alternative versions of some function > depending on some defines. But I am not sure what is do do. I was > wondering that the defines are set by the configure script. > > I use as mentioned before msys/mingw: > > $ gcc -v > > Using built-in specs. > > COLLECT_GCC=C:\MinGW\bin\gcc.exe > > COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe > > Target: mingw32 > > Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu > --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr > --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw > --disable-win32-registry --with-arch=i586 --with-tune=generic > --enable-languages=c,c++,objc,obj-c++,fortran,ada > --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static > --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions > --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw > --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp > --disable-libvtv --enable-nls > > Thread model: win32 > > gcc version 6.3.0 (MinGW.org GCC-6.3.0-1) > > > > > > Any suggestions are welcome! > > > > Thanks, > > > > Mike > > > > >
|