Test and Bugfix: #include "config.h" with YAC at --prefix
Summary
Compiling a simple dummy program does not work and results in a compilation error, if I install YAC using --prefix=$YAC_INSTALL_DIR. I get the following error:
YAC/examples/toy_multi$ make
mpicc -std=gnu99 -O0 -g -I/home/benjamin/Programming/ebfm_dummy/.venv/include -I/home/benjamin/Software/yaxt/include -I/home/benjamin/Programming/ebfm_dummy/.venv/include -I/home/benjamin/Software/yaxt/include -c toy_multi_cube.c
In file included from /home/benjamin/Programming/ebfm_dummy/.venv/include/yac_utils.h:8,
from toy_multi_cube.c:13:
/home/benjamin/Programming/ebfm_dummy/.venv/include/yac_core.h:23:10: fatal error: config.h: No such file or directory
23 | #include "config.h"
| ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:44: toy_multi_cube.o] Error 1
I used the following to configure the build and install YAC (on Ubuntu 24.04):
cd YAC
mkdir build
../configure CC=mpicc FC=mpif90 --enable-mpi-checks --enable-silent-rules --enable-concurrent-mpi-tests --with-yaxt-root=$YAXT_INSTALL_DIR --prefix=$YAC_INSTALL_DIR CFLAGS="-g -Wall" FCFLAGS="-g -Wall -fimplicit-none" MPI_LAUNCH="mpirun --oversubscribe"
make install
This problem does not occur when running the examples from build -- presumably because config.h exists in this case.
Todos
-
Extend CI to run into this failure; 6d065a71 is sensitive w.r.t the error. -
Implement fix (see below); bbb1c918 provides the fix described above.
Notes
The following change fixes the problem:
diff --git a/src/core/yac_types.h b/src/core/yac_types.h
index e98860b3..a3978e9c 100644
--- a/src/core/yac_types.h
+++ b/src/core/yac_types.h
@@ -9,7 +9,7 @@
#include <stddef.h>
-#include "config.h"
+#include "yac_config.h"
// Global index type for YAC
typedef YAC_INT yac_int;
Related issues
- closes #146 (closed)
Checklist
-
All code changes are covered by unit tests -
Code coverage did not deteriorate -
Code follows Style Guide -
Documentation updated, if necessary -
WIP: Manual running of configure/build jobs was successfull -
Update version info, if changes are worth mentioning ( Developsection indoc/src/version_info.dox, add section if not yet included)
Edited by Benjamin Rodenberg