Errors and undefined symbols when generating model with make_dynamic_model.sh / limpet_fe
Summary
make_dynamic_model.sh fails with errors, does not seem to generate everything for "CPU" target.
What version of openCARP are you using?
This is on the latest 83f67f9a
On v13.0 it fails as well with the same first error (macro not defined properly).
That can be manually fixed on v13 but ultimately bench
fails nonetheless, by trying to run it in CUDA, even though only CPU code was generated.
So I figured I'd rather try to get it working on the latest commit, but let me know if v13 makes more sense.
What operating system and processor architecture are you using?
OS: CentOS Stream release 8 (Linux 4.18.0-348.el8.x86_64)
CPU: AMD EPYC 7H12 64 cores (x2) ZEN v2
Steps to reproduce
- Compile and install openCARP
- Try to run
make_dynamic_model.sh
(e.g. onmy_MBRDR.model
from the experiment or any other included .model file)
What is the current bug behavior?
Output:
% make_dynamic_model.sh my_MBRDR
appending .model to input model name..
using model name: my_MBRDR.model
/opt/opencarp/v13.83f67f9a/share/openCARP/physics/limpet/src/python/limpet_fe.py my_MBRDR.model /opt/opencarp/v13.83f67f9a/share/openCARP/physics/limpet/models/imp_list.txt .
/opt/opencarp/v13.83f67f9a/share/openCARP/physics/limpet/src/python/make_dynamic_model.py --compiler=/opt/openmpi/v4.1.5/bin/mpicc --cflags=-fPIC -shared -std=c++14 -lm -I/opt/opencarp/v13.83f67f9a/share/openCARP/physics/limpet/src -I/opt/opencarp/v13.83f67f9a/share/openCARP/_build/physics/limpet -I/opt/opencarp/v13.83f67f9a/share/openCARP/_build/simulator -I/opt/opencarp/v13.83f67f9a/share/openCARP/numerics -I/opt/opencarp/v13.83f67f9a/share/openCARP/simulator -I/opt/opencarp/v13.83f67f9a/share/openCARP/fem -I/opt/opencarp/v13.83f67f9a/share/openCARP/fem/slimfem/src -I/opt/opencarp/v13.83f67f9a/share/openCARP/param/include -I/opt/petsc/v3.19.4-ompi-aocc-aocl/include -I/opt/petsc/v3.19.4-ompi-aocc-aocl//include -I/opt/opencarp/v13.83f67f9a/share/openCARP/../../lib/petsc/include -I/opt/opencarp/v13.83f67f9a/share/openCARP/../../lib/openmpi/include --dynamic_prefix= my_MBRDR
Dynamic model generator
Generating: my_MBRDR -> /home/wuelfers/test2/test2/my_MBRDR_dyn.cc
/opt/openmpi/v4.1.5/bin/mpicc -fPIC -shared -std=c++14 -lm -I/opt/opencarp/v13.83f67f9a/share/openCARP/physics/limpet/src -I/opt/opencarp/v13.83f67f9a/share/openCARP/_build/physics/limpet -I/opt/opencarp/v13.83f67f9a/share/openCARP/_build/simulator -I/opt/opencarp/v13.83f67f9a/share/openCARP/numerics -I/opt/opencarp/v13.83f67f9a/share/openCARP/simulator -I/opt/opencarp/v13.83f67f9a/share/openCARP/fem -I/opt/opencarp/v13.83f67f9a/share/openCARP/fem/slimfem/src -I/opt/opencarp/v13.83f67f9a/share/openCARP/param/include -I/opt/petsc/v3.19.4-ompi-aocc-aocl/include -I/opt/petsc/v3.19.4-ompi-aocc-aocl//include -I/opt/opencarp/v13.83f67f9a/share/openCARP/../../lib/petsc/include -I/opt/opencarp/v13.83f67f9a/share/openCARP/../../lib/openmpi/include -I/home/wuelfers/test2/test2 -o /home/wuelfers/test2/test2/my_MBRDR.so /home/wuelfers/test2/test2/my_MBRDR.cc /home/wuelfers/test2/test2/my_MBRDR_dyn.cc
/home/wuelfers/test2/test2/my_MBRDR.cc:111:7: error: "Could not generate method my_MBRDRIonType::compute."
# error "Could not generate method my_MBRDRIonType::compute."
^
1 error generated.
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:327:31: error: unknown type name 'ION_IF'
void (*__initialize_params)(ION_IF *) = initialize_params_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:327:43: error: use of undeclared identifier 'initialize_params_my_MBRDR'
void (*__initialize_params)(ION_IF *) = initialize_params_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:328:30: error: unknown type name 'ION_IF'
void (*__construct_tables)(ION_IF *) = construct_tables_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:328:42: error: use of undeclared identifier 'construct_tables_my_MBRDR'
void (*__construct_tables)(ION_IF *) = construct_tables_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:329:21: error: unknown type name 'ION_IF'
void (*__destroy)(ION_IF *) = destroy_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:329:33: error: use of undeclared identifier 'destroy_my_MBRDR'
void (*__destroy)(ION_IF *) = destroy_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:330:27: error: unknown type name 'ION_IF'
void (*__initialize_sv)(ION_IF *, GlobalData_t**) = initialize_sv_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:330:55: error: use of undeclared identifier 'initialize_sv_my_MBRDR'
void (*__initialize_sv)(ION_IF *, GlobalData_t**) = initialize_sv_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:331:31: error: unknown type name 'ION_IF'
void (*__compute)(int, int, ION_IF *, GlobalData_t**) = compute_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:331:59: error: use of undeclared identifier 'compute_my_MBRDR'
void (*__compute)(int, int, ION_IF *, GlobalData_t**) = compute_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:332:23: error: unknown type name 'ION_IF'
void (*__tune)(ION_IF*, const char*) = tune_IMP_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:332:47: error: use of undeclared identifier 'tune_IMP_my_MBRDR'
void (*__tune)(ION_IF*, const char*) = tune_IMP_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:333:35: error: use of undeclared identifier 'print_IMP_parameters_my_MBRDR'
void (*__print_params)() = print_IMP_parameters_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:334:27: error: unknown type name 'ION_IF'
int (*__read_svs)(ION_IF*, FILE*) = read_IIF_svs_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:334:45: error: use of undeclared identifier 'read_IIF_svs_my_MBRDR'
int (*__read_svs)(ION_IF*, FILE*) = read_IIF_svs_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:335:28: error: unknown type name 'ION_IF'
int (*__write_svs)(ION_IF*, FILE*, int) = write_IIF_svs_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:335:51: error: use of undeclared identifier 'write_IIF_svs_my_MBRDR'
int (*__write_svs)(ION_IF*, FILE*, int) = write_IIF_svs_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:336:32: error: unknown type name 'ION_TYPE'
SVgetfcn (*__get_sv_offset)(ION_TYPE, const char*, int*, int*) = get_sv_offset_my_MBRDR;
^
/home/wuelfers/test2/test2/my_MBRDR_dyn.cc:336:69: error: use of undeclared identifier 'get_sv_offset_my_MBRDR'
SVgetfcn (*__get_sv_offset)(ION_TYPE, const char*, int*, int*) = get_sv_offset_my_MBRDR;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
The very first error can be fixed by manually adding #define MY_MBRDR_CPU_GENERATED
to my_MBRDR.h
but that does not solve the rest.
Paths all seem to be set correctly, compilers are fine. But e.g. symbols ION_IF
and ION_TYPE
are not defined in any of the headers in the include paths.
The weirdest thing is, the model generation with the exact same paths / compilers seems to have worked when compiling openCARP from source (using CMake). I'm also not sure how to maybe set a "generation target" (CPU?) for limpet_fe.py
. There doesn't seem to be any special logic in the CMake files.
What is the expected correct behavior?
Successful compilation :)
Relevant logs and/or screenshots
see above.
Possible fixes
Not sure. First thing is that it does not define the MY_MBRDR_CPU_GENERATED
macro. But then?