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

compilation errors: BONMINLIB_EXPORT and bad ld name #62

Open
BrannonKing opened this issue Jun 9, 2022 · 4 comments
Open

compilation errors: BONMINLIB_EXPORT and bad ld name #62

BrannonKing opened this issue Jun 9, 2022 · 4 comments

Comments

@BrannonKing
Copy link

When I try to compile Couenne I get this error:

./../src/main/CouenneBab.cpp:45:8: error: ‘BONMINLIB_EXPORT’ does not name a type; did you mean ‘COUENNELIB_EXPORT’?
   45 | extern BONMINLIB_EXPORT Bonmin::OACutGenerator2 *currentOA;   // pointer to the OA generator

My OS is a fairly recent version of Manjaro. Also, the build file should specify the required C++ standard. There are a lot of warnings when compiling with C++17 (the default on my machine). If I switch the export macro to the suggested one, it still doesn't fully compile for me. It fails at the very end with this error:

  ...
  CXX      main/CouenneBab.lo
  CXX      main/BonCouenneSetup.lo
  CXX      main/SmartAslDestr.lo
  CXXLD    libCouenne.la
make[2]: Leaving directory '/home/brannon/Downloads/Couenne/build/src'
make[1]: Leaving directory '/home/brannon/Downloads/Couenne/build/src'
Making all in src/main
make[1]: Entering directory '/home/brannon/Downloads/Couenne/build/src/main'
  CXX      BonCouenne.o
  CXXLD    couenne
/usr/bin/ld: cannot find ../.libs/libCouenne.so: No such file or directory
collect2: error: ld returned 1 exit status
@BrannonKing
Copy link
Author

As a sidenote, when I attempt to install Couenne from the AUR, I get a compilation error about missing asl.h, although I have plenty of them on my system.

@svigerske
Copy link
Member

BONMINLIB_EXPORT should be defined in BonminConfig.h, which should be included by some of the Bonmin headers that is included by CouenneBab.cpp. As there is no information on how you try to compile Couenne, I can just guess that maybe you build against an old Bonmin version that doesn't fit to the Couenne version you try to compile.

I also get plenty of warnings about the deprecated use of register when compiling Couenne. So far, I choose to ignore them.

I cannot say why libCouenne.so is missing. There is

 CXXLD    libCouenne.la

which should have create them. Do a make clean and call make with V=1 to get more output.

@mealejan
Copy link

@BrannonKing, I wrote a comment on the aur page of coin-or-couenne which allows you to compile the package. It was looking in the wrong folder for the asl.h and later had issues with the c++ standard version. With the patch posted below I am able to compile and install the package. For people stumbling over a problem with the c++17 standard I was able to compile it with -std=c++11 in the CXXFLAGS until the code is adapted to the new standard.

@defencedog
Copy link

@BrannonKing have you solved it?
I am compiling it via git clone & I face same issue

make[1]: Entering directory '/data/data/com.termux/files/home/ipopt_dev/Couenne/src'
make  all-am
make[2]: Entering directory '/data/data/com.termux/files/home/ipopt_dev/Couenne/src'
  CXX      main/CouenneBab.lo
main/CouenneBab.cpp:45:8: error: unknown type name 'BONMINLIB_EXPORT'
   45 | extern BONMINLIB_EXPORT Bonmin::OACutGenerator2 *currentOA;   // pointer to the OA generator
      |        ^
main/CouenneBab.cpp:45:33: error: no member named 'OACutGenerator2' in namespace 'Bonmin'
   45 | extern BONMINLIB_EXPORT Bonmin::OACutGenerator2 *currentOA;   // pointer to the OA generator
      |                         ~~~~~~~~^
main/CouenneBab.cpp:45:48: error: expected ';' after top level declarator
   45 | extern BONMINLIB_EXPORT Bonmin::OACutGenerator2 *currentOA;   // pointer to the OA generator
      |                                                ^
      |                                                ;
main/CouenneBab.cpp:46:8: error: unknown type name 'BONMINLIB_EXPORT'
   46 | extern BONMINLIB_EXPORT CbcModel                *OAModel;     // pointer to the submip if using Cbc
      |        ^
main/CouenneBab.cpp:46:33: error: expected ';' after top level declarator
   46 | extern BONMINLIB_EXPORT CbcModel                *OAModel;     // pointer to the submip if using Cbc
      |                                 ^
      |                                 ;
main/CouenneBab.cpp:62:9: error: use of undeclared identifier 'OAModel'
   62 |     if (OAModel)            OAModel   -> sayEventHappened();                      // stop at next node
      |         ^
main/CouenneBab.cpp:62:29: error: use of undeclared identifier 'OAModel'
   62 |     if (OAModel)            OAModel   -> sayEventHappened();                      // stop at next node
      |                             ^
main/CouenneBab.cpp:63:9: error: use of undeclared identifier 'currentOA'
   63 |     if (currentOA)          currentOA -> parameter ().maxLocalSearchTime_ = 0.; // stop OA
      |         ^
main/CouenneBab.cpp:63:29: error: use of undeclared identifier 'currentOA'
   63 |     if (currentOA)          currentOA -> parameter ().maxLocalSearchTime_ = 0.; // stop OA
      |                             ^
9 errors generated.
make[2]: *** [Makefile:707: main/CouenneBab.lo] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/ipopt_dev/Couenne/src'
make[1]: *** [Makefile:565: all] Error 2
make[1]: Leaving directory '/data/data/com.termux/files/home/ipopt_dev/Couenne/src'
make: *** [Makefile:452: all-recursive] Error 1


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

4 participants