glaze icon indicating copy to clipboard operation
glaze copied to clipboard

make failing

Open ericaslakson opened this issue 10 months ago • 5 comments

era@jammy-desktop:~/inv/cpp/glaze-main/build$ make [ 1%] Building CXX object CMakeFiles/glaze_ide.dir/src/main.cpp.o In file included from /home/era/inv/cpp/glaze-main/include/glaze/core/common.hpp:20, from /home/era/inv/cpp/glaze-main/include/glaze/core/read.hpp:9, from /home/era/inv/cpp/glaze-main/include/glaze/beve/skip.hpp:8, from /home/era/inv/cpp/glaze-main/include/glaze/beve/read.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/beve/ptr.hpp:6, from /home/era/inv/cpp/glaze-main/include/glaze/beve.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/glaze.hpp:35, from /home/era/inv/cpp/glaze-main/src/main.cpp:1: /home/era/inv/cpp/glaze-main/include/glaze/util/expected.hpp:7:10: fatal error: expected: No such file or directory 7 | #include | ^~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/glaze_ide.dir/build.make:79: CMakeFiles/glaze_ide.dir/src/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1714: CMakeFiles/glaze_ide.dir/all] Error 2 make: *** [Makefile:166: all] Error 2

This build is on Jammy.

$ gcc --version gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I tried adding std=c++23 to the g++ command line in cmake but no joy.

Any ideas?

Thx!

ericaslakson avatar Apr 22 '25 21:04 ericaslakson

To build:

  1. Run CMake: First, run CMake to generate the necessary Makefile from your CMakeLists.txt. This is typically done in a separate build directory to keep things organized:
mkdir build
cd build
cmake ..

This will generate a Makefile (and other build files) inside the build directory.

  1. Run Make: After CMake has generated the Makefile, you can run make in the build directory:
make

This will build the project according to Glaze's CMakeLists.txt

stephenberry avatar Apr 23 '25 00:04 stephenberry

Thanks, here's what happens:

era@jammy-desktop:~/inv/cpp/glaze-main/build$ cmake .. -- Fetching dependencies... -- ...finished fetching dependencies. -- Configuring done (0.7s) -- Generating done (0.2s) -- Build files have been written to: /home/era/inv/cpp/glaze-main/build era@jammy-desktop:~/inv/cpp/glaze-main/build$ era@jammy-desktop:~/inv/cpp/glaze-main/build$ make [ 1%] Building CXX object CMakeFiles/glaze_ide.dir/src/main.cpp.o In file included from /home/era/inv/cpp/glaze-main/include/glaze/core/common.hpp:20, from /home/era/inv/cpp/glaze-main/include/glaze/core/read.hpp:9, from /home/era/inv/cpp/glaze-main/include/glaze/beve/skip.hpp:8, from /home/era/inv/cpp/glaze-main/include/glaze/beve/read.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/beve/ptr.hpp:6, from /home/era/inv/cpp/glaze-main/include/glaze/beve.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/glaze.hpp:35, from /home/era/inv/cpp/glaze-main/src/main.cpp:1: /home/era/inv/cpp/glaze-main/include/glaze/util/expected.hpp:7:10: fatal error: expected: No such file or directory 7 | #include | ^~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/glaze_ide.dir/build.make:79: CMakeFiles/glaze_ide.dir/src/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1714: CMakeFiles/glaze_ide.dir/all] Error 2 make: *** [Makefile:166: all] Error 2 era@jammy-desktop:~/inv/cpp/glaze-main/build$

I get a successful cmake, but the make following fails.

here is some config info:

era@jammy-desktop:~/inv/cpp/glaze-main/build$ uname -a Linux jammy-desktop 6.8.0-57-generic #59~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Mar 19 17:07:41 UTC 2 x86_64 x86_64 x86_64 GNU/Linux $ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

you mention you need vs 23 of stl. Cmake is putting it at vs 17 I believe. Attaching CMakePresets.json

CMakePresets.json

Thanks,

Eric

ericaslakson avatar Apr 23 '25 00:04 ericaslakson

target_compile_features(glaze_glaze INTERFACE cxx_std_23) is getting set in the CMake and in your CMakePresets.json this is set for gcc: "CMAKE_CXX_COMPILER": "/usr/bin/g++ -std=gnu++23",

Is the 17 you are seeing related to the version of Clang you are using?

C++23 should be required.

stephenberry avatar Apr 23 '25 01:04 stephenberry

Hi Stephen,

Sorry I mixed up the Clang version in CMakePresets with the gnu version as you surmised. I see the setting is correct for both in my CMake* files. I don't have clang installed on the build machine so that must not impact anything.

When I type 'make', this is the error I'm getting:

@.***:~/inv/cpp/glaze-main/build$ make [ 1%] Building CXX object CMakeFiles/glaze_ide.dir/src/main.cpp.o In file included from /home/era/inv/cpp/glaze-main/include/glaze/core/common.hpp:20, from /home/era/inv/cpp/glaze-main/include/glaze/core/read.hpp:9, from /home/era/inv/cpp/glaze-main/include/glaze/beve/skip.hpp:8, from /home/era/inv/cpp/glaze-main/include/glaze/beve/read.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/beve/ptr.hpp:6, from /home/era/inv/cpp/glaze-main/include/glaze/beve.hpp:7, from /home/era/inv/cpp/glaze-main/include/glaze/glaze.hpp:35, from /home/era/inv/cpp/glaze-main/src/main.cpp:1: /home/era/inv/cpp/glaze-main/include/glaze/util/expected.hpp:7:10: fatal error: expected: No such file or directory 7 | #include | ^~~~~~~~~~ compilation terminated.

If I check there is only one file with name 'expected.*'

@.**:/mnt/zfs_backup_vm_storage_raw/investment_db/cpp/glaze-main$ find . -name 'expected.' ./include/glaze/util/expected.hpp

Surmising from the error above, In the process of compiling main.cpp the file /glaze/util/expected.hpp is included in a nested include. The line is error is line 7 of expected.hpp:

7 | #include

I presume the compiler dies because the file cannot be included. However, this is a strange #include statement because it is attempting to include expected.hpp into expected.hpp. I don't see any other files with name expected that it could be since there is only one file with name expected.hpp

Perhaps this is allowed by other compilers but g++ chokes with it.

thx,

Eric

On Tue, Apr 22, 2025 at 9:48 PM Stephen Berry @.***> wrote:

target_compile_features(glaze_glaze INTERFACE cxx_std_23) is getting set in the CMake and in your CMakePresets.json https://github.com/user-attachments/files/19858888/CMakePresets.json this is set for gcc: "CMAKE_CXX_COMPILER": "/usr/bin/g++ -std=gnu++23",

Is the 17 you are seeing related to the version of Clang you are using?

C++23 should be required.

— Reply to this email directly, view it on GitHub https://github.com/stephenberry/glaze/issues/1703#issuecomment-2822857786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIUHMJPMX42DVDFOIP6OB3223WM7AVCNFSM6AAAAAB3UWL4U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRSHA2TONZYGY . You are receiving this because you authored the thread.Message ID: @.***> stephenberry left a comment (stephenberry/glaze#1703) https://github.com/stephenberry/glaze/issues/1703#issuecomment-2822857786

target_compile_features(glaze_glaze INTERFACE cxx_std_23) is getting set in the CMake and in your CMakePresets.json https://github.com/user-attachments/files/19858888/CMakePresets.json this is set for gcc: "CMAKE_CXX_COMPILER": "/usr/bin/g++ -std=gnu++23",

Is the 17 you are seeing related to the version of Clang you are using?

C++23 should be required.

— Reply to this email directly, view it on GitHub https://github.com/stephenberry/glaze/issues/1703#issuecomment-2822857786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIUHMJPMX42DVDFOIP6OB3223WM7AVCNFSM6AAAAAB3UWL4U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRSHA2TONZYGY . You are receiving this because you authored the thread.Message ID: @.***>

ericaslakson avatar Apr 23 '25 13:04 ericaslakson

#include <expected> is for std::expected. It looks like you're trying to build with GCC 11, which doesn't support std::expected. Glaze builds with GCC 12+

stephenberry avatar Apr 23 '25 16:04 stephenberry

Were you able to try with GCC 12 or higher?

stephenberry avatar Apr 28 '25 21:04 stephenberry

Hi Stephen,

No I have too many other things balanced on the OS version presently. I just used the standard slower jsoncpp pkg. When I upgrade I’ll give it a shot.

Thanks much looks like Glaze is the best.

Eric

On Mon, Apr 28, 2025 at 5:16 PM Stephen Berry @.***> wrote:

stephenberry left a comment (stephenberry/glaze#1703) https://github.com/stephenberry/glaze/issues/1703#issuecomment-2836701145

Were you able to try with GCC 12 or higher?

— Reply to this email directly, view it on GitHub https://github.com/stephenberry/glaze/issues/1703#issuecomment-2836701145, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIUHMNF34NNQ4WG5Z62NQT232LCRAVCNFSM6AAAAAB3UWL4U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZWG4YDCMJUGU . You are receiving this because you authored the thread.Message ID: @.***>

ericaslakson avatar Apr 28 '25 22:04 ericaslakson

Enjoy your C++ programming!

stephenberry avatar Apr 29 '25 12:04 stephenberry