coin-or / Bonmin

Basic Open-source Nonlinear Mixed INteger programming
https://coin-or.github.io/Bonmin
Eclipse Public License 1.0
118 stars 22 forks source link

Issues while fetching Bonmin using Coinbrew #48

Closed charcharan closed 2 months ago

charcharan commented 2 months ago

Hello,

I am trying to install bonmin solver in my amazonlinux2 image through docker file, here is my sample docker file

FROM public.ecr.aws/amazonlinux/amazonlinux:2

Install Python 3.8

RUN amazon-linux-extras install -y python3.8 \ && yum install -y python38-pip

Use Python 3.8 to upgrade pip

RUN python3.8 -m pip install --upgrade pip

RUN pip3 install boto3==1.26.49 pandas==1.3.5 Pyomo==6.6.2 regex==2022.7.25 cryptography==37.0.2 gurobipy==10.0.3 pyarrow==12.0.0 networkx==2.6.3 simpy==4.0.2 deap==1.3.3 mealpy==3.0.0 highspy==1.5.3 PuLP==2.8.0 mip==1.15.0 scip==0.1.12 ortools==9.6.2534 scipy==1.10.0

Install system dependencies for Ipopt and Bonmin

RUN yum update -y \ && yum install -y \ gcc-c++ \ gcc-gfortran \ lapack-devel \ blas-devel \ git \ wget \ file \ pkgconfig.x86_64 \ build-essential \ curl \ && yum clean all

RUN yum -y groupinstall "Development Tools"

ENV PATH="/usr/local/bin:${PATH}"

Your commands to install Ipopt and Bonmin follow here

...

ENV PYTHONUNBUFFERED=TRUE

ENV SOLVERS=/home/app/solvers

RUN export PATH="/usr/local/bin/:${PATH}"

ENV PATH="/usr/local/bin:${PATH}" ENV PATH="/usr/bin:${PATH}"

RUN mkdir -p ${SOLVERS}/cbc

WORKDIR ${SOLVERS}/cbc RUN git clone https://github.com/coin-or/pulp.git RUN cp ${SOLVERS}/cbc/pulp/pulp/solverdir/cbc/linux/64/cbc /usr/local/bin/ RUN rm -r ${SOLVERS}/cbc/pulp

WORKDIR ${SOLVERS} RUN wget -O ${SOLVERS}/coinbrew https://raw.githubusercontent.com/coin-or/coinbrew/v1.0/coinbrew RUN chmod u+x ${SOLVERS}/coinbrew

RUN export PATH="$SOLVERS/coinbrew:$PATH"\ && cp ${SOLVERS}/coinbrew /usr/bin/

RUN git config --global http.postBuffer 524288000 RUN git config --global advice.detachedHead false

ENTRYPOINT ["tail"] CMD ["-f","/dev/null"]

I ran my docker container in debug mode, and ran the command

./coinbrew fetch Bonmin@master --verbosity=4 --disable-silent-rules --no-prompt

This is the issue i am getting

sh-4.2# ./coinbrew fetch Bonmin@master --verbosity=4 --disable-silent-rules --no-prompt Welcome to the COIN-OR fetch and build utility

For help, run script with --help or see https://coin-or.github.io/coinbrew Please report issues at https://github.com/coin-or/coinbrew Detailed build documentation at https://coin-or.github.io

From https://github.com/coin-or/Bonmin

##################################################

Rebasing Bonmin master

##################################################

Already up to date. From https://github.com/coin-or-tools/ThirdParty-HSL

##################################################

Rebasing ThirdParty/HSL stable/2.2

##################################################

Already up to date. From https://github.com/coin-or-tools/ThirdParty-HSL

##################################################

Switching ThirdParty/ASL to master and rebasing

##################################################

Already on 'master' Your branch is up to date with 'origin/master'. Already up to date. None of the utilities, wget, curl, or fetch found in PATH. Cannot download source.

I tried reinstalling wget again and ran coinbrew in interactive mode, still facing the same issue in both the cases

I verified that wget was installed,

sh-4.2# wget --version GNU Wget 1.14 built on linux-gnu.

+digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl

Wgetrc: /etc/wgetrc (system) Locale: /usr/share/locale Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a

Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://www.gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Originally written by Hrvoje Niksic hniksic@xemacs.org. Please send bug reports and questions to bug-wget@gnu.org.

I verified wget was present in the machine

sh-4.2# echo $PKG_CONFIG_PATH /usr/bin:

sh-4.2# yum install -y wget Loaded plugins: ovl, priorities amzn2-core | 3.6 kB 00:00:00
Package wget-1.14-18.amzn2.1.x86_64 already installed and latest version Nothing to do

sh-4.2# sh-4.2# find / -name 'wget' 2>/dev/null sh-4.2# /usr/bin/wget

sh-4.2# echo $PATH /usr/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

svigerske commented 2 months ago

The get.ASL script uses the which command to check whether wget, curl, or fetch are available. It seems that which is not available, so add this to your yum install -y command.

charcharan commented 2 months ago

The get.ASL script uses the which command to check whether wget, curl, or fetch are available. It seems that which is not available, so add this to your yum install -y command.

This helped and i am able to install the solvers. Thanks