[FlopCpp] FlopCpp with glpk
Marcos Roberto Silva
marcos.roberto.silva at uol.com.br
Wed Jul 11 10:40:27 EDT 2012
Hi.
I'm trying to solve a problem using glpk as a solver. I changed the
Makefile provided in the "example" folder of FlopCpp
("FlopC++-1.1.2/FlopCpp/examples").
I changed the following lines in the Makefile:
marcos at dell:~/Downloads/pacotes/FlopC++-1.1.2/FlopCpp/examples$ cat Makefile
# Copyright (C) 2006 International Business Machines and others.
# All Rights Reserved.
# This file is distributed under the Common Public License.
# $Id: Makefile.in 726 2006-04-17 04:16:00Z andreasw $
##########################################################################
# You can modify this example makefile to fit for your own program. #
# Usually, you only need to change the five CHANGEME entries below. #
##########################################################################
# To compile other examples, either changed the following line, or
# add the argument EXNAME=example_name to make
EXNAME = usahlp
# CHANGEME: This should be the name of your executable
EXE = $(EXNAME)
# CHANGEME: Here is the name of all object files corresponding to the source
# code that you wrote in order to define the problem statement
OBJS = $(EXNAME).o
# CHANGEME: Additional libraries
ADDLIBS = -L/home/marcos/Downloads/pacotes/FlopC++-1.1.2/Osi/lib/ -lOsiGlpk
-lOsi -lglpk
# CHANGEME: Additional flags for compilation (e.g., include flags)
ADDINCFLAGS = -I../../include
-I/home/marcos/Downloads/pacotes/FlopC++-1.1.2/Osi/src/OsiGlpk
# CHANGEME: Directory to the sources for the (example) problem definition
# files
SRCDIR = .
I can compile and link the program, but when I try to execute the program I
get the following error:
marcos at dell:~/Downloads/pacotes/FlopC++-1.1.2/FlopCpp/examples$ make
g++ -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type
-Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion
-Wno-unknown-pragmas -Wno-long-long -DFLOPCPP_BUILD
`PKG_CONFIG_PATH=/home/marcos/Downloads/pacotes/FlopC++-1.1.2/lib/pkgconfig:/home/marcos/Downloads/pacotes/FlopC++-1.1.2/share/pkgconfig:
/usr/bin/pkg-config --cflags flopcpp osi-cbc osi-clp` -I../../include
-I/home/marcos/Downloads/pacotes/FlopC++-1.1.2/Osi/src/OsiGlpk -c -o
usahlp.o `test -f 'usahlp.cpp' || echo './'`usahlp.cpp
usahlp.cpp: Na função ‘int main(int, char**)’:
usahlp.cpp:12:12: aviso: unused variable ‘k’ [-Wunused-variable]
usahlp.cpp:37:22: aviso: ignoring return value of ‘int fscanf(FILE*, const
char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
usahlp.cpp:49:29: aviso: ignoring return value of ‘int fscanf(FILE*, const
char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
usahlp.cpp:58:29: aviso: ignoring return value of ‘int fscanf(FILE*, const
char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
usahlp.cpp:66:28: aviso: ignoring return value of ‘int fscanf(FILE*, const
char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
bla=;\
for file in usahlp.o; do bla="$bla `echo $file`"; done; \
g++ -Wl,--rpath -Wl,/home/marcos/Downloads/pacotes/FlopC++-1.1.2/lib
-O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual
-Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
-Wno-long-long -DFLOPCPP_BUILD -o usahlp $bla
`PKG_CONFIG_PATH=/home/marcos/Downloads/pacotes/FlopC++-1.1.2/lib/pkgconfig:/home/marcos/Downloads/pacotes/FlopC++-1.1.2/share/pkgconfig:
/usr/bin/pkg-config --libs flopcpp osi-cbc osi-clp`
-L/home/marcos/Downloads/pacotes/FlopC++-1.1.2/Osi/lib/ -lOsiGlpk -lOsi
-lglpk
marcos at dell:~/Downloads/pacotes/FlopC++-1.1.2/FlopCpp/examples$ ./usahlp
./usahlp: error while loading shared libraries: libOsiGlpk.so.1: cannot
open shared object file: No such file or directory
marcos at dell:~/Downloads/pacotes/FlopC++-1.1.2/FlopCpp/examples$
Could you please help me to solve this problem? I don't understand why the
library is not found.
Thank you.
Marcos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/flopcpp/attachments/20120711/d3306caa/attachment.html>
More information about the FlopCpp
mailing list