coin-or / SHOT

A solver for mixed-integer nonlinear optimization problems
https://shotsolver.dev
Eclipse Public License 2.0
119 stars 25 forks source link

Compiling on Arch Linux #142

Closed chemrgineer closed 2 years ago

chemrgineer commented 2 years ago

Hi, I am compiling SHOT with CBC and IPOPT on Manjaro ARM Linux aarch64 distro. I installed CBC from arch repository and works fine. I compiled and installed IPOPT from github. What can I do for this problem? cmake version 3.22.0 GNU Make 4.3 gcc (GCC) 10.2.0 IPOPT 3.14.5 with ASL(20211109) CBC Version: 2.10.5

andreaslundell commented 2 years ago

I have never tried compiling SHOT on ARM, so I cannot say whether it will work or not. But what is the real issue? Please include a detailed guide what you have done and where it went wrong (error messages etc.).

chemrgineer commented 2 years ago

Sorry for inconvenience, I get shot files with "git clone https://www.github.com/coin-or/SHOT --recursive" when I type the terminal, I can reach IPOPT (compiled with above compiler). When I try to configure with "cmake -DHAS_AMPL=on -DHAS_CBC=on -DHAS_IPOPT=on -DIPOPT_DIR=/usr/local/lib .." I get this output: -- The CXX compiler identification is GNU 10.2.0 -- The C compiler identification is GNU 10.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Looking for C++ include filesystem -- Looking for C++ include filesystem - found -- Performing Test CAN_COMPILE_FS_WITHOUT_LINK -- Performing Test CAN_COMPILE_FS_WITHOUT_LINK - Success -- Git hash: e225a002 -- Found PkgConfig: /usr/bin/pkgconf (found version "1.8.0") CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (PkgConfig) does not match the name of the calling package (CBC). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args) misc/FindCBC.cmake:6 (include) CMakeLists.txt:189 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

-- Checking for one of the modules 'cbc' -- Cbc found using Pkg-config: Include directories found: /usr/include/coin;/usr/include/coin/ThirdParty Library directories found: /usr/lib -- Found CBC: CbcSolver;Cbc;pthread;rt;coinasl;dl;Cgl;OsiClp;ClpSolver;Clp;cholmod;Osi;CoinUtils;bz2;z;glpk;lapack;blas;m -- Checking for one of the modules 'ipopt' CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message): None of the required 'ipopt' found Call Stack (most recent call first): CMakeLists.txt:251 (pkg_search_module)

-- Cbc include files will be used from: /usr/include/coin;/usr/include/coin/ThirdParty -- The following Cbc libraries will be used from: /usr/lib CbcSolver;Cbc;pthread;rt;coinasl;dl;Cgl;OsiClp;ClpSolver;Clp;cholmod;Osi;CoinUtils;bz2;z;glpk;lapack;blas;m -- Ipopt include files will be used from: /usr/local/lib/include/coin -- The following Ipopt libraries will be used from:

-- Configuring incomplete, errors occurred! See also "/home/emrullah/shot/build/CMakeFiles/CMakeOutput.log" CMakeOutput.log . I succesfully compiled SHOT on ARM Debian. Arch systems has diffence but I dont know what it is. Thanks for fast response.

andreaslundell commented 2 years ago

The critical lines are

-- Checking for one of the modules 'ipopt'
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message):
None of the required 'ipopt' found
Call Stack (most recent call first):
CMakeLists.txt:251 (pkg_search_module)

So SHOT cannot find Ipopt. You might need to specify the path to Ipopt in the CMakeLists.txt file.

https://github.com/coin-or/SHOT/blob/e225a002500a4826d8dd575799bf3486967d57f1/CMakeLists.txt#L67

chemrgineer commented 2 years ago

Accidentaly solved the problem with: "cmake -DHAS_AMPL=on -DHAS_CBC=on -DHAS_IPOPT=on -DIPOPT_DIR=/usr/local/ .." When I deleted lib folder in /usr/local/lib path it worked. Thanks for your attention.