Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clp fails to compile when COIN_BIG_INDEX = 2 #95

Open
ycollet opened this issue Mar 14, 2017 · 2 comments
Open

Clp fails to compile when COIN_BIG_INDEX = 2 #95

ycollet opened this issue Mar 14, 2017 · 2 comments

Comments

@ycollet
Copy link

ycollet commented Mar 14, 2017

When I try to compiles Clp with COIN_BIG_INDEX=2, I've got the following error message:

[ 1%] Building CXX object CoinUtils/CMakeFiles/libCoinUtils.dir/src/CoinOslFactorization.cpp.o
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp: Dans la fonction membre « virtual void CoinOslFactorization::getAreas(int, int, CoinBigIndex, CoinBigIndex) »:
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp:162:44: erreur : no matching function for call to « CoinMax(CoinBigIndex&, int&) »
factInfo_.eta_size=CoinMax(size,oldnnetas);
^
In file included from /home/artelys/repository/coin/Clp/CoinUtils/src/CoinIndexedVector.hpp:20:0,
from /home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.hpp:18,
from /home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp:10:
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinHelperFunctions.hpp:548:1: note : candidate: template T CoinMax(T, T)
CoinMax(register const T x1, register const T x2)
^~~~~~~
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinHelperFunctions.hpp:548:1: note : template argument deduction/substitution failed:
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp:162:44: note : deduced conflicting types for parameter « T » (« long long int » and « int »)
factInfo_.eta_size=CoinMax(size,oldnnetas);
^
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp: Dans la fonction membre « virtual void CoinOslFactorization::preProcess() »:
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp:224:48: erreur : cannot convert « int* » to « CoinBigIndex* {aka long long int*} » in initialization
CoinBigIndex * startColumnU=factInfo_.xcsadr+1;
^
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp: Dans la fonction membre « int CoinOslFactorization::factorize(const CoinPackedMatrix&, int*, int*, double) »:
/home/artelys/repository/coin/Clp/CoinUtils/src/CoinOslFactorization.cpp:1434:29: erreur : cannot convert « CoinBigIndex* {aka long long int*} » to « int* » in initialization
int * startColumnU=starts();
^
CoinUtils/CMakeFiles/libCoinUtils.dir/build.make:302 : la recette pour la cible « CoinUtils/CMakeFiles/libCoinUtils.dir/src/CoinOslFactorization.cpp.o » a échouée
make[2]: *** [CoinUtils/CMakeFiles/libCoinUtils.dir/src/CoinOslFactorization.cpp.o] Erreur 1
CMakeFiles/Makefile2:999 : la recette pour la cible « CoinUtils/CMakeFiles/libCoinUtils.dir/all » a échouée
make[1]: *** [CoinUtils/CMakeFiles/libCoinUtils.dir/all] Erreur 2
Makefile:160 : la recette pour la cible « all » a échoué

Tested with gcc-6.3.1 on Fedora 25 64 bits.

@svigerske svigerske transferred this issue from coin-or/Clp.old Mar 2, 2019
@svigerske
Copy link
Member

Still an issue with current CoinUtils/trunk.
I'm patching

Index: src/CoinTypes.hpp
===================================================================
--- src/CoinTypes.hpp	(revision 2110)
+++ src/CoinTypes.hpp	(working copy)
@@ -21,7 +21,7 @@
 
 //=============================================================================
 #ifndef COIN_BIG_INDEX
-#define COIN_BIG_INDEX 0
+#define COIN_BIG_INDEX 2
 #endif
 
 #if COIN_BIG_INDEX == 0

and when building with --enable-debug GCC 8.2 gives me

g++ -DHAVE_CONFIG_H -I. -I. -g -O0 -pipe -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCOINUTILS_BUILD -MT CoinOslFactorization2.lo -MD -MP -MF .deps/CoinOslFactorization2.Tpo -c CoinOslFactorization2.cpp -o CoinOslFactorization2.o
CoinOslFactorization.cpp:135:6: error: no declaration matches 'void CoinOslFactorization::getAreas(int, int, CoinBigIndex, CoinBigIndex)'
 void CoinOslFactorization::getAreas(int numberOfRows,
      ^~~~~~~~~~~~~~~~~~~~
In file included from CoinOslFactorization.cpp:11:
CoinOslFactorization.hpp:130:16: note: candidate is: 'virtual void CoinOslFactorization::getAreas(int, int, int, int)'
   virtual void getAreas(int numberRows,
                ^~~~~~~~
CoinOslFactorization.hpp:108:7: note: 'class CoinOslFactorization' defined here
 class CoinOslFactorization : public CoinOtherFactorization {
       ^~~~~~~~~~~~~~~~~~~~
CoinOslFactorization.cpp: In member function 'virtual void CoinOslFactorization::preProcess()':
CoinOslFactorization.cpp:218:51: error: cannot convert 'int*' to 'CoinBigIndex*' {aka 'long long int*'} in initialization
   CoinBigIndex *startColumnU = factInfo_.xcsadr + 1;
                                                   ^
CoinOslFactorization.cpp:220:31: warning: conversion from 'CoinBigIndex' {aka 'long long int'} to 'int' may change value [-Wconversion]
     int start = startColumnU[i];
                 ~~~~~~~~~~~~~~^
CoinOslFactorization.cpp: At global scope:
CoinOslFactorization.cpp:630:1: error: no declaration matches 'CoinBigIndex* CoinOslFactorization::starts() const'
 CoinOslFactorization::starts() const
 ^~~~~~~~~~~~~~~~~~~~
In file included from CoinOslFactorization.cpp:11:
CoinOslFactorization.hpp:179:16: note: candidate is: 'virtual int* CoinOslFactorization::starts() const'
   virtual int *starts() const;
                ^~~~~~
CoinOslFactorization.hpp:108:7: note: 'class CoinOslFactorization' defined here
 class CoinOslFactorization : public CoinOtherFactorization {
       ^~~~~~~~~~~~~~~~~~~~
CoinOslFactorization.cpp: In member function 'int CoinOslFactorization::factorize(const CoinPackedMatrix&, int*, int*, double)':
CoinOslFactorization.cpp:1415:36: warning: conversion from 'CoinBigIndex' {aka 'long long int'} to 'int' may change value [-Wconversion]
   getAreas(numberRows, numberRows, numberElements,
                                    ^~~~~~~~~~~~~~
CoinOslFactorization.cpp:1416:7: warning: conversion from 'CoinBigIndex' {aka 'long long int'} to 'int' may change value [-Wconversion]
     2 * numberElements);
     ~~^~~~~~~~~~~~~~~~
CoinOslFactorization.cpp:1452:35: warning: conversion from 'CoinBigIndex' {aka 'long long int'} to 'int' may change value [-Wconversion]
       startColumnU[numberBasic] = numberElements;
                                   ^~~~~~~~~~~~~~
CoinOslFactorization.cpp: At global scope:
CoinOslFactorization.cpp:1045:13: warning: 'void c_ekksmem(EKKfactinfo*, int, int)' defined but not used [-Wunused-function]
 static void c_ekksmem(EKKfactinfo *fact, int nrow, int maximumPivots)
             ^~~~~~~~~

@svigerske svigerske transferred this issue from coin-or/Clp Mar 11, 2019
@a-andre
Copy link
Contributor

a-andre commented Aug 1, 2024

The problem might be gone because COIN_BIG_INDEX has been removed in ee1fff9 ("remove COIN_BIG_INDEX, but add COINUTILS_BIGINDEX_IS_INT").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants