ornladios / ADIOS2

Next generation of ADIOS developed in the Exascale Computing Program
https://adios2.readthedocs.io/en/latest/index.html
Apache License 2.0
271 stars 126 forks source link

Missing symbol in Fortran library #2191

Closed kshitij-v-mehta closed 4 years ago

kshitij-v-mehta commented 4 years ago

The symbol __adios2_adios_init_mod_NMOD_adios2_init_comm required to compile applications such as SPECFEM is missing from the Fortran adios2 library installation.

Machine: Summit Compiler: XL/16.1.1-5

nm shows that the symbol is missing.

nm lib64/libadios2_fortran.so.2.5.0 | grep -i adios2_init
0000000000016160 t 00000017.plt_call.__adios2_adios_init_mod_NMOD_adios2_init_config_serial
0000000000016200 t 00000017.plt_call.adios2_init_config_glue_serial
0000000000016100 t 00000017.plt_call.adios2_init_config_serial_f2c
000000000002a500 T __adios2_adios_init_mod_NMOD_adios2_init_config_debug_serial
000000000002a580 T __adios2_adios_init_mod_NMOD_adios2_init_config_serial
000000000002a680 T __adios2_adios_init_mod_NMOD_adios2_init_debug_serial
000000000002a700 T __adios2_adios_init_mod_NMOD_adios2_init_serial
                 U adios2_init_config_glue_serial
00000000000166c8 T adios2_init_config_serial_f2c
0000000000016740 T adios2_init_serial_f2c

This issue was not present for ADIOS2 v2.5.0.

chuckatkins commented 4 years ago

Are you using adios from cmake or from a makefile?

kshitij-v-mehta commented 4 years ago

@pnorbert Could you answer this, as I was using your build?

pnorbert commented 4 years ago

Never mind - wrong answer. ADIOS of course was built with cmake but the specfem3d application is built with makefiles.

cmake

summit:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl $ . ../runconf
USE_MPI=ON
Configure on Summit for xl env. MPI = ON  use external packages = true
Compiler settings: -DCMAKE_CXX_COMPILER=/sw/summit/xl/16.1.1-5/xlC/16.1.1/bin/xlc++_r -DCMAKE_C_COMPILER=/sw/summit/xl/16.1.1-5/xlC/16.1.1/bin/xlc_r -DCMAKE_Fortran_COMPILER=/sw/summit/xl/16.1.1-5/xlf/16.1.1/bin/xlf2008_r
cmake -DCMAKE_INSTALL_PREFIX=/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install -DCMAKE_CXX_COMPILER=/sw/summit/xl/16.1.1-5/xlC/16.1.1/bin/xlc++_r -DCMAKE_C_COMPILER=/sw/summit/xl/16.1.1-5/xlC/16.1.1/bin/xlc_r -DCMAKE_Fortran_COMPILER=/sw/summit/xl/16.1.1-5/xlf/16.1.1/bin/xlf2008_r -DBUILD_SHARED_LIBS=ON -DADIOS2_USE_MPI=ON -DADIOS2_USE_Fortran=ON -DADIOS2_BUILD_EXAMPLES_EXPERIMENTAL=OFF -DCMAKE_BUILD_TYPE=Release -DADIOS2_BUILD_TESTING=OFF -DADIOS2_USE_DataMan=OFF -DADIOS2_USE_Python=OFF -DADIOS2_USE_HDF5=OFF ..
pnorbert commented 4 years ago

@kshitij-v-mehta Are you using -f -m options for specfem3d parallel build? This is a makefile build using the adios2-config script isn't it?

summit:pnorbert@login1:/ccs/proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl $ ./install/bin/adios2-config -f -m
-WF,-DADIOS2_USE_MPI -WF, -I/autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install/include/adios2/fortran -Wl,-rpath,/autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install/lib64 /autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install/lib64/libadios2_fortran_mpi.so.2.5.0 /autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install/lib64/libadios2_fortran.so.2.5.0 -Wl,-rpath-link,/autofs/nccs-svm1_proj/e2e/pnorbert/ADIOS/ADIOS2/build.summit.master.xl/install/lib64 
kshitij-v-mehta commented 4 years ago

Yes, this is a Makefile build. I am not using -f -m. Let me try that.

kshitij-v-mehta commented 4 years ago

None of the fortran .so files in the installation have the required symbol.

nm lib64/libadios2_fortran* | grep -i init_comm

returns empty.

bradking commented 4 years ago

adios2_init_comm is not meant to be used by application code as a public API. It is an implementation detail for the main adios2_init generic procedure's signature that accepts a communicator. One can see the definition of the generic procedure in ADIOS2 2.5.0 here. The adios2_init_comm symbol was renamed to adios2_init_mpi by commit cf1f9858a9c2e6de283fc67f5ed9792fb7b6c02d from #1994, but both names are just implementation details for the public-facing adios2_init generic procedure.

The SPECFEM application should be calling the public adios2_init generic procedure instead. The compiler will automatically pick the matching implementation symbol for the ADIOS2 version in use.

kshitij-v-mehta commented 4 years ago

I found a bug in my configure script which was causing this issue. Thanks for your help. I am now able to build the code successfully without encountering this error.