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

Use target link library instead of macro #394

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jh66637
Copy link
Contributor

@jh66637 jh66637 commented Mar 23, 2023

This introduces the new way how to link against deal.II.

@jh66637 jh66637 changed the title [WIP] use target link library instead of macro Use target link library instead of macro Mar 23, 2023
@nfehn
Copy link
Member

nfehn commented Mar 24, 2023

@jh66637 Could you explain how/whether this is related to dealii/dealii#14962?

@jh66637
Copy link
Contributor Author

jh66637 commented Mar 24, 2023

This is somewhat independent. With the fix in dealii/dealii#14962 everything should work again. While we need the CMake macro for the tests, we do not necessarily need it for linking the executables. Just using target_link_libraries() is the modern way how to use CMake. This way we can also use the keywords under discussion independent of the macro in deal.II, so I would consider it to be more stable.

@@ -37,6 +37,8 @@ FFTW=$WORKING_DIRECTORY/fftw/install
LIKWID=$WORKING_DIRECTORY/likwid/install

cmake \
-D CMAKE_BUILD_TYPE="DebugRelease" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the meaning of DebugRelease here? In the CMakeLists.txt file we have ADD_CUSTOM_TARGET where we can switch between debug and release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot about the custom target.

@@ -37,6 +37,8 @@ FFTW=$WORKING_DIRECTORY/fftw/install
LIKWID=$WORKING_DIRECTORY/likwid/install

cmake \
-D CMAKE_BUILD_TYPE="DebugRelease" \
-D CMAKE_C_FLAGS="-march=native -Wno-array-bounds" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you write C, while you write CXX below for supermuc-ng/config_exadg.sh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to the deal.II setup script. I suppose CXX should work as well. These lines of code become relevant since the deal.II macro does not take care about it anymore.

@@ -25,7 +25,7 @@
#
#########################################################################

CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has anyone concerns regarding version 3.16? Is this decision final on the deal.II side?

@@ -28,8 +28,6 @@
MACRO(EXADG_PICKUP_EXE FILE_NAME TARGET_NAME EXE_NAME)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like EXE_NAME is no longer used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is no need anymore. I have to remove it from the interface.

@nfehn
Copy link
Member

nfehn commented Mar 27, 2023

Thanks for improving/simplying cmake content in ExaDG. For me it looks like the cmake flags and the changes in CMakeLists.txt (and the macro) are somewhat independent changes that would optimally be realized as separate PRs.

@jh66637
Copy link
Contributor Author

jh66637 commented Mar 27, 2023

This was supposed to be a quick fix for the failing pipeline. Since dealii/dealii#14962 got merged, I think this is not urgent anymore and thus, I will continue here when I find the time (probably not soon).

@jh66637
Copy link
Contributor Author

jh66637 commented Mar 29, 2023

@nfehn I will split this PR into separate PRs. As mentioned, this is not urgent anymore since the failing pipeline was fixed by deal.II. I still think this is the way to go. I am converting this PR to a draft in the meantime such that I have a reminder to do this. I hope I will find the time soon.

@jh66637 jh66637 marked this pull request as draft March 29, 2023 11:30
@nfehn
Copy link
Member

nfehn commented May 22, 2023

@jh66637 is this PR still work planned for the future, or is this topic already outdated?

@jh66637
Copy link
Contributor Author

jh66637 commented May 22, 2023

I still think we should switch to the new interface. But since currently everything is working using the CMake macros from deal.II, this is not high priority for me.

@nfehn
Copy link
Member

nfehn commented Sep 26, 2023

Would it now make sense to continue with this PR?

@jh66637
Copy link
Contributor Author

jh66637 commented Sep 26, 2023

Probably yes, since the changes in the build system are finalized in deal.II 9.5. There are some more pressing topics on my table but I will do this! I'll ping you when I found the time.

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

Successfully merging this pull request may close these issues.

None yet

2 participants