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

[low priority] Integrate into Compiler Explorer #6

Open
1 of 3 tasks
neatudarius opened this issue Oct 17, 2024 · 17 comments
Open
1 of 3 tasks

[low priority] Integrate into Compiler Explorer #6

neatudarius opened this issue Oct 17, 2024 · 17 comments
Assignees

Comments

@neatudarius
Copy link
Member

neatudarius commented Oct 17, 2024

Integrate iterator_interface into Compiler Explorer

  • Initial integration with Compiler Explorer (trunk version, automated nigthly clone)
  • Decide how versioning and releases
  • Release first version

Check progress from bemanproject/optional#21

@changkhothuychung
Copy link

I wanna try this, but I haven't integrated to Compiler Explorer before. Any instructions that I can start with?

@neatudarius
Copy link
Member Author

neatudarius commented Oct 19, 2024

I wanna try this, but I haven't integrated to Compiler Explorer before. Any instructions that I can start with?

Sure! Thanks for help!

Note: We can do only 1st task from attach issue. OK?
Instructions are very simple. Check this example that I did for optional - bemanproject/optional#21 (comment):

PS: I will create PRs needed for optional26 after library renaming.

@changkhothuychung
Copy link

Thanks! Will work on it soon.

@changkhothuychung
Copy link

@neatudarius
Copy link
Member Author

neatudarius commented Nov 7, 2024

PR's created

@neatudarius can you review if I am missing something? Thanks!

Sorry for late reply - can we push small patches to rename there to beman_iterator_interface? We should match the full name. Maybe we'll have multiple libraries for iterators in Beman.

@neatudarius
Copy link
Member Author

neatudarius commented Nov 11, 2024

@changkhothuychung , left one comment on your PRs from compiler explorer repos.

I have a WIP PR to make sure iterator_interfaces follows all Beman Standard rules:
image

image

@neatudarius
Copy link
Member Author

neatudarius commented Nov 12, 2024

Left comments on PRs

@changkhothuychung , can you help updating and testing that PR? @camio may include a link to Compiler Explorer in his presenation from Meeting C++ Berlin (this week), if the deployment is table. Thanks!

CC: @camio @RaduNichita

@neatudarius
Copy link
Member Author

I see that godbolt developers applied the fix on the PR and merged them. We'll way for the nightly sync. Thanks all!

@partouf
Copy link
Contributor

partouf commented Nov 12, 2024

Couple of things going on:

  1. Non-blocking issue -> I had to remove the examples directory from CMake, because it caused cmake --install to fail https://github.com/compiler-explorer/infra/blob/main/bin/yaml/libraries.yaml#L1037
  2. The installation does not contain a root config.hpp as required here https://github.com/beman-project/iterator_interface/blob/main/include/beman/iterator_interface/iterator_interface.hpp#L7

The cmake --install package that we make only contains the following:

  • include/beman/iterator_interface/detail/stl_interfaces/config.hpp
  • include/beman/iterator_interface/detail/stl_interfaces/fwd.hpp
  • include/beman/iterator_interface/detail/stl_interfaces/iterator_interface.hpp
  • include/beman/iterator_interface/iterator_interface.hpp
  • include/beman/iterator_interface/iterator_interface_access.hpp
  • lib/libbeman.iterator_interface.a

If I check the cmake logging, I do not see it creating config.hpp

Now live -> https://godbolt.org/z/Yo4954GYW


For the record, this is our (generated) script to build with cmake so you can reproduce:

#!/bin/sh

export CC=/opt/compiler-explorer/gcc-14.2.0/bin/gcc
export CXX=/opt/compiler-explorer/gcc-14.2.0/bin/g++
export LD_LIBRARY_PATH=""
export LDFLAGS="-L/opt/compiler-explorer/gcc-14.2.0/lib64 -L/opt/compiler-explorer/gcc-14.2.0/lib  -Wl,-rpath=/opt/compiler-explorer/gcc-14.2.0/lib64 -Wl,-rpath=/opt/compiler-explorer/gcc-14.2.0/lib "
export NUMCPUS="$(nproc)"
cmake --install-prefix "/opt/compiler-explorer/staging/448b6844-3a42-456e-a9f0-12d5ca8e1e8e/install"  "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DCMAKE_SYSTEM_PROCESSOR=x86_64" "-DCMAKE_CXX_COMPILER_TARGET=x86_64-linux-gnu" "-DCMAKE_C_COMPILER_TARGET=x86_64-linux-gnu" "-DCMAKE_ASM_COMPILER_TARGET=x86_64-linux-gnu" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=/opt/compiler-explorer/gcc-14.2.0" "-DCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=/opt/compiler-explorer/gcc-14.2.0"  "-DCMAKE_CXX_FLAGS_DEBUG=    " -DBUILD_TESTING=OFF /opt/compiler-explorer/libs/beman_iterator_interface/main > cecmakelog.txt 2>&1
cmake --build . -j$NUMCPUS --target=beman.iterator_interface > cemakelog_0.txt 2>&1
cmake --build . -j$NUMCPUS --target=beman.iterator_interfaced > cemakelog_1.txt 2>&1
libsfound=$(find . -iname 'lib*.a')
if [ "$libsfound" = "" ]; then
  cmake --build . -j$NUMCPUS > cemakelog_2.txt 2>&1
fi
cmake --install . > ceinstall_0.txt 2>&1

Can send you the logging as well if needed

@steve-downey
Copy link
Member

We're mixing FILE_SET and target_include_directory, so we don't know to install the generated header file.
https://github.com/beman-project/iterator_interface/blob/d6efb25da89a628844bae590e3ceea7245a73bca/CMakeLists.txt#L71

Also, https://github.com/beman-project/iterator_interface/blob/d6efb25da89a628844bae590e3ceea7245a73bca/include/beman/iterator_interface/detail/stl_interfaces/config.hpp has feature checks, so the config won't describe a compiled artifact. This is, of course, why building everything consistently within a distro is a good idea, but it can be a subtle source of bugs for shipped binaries.

@partouf
Copy link
Contributor

partouf commented Nov 12, 2024

I'm looking at a (slightly complicated) example https://github.com/kokkos/kokkos/blob/7ff4042fd2dc1d1fe6ae280179fc693ad6dac6ac/cmake/kokkos_install.cmake#L51

and they do it with
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/KokkosCore_config.h DESTINATION ${KOKKOS_HEADER_DIR})

the generated config header might be written to CMAKE_CURRENT_BINARY_DIR?

@partouf
Copy link
Contributor

partouf commented Nov 12, 2024

Ok it's just this:

install(FILES ${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/beman/iterator_interface)

add to bottom of the root CMakeLists.txt

@neatudarius
Copy link
Member Author

#24 merged, @partouf , can you try to redeploy? thanks a lot!

@partouf
Copy link
Contributor

partouf commented Nov 12, 2024

Seems to work now https://godbolt.org/z/q4GWT51o6

Note that currently only the following compilers have headers and the lib file associated: https://conan.compiler-explorer.com/libraries_cpp.html?#beman_iterator_interface/main

If you need a different specific compiler for this week let me know so I can manually build them, otherwise they will automatically build over the weekend.

@neatudarius
Copy link
Member Author

neatudarius commented Nov 12, 2024

@partouf , thanks a lot for everything!

It seems that gcc trunk and clang trunk work for x86_64 with Compiler Explorer! (https://godbolt.org/z/Kcq9bbeWW) It should be enough for this week.

We'll revisit our build infrastructure / export type, and we'll come back if changes are required. Now we should be able to wait and test with CE deployments day by day.

image Entries are properly displayed right now.

@changkhothuychung
Copy link

Thanks a lot everyone for your help!

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