-
Notifications
You must be signed in to change notification settings - Fork 104
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
Convert IES to C++ #2312
Convert IES to C++ #2312
Conversation
22c1440
to
28ac8e4
Compare
Did you get an error when you didn't have |
Here's the error I get without Consolidate compiler generated dependencies of target ies_std_compare
[ 63%] Building CXX object lib/CMakeFiles/ies_std_compare.dir/analysis/modules/tests/ies_std_compare.cpp.o
[ 64%] Linking CXX executable ies_std_compare
Undefined symbols for architecture x86_64:
"_ies_enkf_init_update", referenced from:
cmp_std_ies(res::es_testdata const&) in ies_std_compare.cpp.o
"_ies_enkf_updateA", referenced from:
cmp_std_ies(res::es_testdata const&) in ies_std_compare.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/ies_std_compare] Error 1
make[1]: *** [lib/CMakeFiles/ies_std_compare.dir/all] Error 2
make: *** [all] Error 2 My understanding is that we load |
You wouldn't be getting linking errors if this was a This particular error occurs because the function is declared with ert/libres/lib/analysis/modules/ies_enkf.h Lines 28 to 36 in 691316d
|
Otherwise this PR looks good. |
I tried removing |
eee6d57
to
8d7ffed
Compare
matrix_type *dObs, // Actual observations (not used) | ||
matrix_type *Ein, // Ensemble of observation perturbations | ||
matrix_type *Din, // (d+E-Y) Ensemble of perturbed observations - Y | ||
matrix_type *A, // Updated ensemble A retured to ERT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in comment
.freef = ies_enkf_data_free, | ||
.has_var = ies_enkf_has_var, | ||
.alloc = ies_enkf_data_alloc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these changing place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the C++ compiler complains that they are not in the same order as defined in analysis_table.hpp
.
C-compiler did not care.
bdb7a62
to
749eb6f
Compare
Issue
Resolves #2310
Approach
I wrapped all function in
ies_enkf.cpp
inextern C
to makedlsym
work.Is there a better way?
Other than that, I had to do a few ´static_casts`.