Re: [Fwd: Portable version]

Domingo Alvarez Duarte <[email protected]> Mon, 2 Nov 2020 14:03:56 +0100
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
Hello Benhard !

Probably the easy way is to static build/link glpsol.

I normally look at the end of the make output and manually replace it:

====

examples$ make
gcc -DHAVE_CONFIG_H -I. -I..  -I./../src   -g -O3 -march=native 
-ffp-contract=off -DWITH_SPLAYTREE -flto -MT glpsol.o -MD -MP -MF 
.deps/glpsol.Tpo -c -o glpsol.o glpsol.c
mv -f .deps/glpsol.Tpo .deps/glpsol.Po
/bin/bash ../libtool --tag=CC   --mode=link gcc  -g -O3 -march=native 
-ffp-contract=off -DWITH_SPLAYTREE -flto   -o glpsol glpsol.o 
../src/libglpk.la -lm
libtool: link: gcc -g -O3 -march=native -ffp-contract=off 
-DWITH_SPLAYTREE -flto -o .libs/glpsol glpsol.o ../src/.libs/libglpk.so -lm

====

Rerun the glpsol link as (replace the ouput "-o" and the libglpk from 
shared to static):

====

gcc -g -O3 -march=native -ffp-contract=off -DWITH_SPLAYTREE -flto -o 
glpsol glpsol.o  ../src/.libs/libglpk.a -lm

====

Cheers !

On 2/11/20 12:20, Heinrich Schuchardt wrote:
> Am 2. November 2020 10:53:06 MEZ schrieb Andrew Makhorin <[email protected]>:
>
>     -------- Forwarded Message --------
>     From: "Andraschko, Bernhard" <[email protected]>
>     To: [email protected] <[email protected]>
>     Subject: Portable version
>     Date: Mon, 2 Nov 2020 07:21:45 +0000
>
>         Hi, I'm currently working for the Chair of Symbolic
>         Computation in Passau and help developing ApCoCoA-2, a
>         computer algebra framework mainly for commutative algebra for
>         Linux and for Windows. We would like to include include a
>         version of GLPK into our framework, but have failed yet with
>         compiling a portable standalone version of glpsol as the
>         configuration and the built always writes direkt paths into
>         many files. Also replacing all paths by new ones didn't help.
>         Is there a way to compile a portable version? Best Regards
>         Bernhard Andraschko 
>
>
>
> Dear Bernhard,
>
> please, provide a log of the errors that you observed.
>
> On Linux you may have to set LD_LIBRARYY_PATH if you put GLPK library 
> into an unusual place.
>
> Don't forget running ldconfig.
>
> On Windows the GLPK library must be in one of the directories 
> indicated by %PATH%.
>
> Best regards
>
> Heinrich