open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.14k stars 859 forks source link

Compiling with AOCC (Clang-9) #8467

Open adrianjhpc opened 3 years ago

adrianjhpc commented 3 years ago

Background information

What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)

OpenMPI v4.1.0 tar file from the website

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

From source tarball

Please describe the system on which you are running


Details of the problem

Attempting to build OpenMPI 4.1.0 with the AMD compilers on a Cray EX system fails with errors associated with the libtool created/configured during the build process.

Configuration (with something like this:

../configure --prefix=/install/lcoation/ --with-ofi=/opt/cray/libfabric/1.11.0.0.233 --with-ucx=/opt/cray/cray-ucx/2.6.0-3/ucx CC=cc CXX=CC FC=ftn LDFLAGS=-L/lib/numa/location

) works fine, but at build time errors like this occur:

clang-9: error: unknown argument: '-soname' clang-9: error: no such file or directory: 'libmpi_usempi_ignore_tkr.so.40'

or with a bit more detail:

libtool: link: ftn -shared .libs/mpi-ignore-tkr.o .libs/mpi-ignore-tkr-sizeof.o -rpath /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/opal/.libs -rpath /opt/cray/pe/dsmml/0.1.2/dsmml//lib -rpath /work/z19/shared/adrianj/openmpi/AOCC_Temp/lib -rpath /opt/cray/pe/dsmml/0.1.2/dsmml//lib -L/work/z19/shared/adrianj /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/opal/.libs/libopen-pal.so -lpciaccess -lutil -lz -L/opt/cray/pe/libsci/20.10.1.2/AOCC/2.0/x86_64/lib -L/opt/cray/pe/mpich/8.0.16/ofi/aocc/2.1/lib -L/opt/cray/pe/dsmml/0.1.2/dsmml//lib -L/opt/cray/xpmem/2.2.35-7.0.1.0_1.9__gd50fabf.shasta/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/7 -L/usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/7/../../.. -L/opt/AMD/aocc-compiler-2.1.0/bin/../lib -L/lib -L/usr/lib -lsci_aocc_mpi -lsci_aocc -ldl -lmpi_aocc -lmpifort_aocc -lxpmem /opt/cray/pe/dsmml/0.1.2/dsmml//lib/libdsmml.so -lflangmain -L/opt/AMD/aocc-compiler-2.1.0/lib32 -L/opt/AMD/aocc-compiler-2.1.0/lib -lpgmath -lflang -lflangrti -lompstub -lm -lrt -lpthread -lc -lgcc -lgcc_s -pthread -soname libmpi_usempi_ignore_tkr.so.40 -o .libs/libmpi_usempi_ignore_tkr.so.40.30.0 clang-9: error: unknown argument: '-soname' clang-9: error: no such file or directory: 'libmpi_usempi_ignore_tkr.so.40'

This can be fixed by editing the generated libtool and changing \$wl-soname to \$wl-install_name. This will let the build run on further, but will then fail with errors like this:

clang-9: error: unsupported option '--whole-archive' clang-9: error: unsupported option '--no-whole-archive'

or with a bit more detail:

libtool: link: ftn -shared .libs/abort_f08.o .libs/accumulate_f08.o .libs/add_error_class_f08.o .libs/add_error_code_f08.o .libs/add_error_string_f08.o .libs/aint_add_f08.o .libs/aint_diff_f08.o .libs/allgather_f08.o .libs/allgatherv_f08.o .libs/alloc_mem_f08.o .libs/allreduce_f08.o .libs/alltoall_f08.o .libs/alltoallv_f08.o .libs/alltoallw_f08.o .libs/barrier_f08.o .libs/bcast_f08.o .libs/bsend_f08.o .libs/bsend_init_f08.o .libs/buffer_attach_f08.o .libs/buffer_detach_f08.o .libs/cancel_f08.o .libs/cart_coords_f08.o .libs/cart_create_f08.o .libs/cartdim_get_f08.o .libs/cart_get_f08.o .libs/cart_map_f08.o .libs/cart_rank_f08.o .libs/cart_shift_f08.o .libs/cart_sub_f08.o .libs/close_port_f08.o .libs/comm_accept_f08.o .libs/comm_call_errhandler_f08.o .libs/comm_compare_f08.o .libs/comm_connect_f08.o .libs/comm_create_errhandler_f08.o .libs/comm_create_f08.o .libs/comm_create_group_f08.o .libs/comm_create_keyval_f08.o .libs/comm_delete_attr_f08.o .libs/comm_disconnect_f08.o .libs/comm_dup_f08.o .libs/comm_dup_with_info_f08.o .libs/comm_idup_f08.o .libs/comm_free_f08.o .libs/comm_free_keyval_f08.o .libs/comm_get_attr_f08.o .libs/comm_get_errhandler_f08.o .libs/comm_get_info_f08.o .libs/comm_get_name_f08.o .libs/comm_get_parent_f08.o .libs/comm_group_f08.o .libs/comm_join_f08.o .libs/comm_rank_f08.o .libs/comm_remote_group_f08.o .libs/comm_remote_size_f08.o .libs/comm_set_attr_f08.o .libs/comm_set_errhandler_f08.o .libs/comm_set_info_f08.o .libs/comm_set_name_f08.o .libs/comm_size_f08.o .libs/comm_spawn_f08.o .libs/comm_spawn_multiple_f08.o .libs/comm_split_f08.o .libs/comm_split_type_f08.o .libs/comm_test_inter_f08.o .libs/compare_and_swap_f08.o .libs/dist_graph_create_adjacent_f08.o .libs/dist_graph_create_f08.o .libs/dist_graph_neighbors_count_f08.o .libs/dist_graph_neighbors_f08.o .libs/dims_create_f08.o .libs/errhandler_free_f08.o .libs/error_class_f08.o .libs/error_string_f08.o .libs/exscan_f08.o .libs/f_sync_reg_f08.o .libs/fetch_and_op_f08.o .libs/file_call_errhandler_f08.o .libs/file_close_f08.o .libs/file_create_errhandler_f08.o .libs/file_delete_f08.o .libs/file_get_amode_f08.o .libs/file_get_atomicity_f08.o .libs/file_get_byte_offset_f08.o .libs/file_get_errhandler_f08.o .libs/file_get_group_f08.o .libs/file_get_info_f08.o .libs/file_get_position_f08.o .libs/file_get_position_shared_f08.o .libs/file_get_size_f08.o .libs/file_get_type_extent_f08.o .libs/file_get_view_f08.o .libs/file_iread_at_f08.o .libs/file_iread_f08.o .libs/file_iread_at_all_f08.o .libs/file_iread_all_f08.o .libs/file_iread_shared_f08.o .libs/file_iwrite_at_f08.o .libs/file_iwrite_f08.o .libs/file_iwrite_at_all_f08.o .libs/file_iwrite_all_f08.o .libs/file_iwrite_shared_f08.o .libs/file_open_f08.o .libs/file_preallocate_f08.o .libs/file_read_all_begin_f08.o .libs/file_read_all_end_f08.o .libs/file_read_all_f08.o .libs/file_read_at_all_begin_f08.o .libs/file_read_at_all_end_f08.o .libs/file_read_at_all_f08.o .libs/file_read_at_f08.o .libs/file_read_f08.o .libs/file_read_ordered_begin_f08.o .libs/file_read_ordered_end_f08.o .libs/file_read_ordered_f08.o .libs/file_read_shared_f08.o .libs/file_seek_f08.o .libs/file_seek_shared_f08.o .libs/file_set_atomicity_f08.o .libs/file_set_errhandler_f08.o .libs/file_set_info_f08.o .libs/file_set_size_f08.o .libs/file_set_view_f08.o .libs/file_sync_f08.o .libs/file_write_all_begin_f08.o .libs/file_write_all_end_f08.o .libs/file_write_all_f08.o .libs/file_write_at_all_begin_f08.o .libs/file_write_at_all_end_f08.o .libs/file_write_at_all_f08.o .libs/file_write_at_f08.o .libs/file_write_f08.o .libs/file_write_ordered_begin_f08.o .libs/file_write_ordered_end_f08.o .libs/file_write_ordered_f08.o .libs/file_write_shared_f08.o .libs/finalized_f08.o .libs/finalize_f08.o .libs/free_mem_f08.o .libs/gather_f08.o .libs/gatherv_f08.o .libs/get_accumulate_f08.o .libs/get_address_f08.o .libs/get_count_f08.o .libs/get_elements_f08.o .libs/get_elements_x_f08.o .libs/get_f08.o .libs/get_library_version_f08.o .libs/get_processor_name_f08.o .libs/get_version_f08.o .libs/graph_create_f08.o .libs/graphdims_get_f08.o .libs/graph_get_f08.o .libs/graph_map_f08.o .libs/graph_neighbors_count_f08.o .libs/graph_neighbors_f08.o .libs/grequest_complete_f08.o .libs/grequest_start_f08.o .libs/group_compare_f08.o .libs/group_difference_f08.o .libs/group_excl_f08.o .libs/group_free_f08.o .libs/group_incl_f08.o .libs/group_intersection_f08.o .libs/group_range_excl_f08.o .libs/group_range_incl_f08.o .libs/group_rank_f08.o .libs/group_size_f08.o .libs/group_translate_ranks_f08.o .libs/group_union_f08.o .libs/iallgather_f08.o .libs/iallgatherv_f08.o .libs/iallreduce_f08.o .libs/ialltoall_f08.o .libs/ialltoallv_f08.o .libs/ialltoallw_f08.o .libs/ibarrier_f08.o .libs/ibcast_f08.o .libs/ibsend_f08.o .libs/iexscan_f08.o .libs/igather_f08.o .libs/igatherv_f08.o .libs/improbe_f08.o .libs/imrecv_f08.o .libs/ineighbor_allgather_f08.o .libs/ineighbor_allgatherv_f08.o .libs/ineighbor_alltoall_f08.o .libs/ineighbor_alltoallv_f08.o .libs/ineighbor_alltoallw_f08.o .libs/info_create_f08.o .libs/info_delete_f08.o .libs/info_dup_f08.o .libs/info_free_f08.o .libs/info_get_f08.o .libs/info_get_nkeys_f08.o .libs/info_get_nthkey_f08.o .libs/info_get_valuelen_f08.o .libs/info_set_f08.o .libs/init_f08.o .libs/initialized_f08.o .libs/init_thread_f08.o .libs/intercomm_create_f08.o .libs/intercomm_merge_f08.o .libs/iprobe_f08.o .libs/irecv_f08.o .libs/ireduce_f08.o .libs/ireduce_scatter_f08.o .libs/ireduce_scatter_block_f08.o .libs/irsend_f08.o .libs/iscan_f08.o .libs/iscatter_f08.o .libs/iscatterv_f08.o .libs/isend_f08.o .libs/issend_f08.o .libs/is_thread_main_f08.o .libs/lookup_name_f08.o .libs/mprobe_f08.o .libs/mrecv_f08.o .libs/neighbor_allgather_f08.o .libs/neighbor_allgatherv_f08.o .libs/neighbor_alltoall_f08.o .libs/neighbor_alltoallv_f08.o .libs/neighbor_alltoallw_f08.o .libs/op_commutative_f08.o .libs/op_create_f08.o .libs/open_port_f08.o .libs/op_free_f08.o .libs/pack_external_f08.o .libs/pack_external_size_f08.o .libs/pack_f08.o .libs/pack_size_f08.o .libs/pcontrol_f08.o .libs/probe_f08.o .libs/publish_name_f08.o .libs/put_f08.o .libs/query_thread_f08.o .libs/raccumulate_f08.o .libs/recv_f08.o .libs/recv_init_f08.o .libs/reduce_f08.o .libs/reduce_local_f08.o .libs/reduce_scatter_f08.o .libs/reduce_scatter_block_f08.o .libs/register_datarep_f08.o .libs/request_free_f08.o .libs/request_get_status_f08.o .libs/rget_f08.o .libs/rget_accumulate_f08.o .libs/rput_f08.o .libs/rsend_f08.o .libs/rsend_init_f08.o .libs/scan_f08.o .libs/scatter_f08.o .libs/scatterv_f08.o .libs/send_f08.o .libs/send_init_f08.o .libs/sendrecv_f08.o .libs/sendrecv_replace_f08.o .libs/ssend_f08.o .libs/ssend_init_f08.o .libs/startall_f08.o .libs/start_f08.o .libs/status_set_cancelled_f08.o .libs/status_set_elements_f08.o .libs/status_set_elements_x_f08.o .libs/testall_f08.o .libs/testany_f08.o .libs/test_cancelled_f08.o .libs/test_f08.o .libs/testsome_f08.o .libs/topo_test_f08.o .libs/type_commit_f08.o .libs/type_contiguous_f08.o .libs/type_create_darray_f08.o .libs/type_create_f90_complex_f08.o .libs/type_create_f90_integer_f08.o .libs/type_create_f90_real_f08.o .libs/type_create_hindexed_f08.o .libs/type_create_hvector_f08.o .libs/type_create_indexed_block_f08.o .libs/type_create_hindexed_block_f08.o .libs/type_create_keyval_f08.o .libs/type_create_resized_f08.o .libs/type_create_struct_f08.o .libs/type_create_subarray_f08.o .libs/type_delete_attr_f08.o .libs/type_dup_f08.o .libs/type_free_f08.o .libs/type_free_keyval_f08.o .libs/type_get_attr_f08.o .libs/type_get_contents_f08.o .libs/type_get_envelope_f08.o .libs/type_get_extent_f08.o .libs/type_get_extent_x_f08.o .libs/type_get_name_f08.o .libs/type_get_true_extent_f08.o .libs/type_get_true_extent_x_f08.o .libs/type_indexed_f08.o .libs/type_match_size_f08.o .libs/type_set_attr_f08.o .libs/type_set_name_f08.o .libs/type_size_f08.o .libs/type_size_x_f08.o .libs/type_vector_f08.o .libs/unpack_external_f08.o .libs/unpack_f08.o .libs/unpublish_name_f08.o .libs/waitall_f08.o .libs/waitany_f08.o .libs/wait_f08.o .libs/waitsome_f08.o .libs/win_allocate_f08.o .libs/win_allocate_shared_f08.o .libs/win_attach_f08.o .libs/win_call_errhandler_f08.o .libs/win_complete_f08.o .libs/win_create_dynamic_f08.o .libs/win_create_errhandler_f08.o .libs/win_create_f08.o .libs/win_create_keyval_f08.o .libs/win_delete_attr_f08.o .libs/win_detach_f08.o .libs/win_fence_f08.o .libs/win_flush_f08.o .libs/win_flush_all_f08.o .libs/win_flush_local_f08.o .libs/win_flush_local_all_f08.o .libs/win_free_f08.o .libs/win_free_keyval_f08.o .libs/win_get_attr_f08.o .libs/win_get_errhandler_f08.o .libs/win_get_group_f08.o .libs/win_get_info_f08.o .libs/win_get_name_f08.o .libs/win_lock_f08.o .libs/win_lock_all_f08.o .libs/win_post_f08.o .libs/win_set_attr_f08.o .libs/win_set_errhandler_f08.o .libs/win_set_info_f08.o .libs/win_set_name_f08.o .libs/win_shared_query_f08.o .libs/win_start_f08.o .libs/win_sync_f08.o .libs/win_test_f08.o .libs/win_unlock_f08.o .libs/win_unlock_all_f08.o .libs/win_wait_f08.o profile/.libs/pabort_f08.o profile/.libs/paccumulate_f08.o profile/.libs/padd_error_class_f08.o profile/.libs/padd_error_code_f08.o profile/.libs/padd_error_string_f08.o profile/.libs/paint_add_f08.o profile/.libs/paint_diff_f08.o profile/.libs/pallgather_f08.o profile/.libs/pallgatherv_f08.o profile/.libs/palloc_mem_f08.o profile/.libs/pallreduce_f08.o profile/.libs/palltoall_f08.o profile/.libs/palltoallv_f08.o profile/.libs/palltoallw_f08.o profile/.libs/pbarrier_f08.o profile/.libs/pbcast_f08.o profile/.libs/pbsend_f08.o profile/.libs/pbsend_init_f08.o profile/.libs/pbuffer_attach_f08.o profile/.libs/pbuffer_detach_f08.o profile/.libs/pcancel_f08.o profile/.libs/pcart_coords_f08.o profile/.libs/pcart_create_f08.o profile/.libs/pcartdim_get_f08.o profile/.libs/pcart_get_f08.o profile/.libs/pcart_map_f08.o profile/.libs/pcart_rank_f08.o profile/.libs/pcart_shift_f08.o profile/.libs/pcart_sub_f08.o profile/.libs/pclose_port_f08.o profile/.libs/pcomm_accept_f08.o profile/.libs/pcomm_call_errhandler_f08.o profile/.libs/pcomm_compare_f08.o profile/.libs/pcomm_connect_f08.o profile/.libs/pcomm_create_errhandler_f08.o profile/.libs/pcomm_create_f08.o profile/.libs/pcomm_create_group_f08.o profile/.libs/pcomm_create_keyval_f08.o profile/.libs/pcomm_delete_attr_f08.o profile/.libs/pcomm_disconnect_f08.o profile/.libs/pcomm_dup_f08.o profile/.libs/pcomm_dup_with_info_f08.o profile/.libs/pcomm_idup_f08.o profile/.libs/pcomm_free_f08.o profile/.libs/pcomm_free_keyval_f08.o profile/.libs/pcomm_get_attr_f08.o profile/.libs/pcomm_get_errhandler_f08.o profile/.libs/pcomm_get_info_f08.o profile/.libs/pcomm_get_name_f08.o profile/.libs/pcomm_get_parent_f08.o profile/.libs/pcomm_group_f08.o profile/.libs/pcomm_join_f08.o profile/.libs/pcomm_rank_f08.o profile/.libs/pcomm_remote_group_f08.o profile/.libs/pcomm_remote_size_f08.o profile/.libs/pcomm_set_attr_f08.o profile/.libs/pcomm_set_errhandler_f08.o profile/.libs/pcomm_set_info_f08.o profile/.libs/pcomm_set_name_f08.o profile/.libs/pcomm_size_f08.o profile/.libs/pcomm_spawn_f08.o profile/.libs/pcomm_spawn_multiple_f08.o profile/.libs/pcomm_split_f08.o profile/.libs/pcomm_split_type_f08.o profile/.libs/pcomm_test_inter_f08.o profile/.libs/pcompare_and_swap_f08.o profile/.libs/pdims_create_f08.o profile/.libs/pdist_graph_create_adjacent_f08.o profile/.libs/pdist_graph_create_f08.o profile/.libs/pdist_graph_neighbors_count_f08.o profile/.libs/pdist_graph_neighbors_f08.o profile/.libs/perrhandler_free_f08.o profile/.libs/perror_class_f08.o profile/.libs/perror_string_f08.o profile/.libs/pexscan_f08.o profile/.libs/pf_sync_reg_f08.o profile/.libs/pfetch_and_op_f08.o profile/.libs/pfile_call_errhandler_f08.o profile/.libs/pfile_close_f08.o profile/.libs/pfile_create_errhandler_f08.o profile/.libs/pfile_delete_f08.o profile/.libs/pfile_get_amode_f08.o profile/.libs/pfile_get_atomicity_f08.o profile/.libs/pfile_get_byte_offset_f08.o profile/.libs/pfile_get_errhandler_f08.o profile/.libs/pfile_get_group_f08.o profile/.libs/pfile_get_info_f08.o profile/.libs/pfile_get_position_f08.o profile/.libs/pfile_get_position_shared_f08.o profile/.libs/pfile_get_size_f08.o profile/.libs/pfile_get_type_extent_f08.o profile/.libs/pfile_get_view_f08.o profile/.libs/pfile_iread_at_f08.o profile/.libs/pfile_iread_f08.o profile/.libs/pfile_iread_at_all_f08.o profile/.libs/pfile_iread_all_f08.o profile/.libs/pfile_iread_shared_f08.o profile/.libs/pfile_iwrite_at_f08.o profile/.libs/pfile_iwrite_f08.o profile/.libs/pfile_iwrite_at_all_f08.o profile/.libs/pfile_iwrite_all_f08.o profile/.libs/pfile_iwrite_shared_f08.o profile/.libs/pfile_open_f08.o profile/.libs/pfile_preallocate_f08.o profile/.libs/pfile_read_all_begin_f08.o profile/.libs/pfile_read_all_end_f08.o profile/.libs/pfile_read_all_f08.o profile/.libs/pfile_read_at_all_begin_f08.o profile/.libs/pfile_read_at_all_end_f08.o profile/.libs/pfile_read_at_all_f08.o profile/.libs/pfile_read_at_f08.o profile/.libs/pfile_read_f08.o profile/.libs/pfile_read_ordered_begin_f08.o profile/.libs/pfile_read_ordered_end_f08.o profile/.libs/pfile_read_ordered_f08.o profile/.libs/pfile_read_shared_f08.o profile/.libs/pfile_seek_f08.o profile/.libs/pfile_seek_shared_f08.o profile/.libs/pfile_set_atomicity_f08.o profile/.libs/pfile_set_errhandler_f08.o profile/.libs/pfile_set_info_f08.o profile/.libs/pfile_set_size_f08.o profile/.libs/pfile_set_view_f08.o profile/.libs/pfile_sync_f08.o profile/.libs/pfile_write_all_begin_f08.o profile/.libs/pfile_write_all_end_f08.o profile/.libs/pfile_write_all_f08.o profile/.libs/pfile_write_at_all_begin_f08.o profile/.libs/pfile_write_at_all_end_f08.o profile/.libs/pfile_write_at_all_f08.o profile/.libs/pfile_write_at_f08.o profile/.libs/pfile_write_f08.o profile/.libs/pfile_write_ordered_begin_f08.o profile/.libs/pfile_write_ordered_end_f08.o profile/.libs/pfile_write_ordered_f08.o profile/.libs/pfile_write_shared_f08.o profile/.libs/pfinalized_f08.o profile/.libs/pfinalize_f08.o profile/.libs/pfree_mem_f08.o profile/.libs/pgather_f08.o profile/.libs/pgatherv_f08.o profile/.libs/pget_accumulate_f08.o profile/.libs/pget_address_f08.o profile/.libs/pget_count_f08.o profile/.libs/pget_elements_f08.o profile/.libs/pget_elements_x_f08.o profile/.libs/pget_f08.o profile/.libs/pget_library_version_f08.o profile/.libs/pget_processor_name_f08.o profile/.libs/pget_version_f08.o profile/.libs/pgraph_create_f08.o profile/.libs/pgraphdims_get_f08.o profile/.libs/pgraph_get_f08.o profile/.libs/pgraph_map_f08.o profile/.libs/pgraph_neighbors_count_f08.o profile/.libs/pgraph_neighbors_f08.o profile/.libs/pgrequest_complete_f08.o profile/.libs/pgrequest_start_f08.o profile/.libs/pgroup_compare_f08.o profile/.libs/pgroup_difference_f08.o profile/.libs/pgroup_excl_f08.o profile/.libs/pgroup_free_f08.o profile/.libs/pgroup_incl_f08.o profile/.libs/pgroup_intersection_f08.o profile/.libs/pgroup_range_excl_f08.o profile/.libs/pgroup_range_incl_f08.o profile/.libs/pgroup_rank_f08.o profile/.libs/pgroup_size_f08.o profile/.libs/pgroup_translate_ranks_f08.o profile/.libs/pgroup_union_f08.o profile/.libs/piallgather_f08.o profile/.libs/piallgatherv_f08.o profile/.libs/piallreduce_f08.o profile/.libs/pialltoall_f08.o profile/.libs/pialltoallv_f08.o profile/.libs/pialltoallw_f08.o profile/.libs/pibarrier_f08.o profile/.libs/pibcast_f08.o profile/.libs/pibsend_f08.o profile/.libs/pigather_f08.o profile/.libs/pigatherv_f08.o profile/.libs/piexscan_f08.o profile/.libs/pimprobe_f08.o profile/.libs/pimrecv_f08.o profile/.libs/pineighbor_allgather_f08.o profile/.libs/pineighbor_allgatherv_f08.o profile/.libs/pineighbor_alltoall_f08.o profile/.libs/pineighbor_alltoallv_f08.o profile/.libs/pineighbor_alltoallw_f08.o profile/.libs/pinfo_create_f08.o profile/.libs/pinfo_delete_f08.o profile/.libs/pinfo_dup_f08.o profile/.libs/pinfo_free_f08.o profile/.libs/pinfo_get_f08.o profile/.libs/pinfo_get_nkeys_f08.o profile/.libs/pinfo_get_nthkey_f08.o profile/.libs/pinfo_get_valuelen_f08.o profile/.libs/pinfo_set_f08.o profile/.libs/pinit_f08.o profile/.libs/pinitialized_f08.o profile/.libs/pinit_thread_f08.o profile/.libs/pintercomm_create_f08.o profile/.libs/pintercomm_merge_f08.o profile/.libs/piprobe_f08.o profile/.libs/pirecv_f08.o profile/.libs/pireduce_f08.o profile/.libs/pireduce_scatter_f08.o profile/.libs/pireduce_scatter_block_f08.o profile/.libs/pirsend_f08.o profile/.libs/piscan_f08.o profile/.libs/piscatter_f08.o profile/.libs/piscatterv_f08.o profile/.libs/pisend_f08.o profile/.libs/pissend_f08.o profile/.libs/pis_thread_main_f08.o profile/.libs/plookup_name_f08.o profile/.libs/pmprobe_f08.o profile/.libs/pmrecv_f08.o profile/.libs/pneighbor_allgather_f08.o profile/.libs/pneighbor_allgatherv_f08.o profile/.libs/pneighbor_alltoall_f08.o profile/.libs/pneighbor_alltoallv_f08.o profile/.libs/pneighbor_alltoallw_f08.o profile/.libs/pop_commutative_f08.o profile/.libs/pop_create_f08.o profile/.libs/popen_port_f08.o profile/.libs/pop_free_f08.o profile/.libs/ppack_external_f08.o profile/.libs/ppack_external_size_f08.o profile/.libs/ppack_f08.o profile/.libs/ppack_size_f08.o profile/.libs/ppcontrol_f08.o profile/.libs/pprobe_f08.o profile/.libs/ppublish_name_f08.o profile/.libs/pput_f08.o profile/.libs/pquery_thread_f08.o profile/.libs/praccumulate_f08.o profile/.libs/precv_f08.o profile/.libs/precv_init_f08.o profile/.libs/preduce_f08.o profile/.libs/preduce_local_f08.o profile/.libs/preduce_scatter_f08.o profile/.libs/preduce_scatter_block_f08.o profile/.libs/pregister_datarep_f08.o profile/.libs/prequest_free_f08.o profile/.libs/prequest_get_status_f08.o profile/.libs/prget_f08.o profile/.libs/prget_accumulate_f08.o profile/.libs/prput_f08.o profile/.libs/prsend_f08.o profile/.libs/prsend_init_f08.o profile/.libs/pscan_f08.o profile/.libs/pscatter_f08.o profile/.libs/pscatterv_f08.o profile/.libs/psend_f08.o profile/.libs/psend_init_f08.o profile/.libs/psendrecv_f08.o profile/.libs/psendrecv_replace_f08.o profile/.libs/pssend_f08.o profile/.libs/pssend_init_f08.o profile/.libs/pstartall_f08.o profile/.libs/pstart_f08.o profile/.libs/pstatus_set_cancelled_f08.o profile/.libs/pstatus_set_elements_f08.o profile/.libs/pstatus_set_elements_x_f08.o profile/.libs/ptestall_f08.o profile/.libs/ptestany_f08.o profile/.libs/ptest_cancelled_f08.o profile/.libs/ptest_f08.o profile/.libs/ptestsome_f08.o profile/.libs/ptopo_test_f08.o profile/.libs/ptype_commit_f08.o profile/.libs/ptype_contiguous_f08.o profile/.libs/ptype_create_darray_f08.o profile/.libs/ptype_create_f90_complex_f08.o profile/.libs/ptype_create_f90_integer_f08.o profile/.libs/ptype_create_f90_real_f08.o profile/.libs/ptype_create_hindexed_f08.o profile/.libs/ptype_create_hvector_f08.o profile/.libs/ptype_create_indexed_block_f08.o profile/.libs/ptype_create_hindexed_block_f08.o profile/.libs/ptype_create_keyval_f08.o profile/.libs/ptype_create_resized_f08.o profile/.libs/ptype_create_struct_f08.o profile/.libs/ptype_create_subarray_f08.o profile/.libs/ptype_delete_attr_f08.o profile/.libs/ptype_dup_f08.o profile/.libs/ptype_free_f08.o profile/.libs/ptype_free_keyval_f08.o profile/.libs/ptype_get_attr_f08.o profile/.libs/ptype_get_contents_f08.o profile/.libs/ptype_get_envelope_f08.o profile/.libs/ptype_get_extent_f08.o profile/.libs/ptype_get_extent_x_f08.o profile/.libs/ptype_get_name_f08.o profile/.libs/ptype_get_true_extent_f08.o profile/.libs/ptype_get_true_extent_x_f08.o profile/.libs/ptype_indexed_f08.o profile/.libs/ptype_match_size_f08.o profile/.libs/ptype_set_attr_f08.o profile/.libs/ptype_set_name_f08.o profile/.libs/ptype_size_f08.o profile/.libs/ptype_size_x_f08.o profile/.libs/ptype_vector_f08.o profile/.libs/punpack_external_f08.o profile/.libs/punpack_f08.o profile/.libs/punpublish_name_f08.o profile/.libs/pwaitall_f08.o profile/.libs/pwaitany_f08.o profile/.libs/pwait_f08.o profile/.libs/pwaitsome_f08.o profile/.libs/pwin_allocate_f08.o profile/.libs/pwin_allocate_shared_f08.o profile/.libs/pwin_attach_f08.o profile/.libs/pwin_call_errhandler_f08.o profile/.libs/pwin_complete_f08.o profile/.libs/pwin_create_dynamic_f08.o profile/.libs/pwin_create_errhandler_f08.o profile/.libs/pwin_create_f08.o profile/.libs/pwin_create_keyval_f08.o profile/.libs/pwin_delete_attr_f08.o profile/.libs/pwin_detach_f08.o profile/.libs/pwin_fence_f08.o profile/.libs/pwin_flush_f08.o profile/.libs/pwin_flush_all_f08.o profile/.libs/pwin_flush_local_f08.o profile/.libs/pwin_flush_local_all_f08.o profile/.libs/pwin_free_f08.o profile/.libs/pwin_free_keyval_f08.o profile/.libs/pwin_get_attr_f08.o profile/.libs/pwin_get_errhandler_f08.o profile/.libs/pwin_get_group_f08.o profile/.libs/pwin_get_info_f08.o profile/.libs/pwin_get_name_f08.o profile/.libs/pwin_lock_f08.o profile/.libs/pwin_lock_all_f08.o profile/.libs/pwin_post_f08.o profile/.libs/pwin_set_attr_f08.o profile/.libs/pwin_set_errhandler_f08.o profile/.libs/pwin_set_info_f08.o profile/.libs/pwin_set_name_f08.o profile/.libs/pwin_shared_query_f08.o profile/.libs/pwin_start_f08.o profile/.libs/pwin_sync_f08.o profile/.libs/pwin_test_f08.o profile/.libs/pwin_unlock_f08.o profile/.libs/pwin_unlock_all_f08.o profile/.libs/pwin_wait_f08.o .libs/mpi-f08.o .libs/sizeof_f08.o profile/.libs/psizeof_f08.o --whole-archive mod/.libs/libforce_usempif08_internal_modules_to_be_built.a bindings/.libs/libforce_usempif08_internal_bindings_to_be_built.a ../../../../ompi/mpiext/pcollreq/use-mpi-f08/.libs/libmpiext_pcollreq_usempif08.a base/.libs/libusempif08_ccode.a --no-whole-archive -rpath /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/ompi/mpi/fortran/mpif-h/.libs -rpath /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/ompi/.libs -rpath /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/orte/.libs -rpath /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/opal/.libs -rpath /opt/cray/pe/dsmml/0.1.2/dsmml//lib -rpath /work/z19/shared/adrianj/openmpi/AOCC_Temp/lib -rpath /opt/cray/pe/dsmml/0.1.2/dsmml//lib -L/home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/ompi/.libs -L/home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/orte/.libs -L/home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/opal/.libs -L/work/z19/shared/adrianj ../../../../ompi/mpi/fortran/mpif-h/.libs/libmpi_mpifh.so -L/opt/cray/pe/dsmml/0.1.2/dsmml//lib /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/ompi/.libs/libmpi.so ../../../../ompi/.libs/libmpi.so /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/orte/.libs/libopen-rte.so /home2/home/z19/z19/adrianj/openmpi/AOCC/source/temp/openmpi-4.1.0/build/opal/.libs/libopen-pal.so -lpciaccess -lutil -lz -L/opt/cray/pe/libsci/20.10.1.2/AOCC/2.0/x86_64/lib -L/opt/cray/pe/mpich/8.0.16/ofi/aocc/2.1/lib -L/opt/cray/xpmem/2.2.35-7.0.1.0_1.9__gd50fabf.shasta/lib64 -L/usr/lib64/gcc/x86_64-suse-linux/7 -L/usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/7/../../.. -L/opt/AMD/aocc-compiler-2.1.0/bin/../lib -L/lib -L/usr/lib -lsci_aocc_mpi -lsci_aocc -ldl -lmpi_aocc -lmpifort_aocc -lxpmem /opt/cray/pe/dsmml/0.1.2/dsmml//lib/libdsmml.so -lflangmain -L/opt/AMD/aocc-compiler-2.1.0/lib32 -L/opt/AMD/aocc-compiler-2.1.0/lib -lpgmath -lflang -lflangrti -lompstub -lm -lrt -lpthread -lc -lgcc -lgcc_s -pthread -install_name libmpi_usempif08.so.40 -o .libs/libmpi_usempif08.so.40.30.0

This can be fixed by changing a couple of the:

whole_archive_flag_spec="\$wl--whole-archive\$convenience \$ql--no-whole-archive"

into:

whole_archive_flag_spec="\$wl --force-link\$convenience"

In the libtool.

Clearly, these are temporary fixes, I don't have the skill/knowledge at the moment to know where this should be put to make it automatic, and I could be doing the wrong thing, but the above fixes let me get a build to complete.

awlauria commented 3 years ago

I've recently built with clang-9 (not AOCC) and didn't run into this issue. Can you try setting FC to gfortran and see if it reproduces?

adrianjhpc commented 3 years ago

The Cray setup makes it difficult to have two compilers active at the same time.

awlauria commented 3 years ago

Just recompiled from the v4.1 tarball, and I was unable to reproduce with clang + flang.

It looks like the link command was slightly different for me though:

I../../../.. -I../../../.. -version-info 70:0:30 -o libmpi_usempi_ignore_tkr.la -rpath /openmpi-4.1.0/exports/lib mpi-ignore-tkr.lo mpi-ignore-tkr-sizeof.lo /openmpi-4.1.0/opal/libopen-pal.la -lrt -lm -lutil -lz libtool: link: /flang/bin/flang -shared -fPIC -DPIC .libs/mpi-ignore-tkr.o .libs/mpi-ignore-tkr-sizeof.o -Wl,-rpath -Wl,/openmpi-4.1.0/opal/.libs -Wl,-rpath -Wl,/openmpi-4.1.0/exports/lib /openmpi-4.1.0/opal/.libs/libopen-pal.so -ldl -lutil -lz -L/usr/lib/gcc/ppc64le-redhat-linux/8 -L/usr/lib/gcc/ppc64le-redhat-linux/8/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/8/../../.. -L/flang/bin/../lib -L/lib -L/usr/lib -lflangmain -lflang -lflangrti -lpgmath -lompstub -lm -lrt -lpthread -lc -lgcc -lgcc_s -pthread -Wl,-soname -Wl,libmpi_usempi_ignore_tkr.so.40 -o .libs/libmpi_usempi_ignore_tkr.so.40.30.0

the -Wl seems to be missing from yours. Just playing on the command line, this is probably the reason it 'works' in my env.

Can you check the generated libtool file and see what it has on this line:

# How to pass a linker flag through the compiler.
wl="-Wl,"

Some versions for comparison:

$. libtool --version
libtool (GNU libtool) 2.4.6
Written by Gordon Matzigkeit, 1996
$. configure --version
Open MPI configure 4.1.0
generated by GNU Autoconf 2.69
awlauria commented 3 years ago

For me, if I set Wl="" in libtool and try a rebuild, it fails for me with a similar error:

libtool: link: clang -shared -fPIC -DPIC class/.libs/opal_bitmap.o class/.libs/opal_free_list.o class/.libs/opal_hash_table.o class/.libs/opal_hotel.o class/.libs/opal_tree.o class/.libs/opal_list.o class/.libs/opal_object.o class/.libs/opal_graph.o class/.libs/opal_lifo.o class/.libs/opal_fifo.o class/.libs/opal_pointer_array.o class/.libs/opal_value_array.o class/.libs/opal_ring_buffer.o class/.libs/opal_rb_tree.o class/.libs/opal_interval_tree.o memoryhooks/.libs/memory.o runtime/.libs/opal_progress.o runtime/.libs/opal_finalize.o runtime/.libs/opal_init.o runtime/.libs/opal_params.o runtime/.libs/opal_cr.o runtime/.libs/opal_info_support.o runtime/.libs/opal_progress_threads.o threads/.libs/condition.o threads/.libs/mutex.o threads/.libs/thread.o threads/.libs/wait_sync.o dss/.libs/dss_internal_functions.o dss/.libs/dss_compare.o dss/.libs/dss_copy.o dss/.libs/dss_dump.o dss/.libs/dss_load_unload.o dss/.libs/dss_lookup.o dss/.libs/dss_pack.o dss/.libs/dss_peek.o dss/.libs/dss_print.o dss/.libs/dss_register.o dss/.libs/dss_unpack.o dss/.libs/dss_open_close.o --whole-archive datatype/.libs/libdatatype.a mca/base/.libs/libmca_base.a util/.libs/libopalutil.a mca/allocator/.libs/libmca_allocator.a mca/backtrace/.libs/libmca_backtrace.a mca/backtrace/execinfo/.libs/libmca_backtrace_execinfo.a mca/btl/.libs/libmca_btl.a mca/compress/.libs/libmca_compress.a mca/crs/.libs/libmca_crs.a mca/dl/.libs/libmca_dl.a mca/dl/dlopen/.libs/libmca_dl_dlopen.a mca/event/.libs/libmca_event.a mca/event/libevent2022/.libs/libmca_event_libevent2022.a mca/hwloc/.libs/libmca_hwloc.a mca/hwloc/hwloc201/.libs/libmca_hwloc_hwloc201.a mca/if/.libs/libmca_if.a mca/if/posix_ipv4/.libs/libmca_if_posix_ipv4.a mca/if/linux_ipv6/.libs/libmca_if_linux_ipv6.a mca/installdirs/.libs/libmca_installdirs.a mca/installdirs/config/.libs/libmca_installdirs_config.a mca/installdirs/env/.libs/libmca_installdirs_env.a mca/memchecker/.libs/libmca_memchecker.a mca/memcpy/.libs/libmca_memcpy.a mca/memory/.libs/libmca_memory.a mca/memory/patcher/.libs/libmca_memory_patcher.a mca/mpool/.libs/libmca_mpool.a mca/patcher/.libs/libmca_patcher.a mca/pmix/.libs/libmca_pmix.a mca/pstat/.libs/libmca_pstat.a mca/rcache/.libs/libmca_rcache.a mca/reachable/.libs/libmca_reachable.a mca/shmem/.libs/libmca_shmem.a mca/timer/.libs/libmca_timer.a mca/timer/linux/.libs/libmca_timer_linux.a --no-whole-archive -ldl -lrt -lm -lutil -lz -O3 -pthread -pthread -soname libopen-pal.so.40 -o .libs/libopen-pal.so.40.30.0 clang-9: error: unsupported option '--whole-archive' clang-9: error: unsupported option '--no-whole-archive' clang-9: error: unknown argument: '-soname'

hppritcha commented 3 years ago

I'd suggest unloading all the HPE/Cray programming env modules you don't need. In particular, unless you need rocm support, unload it. You also will want to unload the cray-libsci. To avoid additional trouble use the -hnopattern flag for the fortran compiler and -fno-cray for the C/C++ flags.

@awlauria the cray programming env doesn't use flang for fortran.

hppritcha commented 3 years ago

oh sorry, just noticed that you're trying to use the AMD backend compilers. Never mind my suggestions then.

jsquyres commented 3 years ago

Are there unreleased upstream changes in Libtool for AOCC?