ADIOS 2.5.0: Build issue with PGI on Summit
Created by: dqwu
When building ADIOS 2.5.0 on Summit, PGI compiler has build errors from some tests. XL and GCC compilers work fine.
Steps to reproduce:
module load pgi
module load cmake
wget https://github.com/ornladios/ADIOS2/archive/v2.5.0.tar.gz
tar zxf v2.5.0.tar.gz
cd ADIOS2-2.5.0
mkdir build
cd build
CC=mpicc CXX=mpicxx FC=mpif90 cmake -DCMAKE_INSTALL_PREFIX=path/to/adios2/installation -DBUILD_SHARED_LIBS=OFF -DADIOS2_USE_SST=OFF ..
make -j16
The output shows some build errors from two tests:
...
[ 80%] Linking CXX executable ../../../../bin/Test.Engine.BP.WriteReadBlockInfo
/usr/lib64/crt1.o:(.rodata+0x8): undefined reference to `main'
/usr/bin/ld: link errors found, deleting executable `../../../../bin/TestCommonWrite_f'
/usr/bin/sha1sum: ../../../../bin/TestCommonWrite_f: No such file or directory
make[2]: *** [bin/TestCommonWrite_f] Error 2
make[1]: *** [testing/adios2/engine/staging-common/CMakeFiles/TestCommonWrite_f.dir/all] Error 2
...
make[2]: *** [bin/TestCommonRead_f] Error 2
make[1]: *** [testing/adios2/engine/staging-common/CMakeFiles/TestCommonRead_f.dir/all] Error 2
...
@jayeshkrishna has proposed a possible fix that works: Edit testing/adios2/engine/staging-common/CMakeLists.txt (insert two new lines at line 62 and 63 to set LINKER_LANGUAGE to Fortran):
add_executable(TestCommonWrite_f TestCommonWriteF.F90 $<TARGET_OBJECTS:TestCommonData_f>)
add_executable(TestCommonRead_f TestCommonReadF.F90 $<TARGET_OBJECTS:TestCommonData_f>)
set_property(TARGET TestCommonWrite_f PROPERTY LINKER_LANGUAGE Fortran)
set_property(TARGET TestCommonRead_f PROPERTY LINKER_LANGUAGE Fortran)
target_link_libraries(TestCommonWrite_f adios2_f)
target_link_libraries(TestCommonRead_f adios2_f)
With this fix, there are still some build errors encountered:
...
[ 84%] Linking CXX executable ../../../../bin/TestCommonWriteLocal
/usr/lib64/crt1.o:(.rodata+0x8): undefined reference to `main'
...
make[2]: *** [bin/Test.Bindings.Fortran.Adios2BindingsFortranIO] Error 2
make[1]: *** [testing/adios2/bindings/fortran/CMakeFiles/Test.Bindings.Fortran.Adios2BindingsFortranIO.dir/all] Error 2
...
Similarly, we can edit testing/adios2/bindings/fortran/CMakeLists.txt (insert a new line at line 10 to set LINKER_LANGUAGE to Fortran)
add_executable(${tgt} Test${testname}.F90)
set_property(TARGET ${tgt} PROPERTY LINKER_LANGUAGE Fortran)
target_link_libraries(${tgt} adios2_f)