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

t8_config.h missing from cmake install manifest #1329

Closed
ackirby88 opened this issue Dec 16, 2024 · 6 comments · May be fixed by #1330
Closed

t8_config.h missing from cmake install manifest #1329

ackirby88 opened this issue Dec 16, 2024 · 6 comments · May be fixed by #1330
Assignees
Labels
priority: high Should be solved as soon as possible

Comments

@ackirby88
Copy link
Contributor

Bug report

For the cmake build and install, t8_config.h is missing from the install manifest, which causes the following error:

t8code/include/t8.h:34:10: fatal error: t8_config.h: No such file or directory
   34 | #include <t8_config.h>

Estimated priority
Priority: high

Additional context
To fix, simply add "t8_config.h" to src/CMakeLists.txt install FILES section (line ~178).

@Davknapp Davknapp self-assigned this Dec 17, 2024
@Davknapp
Copy link
Collaborator

Hello @ackirby88 ,

thank you for you Issue. t8_config.h is a file that is produced by the autotools build-system and therefore should only exists if you are using the autotools system. Have you recently updated to the CMake buildsystem? I tried to reproduce error by linking our png2mesh project with an installation of t8code and was unable to reproduce the error. Did you switch the build-system recently? Maybe it helps to ensure that there are no files used by the old build system in your installation/build-directory.

I hope that this helps you already.

@Davknapp Davknapp added the priority: high Should be solved as soon as possible label Dec 17, 2024
@lukasdreyer
Copy link
Collaborator

Hi @ackirby88,

I might have stumbled upon the same thing recently: cburstedde/libsc#206 (comment)

Do you add t8code by a find_package(T8CODE CONFIG) call?
The error that you run into is because T8_CMAKE_BUILD is not set. It should come from the T8CODE-targets.cmake file.

The error that I ran into recently was because of some of the generators in SC-targets.cmake and p4est-targets.cmake not being evaluated correctly.
Can you check if these two files in your cmake folder in the installed t8code have some lines containing <$<0 or <$<1 in the INTERFACE_LINK_LIBRARIES in set_target_properties?
If so, please check if removing the 0 entries and shortening the 1 entries solves your problem.

You might also need to set all of T8CODE_DIR, P4EST_DIR and SC_DIR to your cmake directory in the installed t8_version.

We are also thinking about providing a t8_config.h with the cmake build, but we have not yet figured out the details.

I am also very interested in your experience in fixing this issue, as we are trying to further improve our cmake build system.

@Davknapp
Copy link
Collaborator

Might be solved by: cburstedde/libsc#212

@ackirby88
Copy link
Contributor Author

It looks like it should be fine, since there is an explicit target_compile_definitions( T8 PUBLIC T8_CMAKE_BUILD ) in the CMakeLists.txt on the top level, which should prevent it from being included in the t8.h file via

#ifndef T8_CMAKE_BUILD
#include <t8_config.h>
#endif

I probably have some old autoconf configuration stuff lying around in the same directory causing issues (did a git pull on a submodule).

I'll close the issue assuming that there isn't an actual bug, but reopen it if I do find an actual problem. Apologies for causing a stir!

@ackirby88
Copy link
Contributor Author

Ah! So you need to fix the CMakeLists.txt file by adding "-D":

target_compile_definitions( T8 PUBLIC -DT8_CMAKE_BUILD )

@ackirby88 ackirby88 reopened this Dec 18, 2024
@Davknapp Davknapp mentioned this issue Dec 18, 2024
15 tasks
@Davknapp
Copy link
Collaborator

Thank you for your suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Should be solved as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants