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

Build ASPECT in 'release mode only' causes external plugins to not compile #6017

Closed
gassmoeller opened this issue Aug 28, 2024 · 4 comments
Closed
Milestone

Comments

@gassmoeller
Copy link
Member

Something is not right with our cmake setup for plugins and the interaction with the different build types for ASPECT.

If I build ASPECT in release mode only I can no longer compile external plugins that try to link to that ASPECT build folder. I see the following error message (path shortened for readability):

.../finite_strain.cc:21:10: fatal error: aspect/material_model/simple.h: No such file or directory
   21 | #include <aspect/material_model/simple.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/finite_strain.dir/build.make:76: CMakeFiles/finite_strain.dir/finite_strain.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/finite_strain.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 75%] Built target finite_strain.release
make: *** [Makefile:136: all] Error 2

If I set up ASPECT in Debug or DebugRelease mode (just running cmake is enough, actually building not required) everything works as expected.

For my problem: When I run make -n I see that the compile/include flags are not set (only showing relevant line):

/usr/bin/c++ -Dfinite_strain_EXPORTS  -fPIC -MD -MT CMakeFiles/finite_strain.dir/finite_strain.cc.o -MF CMakeFiles/finite_strain.dir/finite_strain.cc.o.d -o CMakeFiles/finite_strain.dir/finite_strain.cc.o -c /home/rene/work/models/tests/2024-timo-composition-particles-profiling/main/finite_strain.cc

I have been poking around in here and to me it looks like we create the release target of the plugin with some dependency on the regular target. But the regular target seems to be set up as well, but does not get assigned any flags.

I have found a workaround: If I run make finite_strain.release everything compiles, but make creates the error above. That looks to me like the build is trying to build the target finite_strain (which is set up in my CMakeLists) as well, but that is not set up correctly by the plugin macro.

Files to reproduce with an ASPECT build folder that is only set to RELEASE build type:
CMakeLists.txt
finite_strain.cc.txt

Do we need to modify the plugin macro or the CMakeLists.txt?

@tjhei
Copy link
Member

tjhei commented Aug 28, 2024

ping @bangerth . I am sure you broke it. :-)

@bangerth
Copy link
Contributor

bangerth commented Sep 4, 2024

I'm sure too. I will have to investigate. I think I will have to make the same kind of changes to the plugin cmake scripts as I made to the ASPECT cmake scripts themselves...

@gassmoeller
Copy link
Member Author

Luckily it was an easy fix. See #6070.

@gassmoeller
Copy link
Member Author

Fixed by #6070.

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

3 participants