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

ColPack detection on MacOS / g++ 10.1 gets confused #37

Open
ckirches opened this issue Feb 17, 2021 · 0 comments
Open

ColPack detection on MacOS / g++ 10.1 gets confused #37

ckirches opened this issue Feb 17, 2021 · 0 comments

Comments

@ckirches
Copy link

ckirches commented Feb 17, 2021

ADOL-C 2.6.3 is confused when detecting ColPack on MacOS, using g++ 10.1 as compiler.

From the ./configure output:

checking ColPack/ColPackHeaders.h presence... yes   
configure: WARNING: ColPack/ColPackHeaders.h: present but cannot be compiled   
configure: WARNING: ColPack/ColPackHeaders.h:     check for missing prerequisite headers?   
configure: WARNING: ColPack/ColPackHeaders.h: see the Autoconf documentation   
configure: WARNING: ColPack/ColPackHeaders.h:     section "Present But Cannot Be Compiled"   
configure: WARNING: ColPack/ColPackHeaders.h: proceeding with the compiler's result   
configure: WARNING:     ## -------------------------------------- ##   
configure: WARNING:     ## Report this to [email protected] ##   
configure: WARNING:     ## -------------------------------------- ##   
checking for ColPack/ColPackHeaders.h... no   

From config.log:

configure:18078: checking ColPack/ColPackHeaders.h usability   
configure:18078: g++ -c -g -O2   -I/opt/local/include -I/Users/ckirches/External/ColPack/Src/build/include conftest.cpp >&5   
In file included from /opt/local/include/gcc10/c++/stdlib.h:36,   
                 from conftest.cpp:68:   
/opt/local/include/gcc10/c++/cstdlib:144:11: error: 'calloc' has not been declared in '::'   
  144 |   using ::calloc;   
      |           ^~~~~~   
/opt/local/include/gcc10/c++/cstdlib:151:11: error: 'malloc' has not been declared in '::'   
  151 |   using ::malloc;   
      |           ^~~~~~   
/opt/local/include/gcc10/c++/cstdlib:164:11: error: 'realloc' has not been declared in '::'   
  164 |   using ::realloc;   
      |           ^~~~~~~
In file included from conftest.cpp:68:   
/opt/local/include/gcc10/c++/stdlib.h:59:12: error: 'calloc' has not been declared in 'std'   
   59 | using std::calloc;   
      |            ^~~~~~   
/opt/local/include/gcc10/c++/stdlib.h:65:12: error: 'malloc' has not been declared in 'std'   
   65 | using std::malloc;   
      |            ^~~~~~   
/opt/local/include/gcc10/c++/stdlib.h:73:12: error: 'realloc' has not been declared in 'std'   
   73 | using std::realloc;   
      |            ^~~~~~~   
configure:18078: $? = 1   
configure: failed program was:   

As per
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Present-But-Cannot-Be-Compiled.html
there are dependent headers (#include <cstdlib>) that should be listed in the autoconf script, but are missing. Unfortunately, my autoconf abilities are too limited to provide a fix.

FWIW after a lot of fiddling I managed a build by

  • forcing ColPack detecting in configure.ac
  • removing #defines for calloc, malloc, and realloc in config.h
  • disabling the reverse #defined in common.h inside the ADOLC_NO_MALLOC block
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

1 participant