Compilation failure on macOS inside GCC

89 views
Skip to first unread message

Ben Boeckel

unread,
Aug 28, 2023, 12:12:46 PM8/28/23
to isl Development
Hi,

I am seeing the following build failure when built as part of GCC (namely https://github.com/iains/gcc-13-branch) on macOS with Xcode 14.2:

```
depbase=`echo isl_test_cpp17.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        g++ -std=c++11 -DHAVE_CONFIG_H   -I. -I../../src/isl -I../../src/isl/include -Iinclude/ -I/Users/ben.boeckel/code/ci-utilities/src/build/gcc/build/gmp/../../src/gmp -I/Users/ben.boeckel/code/ci-utilities/src
/build/gcc/build/./gmp   -g -MT isl_test_cpp17.o -MD -MP -MF $depbase.Tpo -c -o isl_test_cpp17.o ../../src/isl/isl_test_cpp17.cc &&\
        mv -f $depbase.Tpo $depbase.Po
In file included from ../../src/isl/isl_test_cpp17.cc:20:                                                                                                                                                              
../../src/isl/isl_test_cpp17-generic.cc:25:10: error: no matching constructor for initialization of 'isl::id'
        isl::id id(ctx, "S", s);                                                                          
                ^  ~~~~~~~~~~~                                                                            
../../src/isl/include/isl/cpp.h:10994:5: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
id::id(isl::ctx ctx, const std::string &str)                                                              
    ^                                                                                                      
../../src/isl/include/isl/cpp.h:10976:5: note: candidate constructor not viable: requires single argument 'ptr', but 3 arguments were provided
id::id(__isl_take isl_id *ptr)  
    ^                                                                                                                                                                                                                  
../../src/isl/include/isl/cpp.h:10982:5: note: candidate constructor not viable: requires single argument 'obj', but 3 arguments were provided
id::id(const id &obj)
    ^                                                                                                                                                                                                                  
../../src/isl/include/isl/cpp.h:10979:5: note: candidate constructor not viable: requires 0 arguments, but 3 were provided
id::id()
    ^
```

I've tried `export HAVE_CXX17=0`, but it still shows up. What is causing `-std=c++11` to be passed explicitly to the C++17 tests? I see `config.log` has:

```
configure:9259: checking whether g++ -std=c++11 supports C++17 features by default
configure:10054: g++ -std=c++11 -c -g  conftest.cpp >&5
conftest.cpp:312:2: error: "This is not a C++14 compiler"
#error "This is not a C++14 compiler"
 ^
conftest.cpp:432:2: error: "This is not a C++17 compiler"
#error "This is not a C++17 compiler"
 ^
```

So it *shouldn't* have C++17 assumed anyways (though I wonder why this test has `-std=c++11`… Some investigation there seems to point to `gcc`'s `config.log` having `CXX='g++ -std=c++11`. However, it seems that `isl` should be a bit more consistent with its own C++17 flag management.

Thanks,

--Ben

Sven Verdoolaege

unread,
Aug 28, 2023, 12:16:48 PM8/28/23
to Ben Boeckel, isl Development
On Mon, Aug 28, 2023 at 06:37:00AM -0700, 'Ben Boeckel' via isl Development wrote:
> ```
> configure:9259: checking whether g++ -std=c++11 supports C++17 features by
> default
> configure:10054: g++ -std=c++11 -c -g conftest.cpp >&5
> conftest.cpp:312:2: error: "This is not a C++14 compiler"
> #error "This is not a C++14 compiler"
> ^
> conftest.cpp:432:2: error: "This is not a C++17 compiler"
> #error "This is not a C++17 compiler"
> ^
> ```

If your compiler doesn't support C++17, then isl_test_cpp17
shouldn't get built. I can only imagine something went wrong
in the generation of Makefile.
What version of isl are you trying to comile?
Send config.log, config.status and Makefile.

skimo

Ben Boeckel

unread,
Aug 28, 2023, 4:24:43 PM8/28/23
to sven.ver...@gmail.com, isl Development
I'm linking the `isl` 0.26 extracted source into `gcc` and bootstrapping
it.

> Send config.log, config.status and Makefile.

Attached.

--Ben
config.log
config.status
Makefile

Sven Verdoolaege

unread,
Aug 28, 2023, 5:52:28 PM8/28/23
to Ben Boeckel, isl Development
On Mon, Aug 28, 2023 at 06:37:00AM -0700, 'Ben Boeckel' via isl Development wrote:
> ```
> configure:9259: checking whether g++ -std=c++11 supports C++17 features by
> default
> configure:10054: g++ -std=c++11 -c -g conftest.cpp >&5
> conftest.cpp:312:2: error: "This is not a C++14 compiler"
> #error "This is not a C++14 compiler"
> ^
> conftest.cpp:432:2: error: "This is not a C++17 compiler"
> #error "This is not a C++17 compiler"
> ^
> ```
>
> So it *shouldn't* have C++17 assumed anyways

Actually, no. This is just the first attempt.
It does later find that "g++ -std=c++11 -std=gnu++17" works.
Your Makefile also has

CXX = g++ -std=c++11 -std=gnu++17

> ```
> depbase=`echo isl_test_cpp17.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../src/isl

But "-std=gnu++17" somehow got dropped here.
Are you perhaps overriding CXX when running make?
If so, don't.

skimo

Ben Boeckel

unread,
Aug 29, 2023, 6:31:26 AM8/29/23
to sven.ver...@gmail.com, isl Development
On Mon, Aug 28, 2023 at 23:52:25 +0200, Sven Verdoolaege wrote:
> But "-std=gnu++17" somehow got dropped here.
> Are you perhaps overriding CXX when running make?
> If so, don't.

I'm not, but maybe GCC is… I'll see if anyone has issues on the GCC
side.

--Ben
Reply all
Reply to author
Forward
0 new messages