ompi icon indicating copy to clipboard operation
ompi copied to clipboard

macOS: Cannot configure --with-libevent=internal

Open dalcinl opened this issue 1 year ago • 17 comments
trafficstars

The problem is actually rooted at libevent. This affects the latest release tarball 5.0.2, possibly 4.1.6 too.

Without running ./autogen.sh first on the libevent source directory, at some point the libevent build fails with a linker error.

For reference, Homebrew's libevent.rb runs ./autogen.sh before configure.

dalcinl avatar Feb 21 '24 12:02 dalcinl

@dalcinl I'm afraid I can't replicate the issue. I downloaded a v5.0.2 tarball and built it on an M2 Mac Sonoma 14.3.1 with:

./configure --prefix=$bogus --with-libevent=internal
make -j 32 |& tee make.out
make install |& tee install.out

It seemed to build ok.

Can you submit more detail?

jsquyres avatar Feb 21 '24 15:02 jsquyres

Cannot reproduce either. Fresh unpack from the online tarball, Sonoma 14.3.1 with default clang. make install went smoothly and a quick run succeeded.

bosilca avatar Feb 21 '24 16:02 bosilca

Sorry, I have to try again with the full set of configure options I was trying, I'm suspecting of --disable-static...

dalcinl avatar Feb 21 '24 19:02 dalcinl

It looks like this issue is expecting a response, but hasn't gotten one yet. If there are no responses in the next 2 weeks, we'll assume that the issue has been abandoned and will close it.

github-actions[bot] avatar Mar 10 '24 21:03 github-actions[bot]

Here you have a reproducer

tar -xf openmpi-5.0.2.tar.gz
cd openmpi-5.0.2

export CC=cc
export CXX=c++

PREFIX=$HOME/openmpi
options=(
   CC=cc
   CXX=c++
   --prefix="$PREFIX"
   --disable-dlopen
   --disable-oshmem
   --without-ofi
   --without-ucx
   --without-psm2
   --without-cuda
   --without-rocm
   --with-pmix=internal
   --with-prrte=internal
   --with-libevent=internal
   --with-hwloc=internal
   --disable-static
   --disable-opencl
   --disable-libxml2
   --disable-libompitrace
   --enable-mpi-fortran=mpifh
   --disable-dependency-tracking
)

export MACOSX_DEPLOYMENT_TARGET="11.0"
njobs=$(sysctl -n hw.physicalcpu)

./configure "${options[@]}"
make -j ${njobs:-1} install DESTDIR=/tmp
Output of `make install DESTDIR=/tmp`
Making install in config
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in contrib
make[2]: Nothing to be done for `install-exec-am'.
 .././config/install-sh -c -d '/tmp/Users/dalcinl/openmpi/share/openmpi/amca-param-sets'
 .././config/install-sh -c -d '/tmp/Users/dalcinl/openmpi/share/openmpi'
 /usr/bin/install -c -m 644 amca-param-sets/example.conf amca-param-sets/ft-mpi '/tmp/Users/dalcinl/openmpi/share/openmpi/amca-param-sets'
 /usr/bin/install -c -m 644 openmpi-valgrind.supp '/tmp/Users/dalcinl/openmpi/share/openmpi'
Making install in 3rd-party
Makefile:1684: warning: overriding commands for target `check-recursive'
Makefile:1406: warning: ignoring old commands for target `check-recursive'
Making install in libevent-2.1.12-stable
/Library/Developer/CommandLineTools/usr/bin/make  install-am
  CC       bufferevent.lo
  CC       buffer.lo
  CC       bufferevent_sock.lo
  CC       bufferevent_pair.lo
  CC       bufferevent_filter.lo
  CC       bufferevent_ratelim.lo
  CC       event.lo
  CC       evmap.lo
  CC       evthread.lo
  CC       evutil.lo
  CC       evutil_rand.lo
  CC       evutil_time.lo
  CC       listener.lo
event.c:230:1: warning: unused function 'event_debug_map_HT_REPLACE' [-Wunused-function]
HT_PROTOTYPE(event_debug_map, event_debug_entry, node, hash_debug_entry,
^
./ht-internal.h:186:3: note: expanded from macro 'HT_PROTOTYPE'
  name##_HT_REPLACE(struct name *head, struct type *elm)                \
  ^
<scratch space>:18:1: note: expanded from here
event_debug_map_HT_REPLACE
^
event.c:230:1: warning: unused function 'event_debug_map_HT_FOREACH_FN' [-Wunused-function]
./ht-internal.h:225:3: note: expanded from macro 'HT_PROTOTYPE'
  name##_HT_FOREACH_FN(struct name *head,                               \
  ^
<scratch space>:23:1: note: expanded from here
event_debug_map_HT_FOREACH_FN
^
event.c:230:1: warning: unused function 'event_debug_map_HT_NEXT' [-Wunused-function]
./ht-internal.h:267:3: note: expanded from macro 'HT_PROTOTYPE'
  name##_HT_NEXT(struct name *head, struct type **elm)                  \
  ^
<scratch space>:25:1: note: expanded from here
event_debug_map_HT_NEXT
^
evutil.c:213:21: warning: argument 'fd' of type 'int[2]' with mismatched bound [-Warray-parameter]
    evutil_socket_t fd[2])
                    ^
./util-internal.h:306:62: note: previously declared as 'int[]' here
int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
                                                             ^
  CC       log.lo
  CC       select.lo
  CC       poll.lo
  CC       kqueue.lo
  CC       signal.lo
  CC       evdns.lo
1 warning generated.
  CC       event_tagging.lo
  CC       evrpc.lo
  CC       http.lo
  CC       sample/event-read-fifo.o
  CC       sample/hello-world.o
  CC       sample/http-server.o
  CC       sample/http-connect.o
  CC       sample/signal-test.oOutput
  CC       sample/time-test.o
3 warnings generated.
  CC       evthread_pthread.lo
  CC       sample/dns-example.o
  CCLD     libevent_core.la
  CCLD     libevent_pthreads.la
  CCLD     libevent.la
  CCLD     libevent_extra.la
Undefined symbols for architecture arm64:
  "_event_mm_free_", referenced from:
      _evthread_posix_lock_alloc in evthread_pthread.o
      _evthread_posix_lock_free in evthread_pthread.o
      _evthread_posix_cond_alloc in evthread_pthread.o
      _evthread_posix_cond_free in evthread_pthread.o
  "_event_mm_malloc_", referenced from:
      _evthread_posix_lock_alloc in evthread_pthread.o
      _evthread_posix_cond_alloc in evthread_pthread.o
  "_evthread_set_condition_callbacks", referenced from:
      _evthread_use_pthreads in evthread_pthread.o
  "_evthread_set_id_callback", referenced from:
      _evthread_use_pthreads in evthread_pthread.o
  "_evthread_set_lock_callbacks", referenced from:
      _evthread_use_pthreads in evthread_pthread.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libevent_pthreads.la] Error 1
make[3]: *** Waiting for unfinished jobs....
Undefined symbols for architecture arm64:
  "_EVUTIL_ISALNUM_", referenced from:
      _evhttp_uri_parse_with_flags in http.o
      _evhttp_uri_set_scheme in http.o
  "_EVUTIL_ISALPHA_", referenced from:
      _request_new in evdns.o
      _evhttp_uri_parse_with_flags in http.o
      _evhttp_uri_set_scheme in http.o
  "_EVUTIL_ISDIGIT_", referenced from:
      _evhttp_request_get_host in http.o
      _parse_authority in http.o
      _parse_authority in http.o
  "_EVUTIL_ISXDIGIT_", referenced from:
      _evhttp_decode_uri_internal in http.o
      _evhttp_decode_uri_internal in http.o
      _parse_authority in http.o
      _parse_authority in http.o
      _parse_authority in http.o
      _parse_authority in http.o
      _end_of_path in http.o
      _end_of_path in http.o
      ...
  "_EVUTIL_TOLOWER_", referenced from:
      _prefix_suffix_match in http.o
      _prefix_suffix_match in http.o
  "_bufferevent_base_set", referenced from:
      _evhttp_connection_base_bufferevent_new in http.o
      _evhttp_connection_set_base in http.o
  "_bufferevent_disable", referenced from:
      _evhttp_connection_fail_ in http.o
      _evhttp_read_cb in http.o
      _evhttp_request_dispatch in http.o
      _evhttp_start_read_ in http.o
      _evhttp_start_write_ in http.o
      _accept_socket_cb in http.o
      _evhttp_read_body in http.o
      ...
  "_bufferevent_disable_hard_", referenced from:
      _evhttp_connection_reset_ in http.o
  "_bufferevent_enable", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_request_dispatch in http.o
      _evhttp_start_read_ in http.o
      _evhttp_start_write_ in http.o
      _evhttp_start_write_ in http.o
      _evhttp_send in http.o
      _evhttp_send_reply_start in http.o
      ...
  "_bufferevent_free", referenced from:
      _evhttp_connection_free in http.o
  "_bufferevent_get_base", referenced from:
      _evhttp_connection_base_bufferevent_new in http.o
  "_bufferevent_get_input", referenced from:
      _evhttp_connection_reset_ in http.o
      _evhttp_read_cb in http.o
      _evhttp_read_cb in http.o
      _evhttp_error_cb in http.o
      _evhttp_start_read_ in http.o
      _evhttp_read_header in http.o
      _evhttp_read_body in http.o
      _evhttp_read_body in http.o
      ...
  "_bufferevent_get_options_", referenced from:
      _evhttp_connection_free in http.o
  "_bufferevent_get_output", referenced from:
      _evhttp_connection_reset_ in http.o
      _evhttp_error_cb in http.o
      _evhttp_write_connectioncb in http.o
      _evhttp_make_header in http.o
      _evhttp_make_header in http.o
      _evhttp_make_header in http.o
      _evhttp_send_reply_chunk_with_cb in http.o
      ...
  "_bufferevent_get_priority", referenced from:
      _evhttp_connection_base_bufferevent_new in http.o
  "_bufferevent_getfd", referenced from:
      _evhttp_connection_free in http.o
      _evhttp_connection_reset_ in http.o
      _evhttp_error_cb in http.o
      _evhttp_connection_cb in http.o
  "_bufferevent_set_timeouts", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_connection_set_timeout in http.o
      _evhttp_connection_set_timeout in http.o
      _evhttp_connection_set_timeout_tv in http.o
      _evhttp_connection_set_timeout_tv in http.o
      _evhttp_connection_cb in http.o
      _accept_socket_cb in http.o
      ...
  "_bufferevent_setcb", referenced from:
      _evhttp_connection_reset_ in http.o
      _evhttp_connection_connect_ in http.o
      _evhttp_connection_base_bufferevent_new in http.o
      _evhttp_connection_cb in http.o
      _evhttp_request_dispatch in http.o
      _evhttp_start_read_ in http.o
      _evhttp_start_write_ in http.o
      ...
  "_bufferevent_setfd", referenced from:
      _evhttp_connection_reset_ in http.o
      _evhttp_connection_connect_ in http.o
      _evhttp_connection_connect_ in http.o
      _accept_socket_cb in http.o
  "_bufferevent_socket_connect", referenced from:
      _evhttp_connection_connect_ in http.o
  "_bufferevent_socket_connect_hostname", referenced from:
      _evhttp_connection_connect_ in http.o
  "_bufferevent_socket_get_conn_address_", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_connection_get_addr in http.o
  "_bufferevent_socket_new", referenced from:
      _evhttp_connection_base_bufferevent_new in http.o
  "_bufferevent_socket_set_conn_address_", referenced from:
      _accept_socket_cb in http.o
  "_evbuffer_add", referenced from:
      _evtag_encode_int in event_tagging.o
      _evtag_encode_int64 in event_tagging.o
      _evtag_encode_tag in event_tagging.o
      _evtag_marshal in event_tagging.o
      _evtag_marshal in event_tagging.o
      _evtag_marshal in event_tagging.o
      _evtag_marshal_buffer in event_tagging.o
      _evtag_marshal_buffer in event_tagging.o
      ...
  "_evbuffer_add_buffer", referenced from:
      _evtag_marshal_buffer in event_tagging.o
      _evhttp_send in http.o
      _evhttp_make_header in http.o
      _evhttp_send_reply_chunk_with_cb in http.o
      _evhttp_read_header in http.o
      _evhttp_read_body in http.o
  "_evbuffer_add_printf", referenced from:
      _evhttp_send_error in http.o
      _evhttp_make_header in http.o
      _evhttp_make_header in http.o
      _evhttp_make_header in http.o
      _evhttp_send_reply_chunk_with_cb in http.o
      _evhttp_uriencode in http.o
      _evhttp_uri_join in http.o
      _evhttp_uri_join in http.o
      ...
  "_evbuffer_drain", referenced from:
      _decode_tag_internal in event_tagging.o
      _evtag_decode_int in event_tagging.o
      _evtag_decode_int64 in event_tagging.o
      _evtag_consume in event_tagging.o
      _evtag_unmarshal in event_tagging.o
      _evtag_unmarshal_int in event_tagging.o
      _evtag_unmarshal_int64 in event_tagging.o
      ...
  "_evbuffer_free", referenced from:
      _evrpc_reqstate_free_ in evrpc.o
      _evhttp_send_error in http.o
      _evhttp_request_free in http.o
      _evhttp_request_free in http.o
      _evhttp_uriencode in http.o
      _evhttp_uri_join in http.o
      _evhttp_handle_request in http.o
      ...
  "_evbuffer_freeze", referenced from:
      _evhttp_error_cb in http.o
  "_evbuffer_get_length", referenced from:
      _decode_tag_internal in event_tagging.o
      _evtag_marshal_buffer in event_tagging.o
      _evtag_decode_int in event_tagging.o
      _decode_int_internal in event_tagging.o
      _evtag_decode_int64 in event_tagging.o
      _evtag_unmarshal_header in event_tagging.o
      _evtag_consume in event_tagging.o
      ...
  "_evbuffer_new", referenced from:
      _evrpc_request_done in evrpc.o
      _evhttp_send_error in http.o
      _evhttp_uriencode in http.o
      _evhttp_request_new in http.o
      _evhttp_request_new in http.o
      _evhttp_uri_join in http.o
      _evhttp_handle_request in http.o
      ...
  "_evbuffer_pullup", referenced from:
      _decode_tag_internal in event_tagging.o
      _evtag_decode_int in event_tagging.o
      _evtag_decode_int in event_tagging.o
      _decode_int_internal in event_tagging.o
      _decode_int_internal in event_tagging.o
      _evtag_decode_int64 in event_tagging.o
      _evtag_decode_int64 in event_tagging.o
      ...
  "_evbuffer_readln", referenced from:
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_headers_ in http.o
      _evhttp_parse_headers_ in http.o
      _evhttp_read_body in http.o
  "_evbuffer_remove", referenced from:
      _evtag_unmarshal_fixed in event_tagging.o
      _evtag_unmarshal_string in event_tagging.o
      _evhttp_uriencode in http.o
      _evhttp_uri_join in http.o
  "_evbuffer_remove_buffer", referenced from:
      _evhttp_read_body in http.o
      _evhttp_read_body in http.o
  "_evbuffer_unfreeze", referenced from:
      _evhttp_error_cb in http.o
  "_evconnlistener_free", referenced from:
      _evhttp_bind_socket_with_handle in http.o
      _evhttp_accept_socket_with_handle in http.o
      _evhttp_accept_socket in http.o
      _evhttp_del_accept_socket in http.o
      _evhttp_free in http.o
  "_evconnlistener_get_fd", referenced from:
      _evhttp_bound_socket_get_fd in http.o
  "_evconnlistener_new", referenced from:
      _evhttp_bind_socket_with_handle in http.o
      _evhttp_accept_socket_with_handle in http.o
      _evhttp_accept_socket in http.o
  "_evconnlistener_set_cb", referenced from:
      _evhttp_bind_socket_with_handle in http.o
      _evhttp_accept_socket_with_handle in http.o
      _evhttp_accept_socket in http.o
      _evhttp_bind_listener in http.o
  "_event_add", referenced from:
      _evdns_add_server_port_with_base in evdns.o
      _evdns_server_request_respond in evdns.o
      _server_port_flush in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_request_transmit in evdns.o
      _evdns_request_transmit in evdns.o
      ...
  "_event_assign", referenced from:
      _evdns_add_server_port_with_base in evdns.o
      _evdns_server_request_respond in evdns.o
      _server_port_flush in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _request_new in evdns.o
      _evdns_getaddrinfo in evdns.o
      ...
  "_event_debug_logging_mask_", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_add_header in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_connection_base_bufferevent_new in http.o
      _evhttp_read_cb in http.o
      ...
  "_event_debug_unassign", referenced from:
      _server_port_free in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _request_finished in evdns.o
      _evdns_base_free_and_unlock in evdns.o
      _evdns_base_free_and_unlock in evdns.o
      _evhttp_connection_free in http.o
  "_event_debugx_", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_add_header in http.o
      _evhttp_add_header in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_connection_base_bufferevent_new in http.o
      _evhttp_read_cb in http.o
      ...
  "_event_deferred_cb_cancel_", referenced from:
      _evhttp_connection_free in http.o
      _evhttp_read_cb in http.o
  "_event_deferred_cb_init_", referenced from:
      _reply_schedule_callback in evdns.o
      _evhttp_connection_base_bufferevent_new in http.o
  "_event_deferred_cb_schedule_", referenced from:
      _reply_schedule_callback in evdns.o
      _evhttp_error_cb in http.o
      _evhttp_start_read_ in http.o
  "_event_del", referenced from:
      _server_port_free in evdns.o
      _evdns_server_request_respond in evdns.o
      _server_port_flush in evdns.o
      _evdns_base_clear_nameservers_and_suspend in evdns.o
      _evdns_base_clear_nameservers_and_suspend in evdns.o
      _evdns_base_clear_nameservers_and_suspend in evdns.o
      _request_finished in evdns.o
      _request_finished in evdns.o
      _request_finished in evdns.o
      ...
  "_event_err", referenced from:
      _evrpc_unregister_rpc in evrpc.o
      _evrpc_register_rpc in evrpc.o
      _evrpc_schedule_request_closure in evrpc.o
      _accept_socket_cb in http.o
  "_event_errx", referenced from:
      _server_port_ready_callback in evdns.o
      _server_port_free in evdns.o
      _server_port_flush in evdns.o
      _evdns_cancel_request in evdns.o
      _evdns_request_insert in evdns.o
      _evdns_requests_pump_waiting_queue in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      ...
  "_event_get_priority", referenced from:
      _reply_schedule_callback in evdns.o
  "_event_initialized", referenced from:
      _evdns_base_clear_nameservers_and_suspend in evdns.o
      _evhttp_connection_free in http.o
  "_event_logv_", referenced from:
      _evdns_log_ in evdns.o
  "_event_mm_calloc_", referenced from:
      _server_port_ready_callback in evdns.o
      _reply_schedule_callback in evdns.o
      _evdns_base_resolve_ipv4 in evdns.o
      _evdns_base_resolve_ipv6 in evdns.o
      _evdns_base_resolve_reverse in evdns.o
      _evdns_base_resolve_reverse_ipv6 in evdns.o
      _evdns_getaddrinfo in evdns.o
      ...
  "_event_mm_free_", referenced from:
      _evdns_add_server_port_with_base in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_free in evdns.o
      _evdns_server_request_add_reply in evdns.o
      _evdns_server_request_add_reply in evdns.o
      ...
  "_event_mm_malloc_", referenced from:
      _evdns_add_server_port_with_base in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _evdns_server_request_add_reply in evdns.o
      _evdns_server_request_add_reply in evdns.o
      _evdns_server_request_respond in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      ...
  "_event_mm_realloc_", referenced from:
      _evhttp_parse_headers_ in http.o
  "_event_mm_strdup_", referenced from:
      _evdns_server_request_add_reply in evdns.o
      _evdns_server_request_add_reply in evdns.o
      _search_request_new in evdns.o
      _evdns_base_resolv_conf_parse in evdns.o
      _dnsname_to_labels in evdns.o
      _dnsname_to_labels in evdns.o
      _nameserver_ready_callback in evdns.o
      ...
  "_event_sock_warn", referenced from:
      _evhttp_connection_connect_ in http.o
      _evhttp_bind_socket_with_handle in http.o
      _accept_socket_cb in http.o
      _create_bind_socket_nonblock in http.o
  "_event_warn", referenced from:
      _reply_schedule_callback in evdns.o
      _evtag_unmarshal_string in event_tagging.o
      _evhttp_htmlescape in http.o
      _evhttp_connection_set_local_address in http.o
      _evhttp_add_header_internal in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      ...
  "_event_warnx", referenced from:
      _bind_socket in http.o
      _evhttp_read_header in http.o
  "_evthread_is_debug_lock_held_", referenced from:
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_flush in evdns.o
      _evdns_request_insert in evdns.o
      _evdns_requests_pump_waiting_queue in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _reply_schedule_callback in evdns.o
      ...
  "_evthread_lock_debugging_enabled_", referenced from:
      _server_port_ready_callback in evdns.o
      _server_port_flush in evdns.o
      _evdns_request_insert in evdns.o
      _evdns_requests_pump_waiting_queue in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _reply_schedule_callback in evdns.o
      _request_new in evdns.o
      ...
  "_evthread_lock_fns_", referenced from:
      _evdns_add_server_port_with_base in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _server_port_ready_callback in evdns.o
      _evdns_close_server_port in evdns.o
      _server_port_free in evdns.o
      _evdns_server_request_add_reply in evdns.o
      _evdns_server_request_add_reply in evdns.o
      ...
  "_evutil_addrinfo_append_", referenced from:
      _evdns_getaddrinfo in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
  "_evutil_adjust_hints_for_addrconfig_", referenced from:
      _evdns_getaddrinfo in evdns.o
  "_evutil_ascii_strcasecmp", referenced from:
      _evdns_getaddrinfo in evdns.o
      _evdns_getaddrinfo in evdns.o
      _nameserver_ready_callback in evdns.o
      _evhttp_find_header in http.o
      _evhttp_remove_header in http.o
      _evhttp_parse_firstline_ in http.o
      _evhttp_parse_firstline_ in http.o
      ...
  "_evutil_ascii_strncasecmp", referenced from:
      _evhttp_make_header in http.o
      _evhttp_send_done in http.o
  "_evutil_closesocket", referenced from:
      _server_port_free in evdns.o
      _evdns_base_clear_nameservers_and_suspend in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _evdns_base_free_and_unlock in evdns.o
      _evhttp_connection_free in http.o
      _evhttp_connection_reset_ in http.o
      _evhttp_bind_socket_with_handle in http.o
      ...
  "_evutil_date_rfc1123", referenced from:
      _evhttp_make_header in http.o
  "_evutil_format_sockaddr_port_", referenced from:
      _evdns_nameserver_add_impl_ in evdns.o
      _evdns_nameserver_add_impl_ in evdns.o
      _nameserver_write_waiting in evdns.o
      _nameserver_failed in evdns.o
      _nameserver_failed in evdns.o
      _nameserver_ready_callback in evdns.o
      _reply_handle in evdns.o
      ...
  "_evutil_freeaddrinfo", referenced from:
      _evdns_getaddrinfo in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
      _evdns_getaddrinfo_timeout_cb in evdns.o
      _free_getaddrinfo_request in evdns.o
      _bind_socket in http.o
      ...
  "_evutil_gai_strerror", referenced from:
      _bind_socket in http.o
  "_evutil_getaddrinfo", referenced from:
      _evdns_getaddrinfo in evdns.o
      _bind_socket in http.o
  "_evutil_getaddrinfo_common_", referenced from:
      _evdns_getaddrinfo in evdns.o
  "_evutil_inet_pton", referenced from:
      _bracket_addr_ok in http.o
  "_evutil_make_listen_socket_reuseable", referenced from:
      _create_bind_socket_nonblock in http.o
  "_evutil_new_addrinfo_", referenced from:
      _evdns_getaddrinfo in evdns.o
      _evdns_getaddrinfo_gotresolve in evdns.o
  "_evutil_parse_sockaddr_port", referenced from:
      _evdns_base_nameserver_ip_add in evdns.o
      _evdns_base_set_option_impl in evdns.o
      _evdns_base_parse_hosts_line in evdns.o
  "_evutil_read_file_", referenced from:
      _evdns_base_resolv_conf_parse in evdns.o
      _evdns_base_load_hosts in evdns.o
  "_evutil_rtrim_lws_", referenced from:
      _evhttp_parse_headers_ in http.o
      _evhttp_parse_headers_ in http.o
  "_evutil_secure_rng_get_bytes", referenced from:
      _request_new in evdns.o
      _transaction_id_pick in evdns.o
  "_evutil_secure_rng_init", referenced from:
      _evdns_base_new in evdns.o
  "_evutil_set_evdns_getaddrinfo_cancel_fn_", referenced from:
      _evdns_base_new in evdns.o
  "_evutil_set_evdns_getaddrinfo_fn_", referenced from:
      _evdns_base_new in evdns.o
  "_evutil_snprintf", referenced from:
      _evdns_server_request_add_ptr_reply in evdns.o
      _evdns_base_resolve_reverse in evdns.o
      _reply_handle in evdns.o
      _bind_socket in http.o
      _evhttp_make_header in http.o
      _evhttp_make_header in http.o
  "_evutil_sockaddr_cmp", referenced from:
      _evdns_nameserver_add_impl_ in evdns.o
      _nameserver_ready_callback in evdns.o
  "_evutil_sockaddr_is_loopback_", referenced from:
      _evdns_nameserver_add_impl_ in evdns.o
  "_evutil_socket_", referenced from:
      _evdns_nameserver_add_impl_ in evdns.o
      _create_bind_socket_nonblock in http.o
  "_evutil_strtoll", referenced from:
      _evhttp_read_body in http.o
      _evhttp_get_body in http.o
  "_evutil_vsnprintf", referenced from:
      _evdns_log_ in evdns.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libevent_extra.la] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

dalcinl avatar Mar 11 '24 07:03 dalcinl

I figured out the root of the issue. The failure occurs because of

export MACOSX_DEPLOYMENT_TARGET="11.0"

before configure and make.

Given that the last libevent release was in 2020-07-05, and macOS 11 BigSur was released on November 12, 2020, there should be no surprises, the libevent tarball just needs a refresh of all the autotools-generated stuff.

dalcinl avatar Mar 11 '24 07:03 dalcinl

Hmmm...somehow, that doesn't sound right. I can take that libevent release and build it without problem and without regenerating autotools build produce on my Mac Sonoma. So I suspect the real problem is a Mac issue with that exported envar.

What MacOS version are you running on? I gather that all is fine so long as you don't set that envar? If so, then why set it?

rhc54 avatar Mar 12 '24 13:03 rhc54

What MacOS version are you running on?

14.3.1

I gather that all is fine so long as you don't set that envar?

Yes, all is fine without the env var set.

If so, then why set it?

Do you acknowledge setting MACOSX_DEPLOYMENT_TARGET is a legit need?

dalcinl avatar Mar 12 '24 16:03 dalcinl

Do you acknowledge setting MACOSX_DEPLOYMENT_TARGET is a legit need?

Not really - never seen anyone do that, nor seen any reason why one should.

rhc54 avatar Mar 12 '24 18:03 rhc54

MACOSX_DEPLOYMENT_TARGET is essential to binary distributors building a binaries on a NEWER macOS but wanting the generated binaries able to run on an OLDER macOS version.

In my particular case, novice Python users had always struggle about how to get some MPI up and running in their development systems. I now it is trivial, just a simple apt/dnf/brew/etc install, but no matter what, folks keep asking about python -m pip install (mpich|openmpi). Therefore, rather than getting mad to the crying hungry baby, you feed the baby to stop the crying. That's what I'm doing here with binary assets published here. The macOS arm64 binaries (similarly for the x86_64) are produced on macOS 14, but thanks to setting MACOSX_DEPLOYMENT_TARGET=11.0 I get a guarantee of these binaries will run on older macOS versions down to 11.0 when users install them.

FWIW, I managed to resolve this issue and build with the internal libevent by just unpacking the tarball and running autogen.sh within my build script. If is up to the Open MPI community (or maybe libevent upstream?) whether to pursue a definitive fix for this issue such that it does not beat anyone again.

dalcinl avatar Mar 12 '24 18:03 dalcinl

Okay, never heard of it because I've never had anyone ask about it before. I suspect the libevent folks have zero interest in trying to backport for older environments, but I guess someone could ask them - if no other reason than doing the update might break the tarball for anyone with the older OS version. No idea if OMPI would want to do it either (for the same reason), but that's entirely up to them.

rhc54 avatar Mar 12 '24 18:03 rhc54

@dalcinl I hear what you're saying. I'm able to replicate the issue by setting that env variable and just building the v5.0.2 tarball on my MacOS laptop.

I was also just reminded that this came up before: #12168

I admit to not being entirely sure how to fix this. @rhc54 is probably right that the libevent people may not be interested in doing a new release. In general, we don't require end users to have the GNU Autotools installed, so we can't just unconditionally invoke autoreconf after expanding the libevent tarball.

We could:

  • Make a new libevent tarball that is bootstrapped with new Autotools.
    • This seems... dicey.
  • Run the Autotools in the expanded libevent if they're available.
    • Open MPI's configure is what expands the tarball.
    • If it detects that the Autotools are available, it could run them after expanding the libevent tarball.
    • That seems... weird (running Autotools from within configure).
  • Conditionally do either of the above two options iff the env variable MACOSX_DEPLOYMENT_TARGET exists.

I did file https://github.com/libevent/libevent/issues/1571 to inquire what the timelines are for a new Libevent release. Let's see what they say.

jsquyres avatar Mar 12 '24 23:03 jsquyres

Another option might be to build the code in an OSX Docker container instead of trying to do a cross-version compile. There are images available for all OSX versions - e.g., sickcodes/docker-osx:latest for the latest one. Could avoid the issue.

rhc54 avatar Mar 13 '24 00:03 rhc54

@jsquyres I have a hacky but legit solution. Untar the libevent tarball, run autogen.sh with a recent (latest) autotools, and create a patch file against the previous source tree. You add the patch file to the OMPI tarball, and in configure, if you are on macOS arm64 and MACOSX_DEPLOYMENT_TARGET is set, then you try apply the patch file with patch (AFAICT, available in mac os at /usr/bin/patch). If this is too heavy weight, then maybe just trying to run ./autogen.sh if on macOS arm64, and if it fails because of missing autotools, print a clean error message and ask users to brew/port install autoconf automake libtool [link]. Otherwise wait until next libevent release, and get ready for the complication of handling a new CMake-based build in one of your embedded dependencies :man_facepalming:.

dalcinl avatar Mar 13 '24 07:03 dalcinl

Still investigating this one.

jsquyres avatar Mar 20 '24 14:03 jsquyres

@bwbarrett and finally synched up on this (sorry, it took a while -- competing schedules and all that). Two main things:

  1. In most cases, we encourage downstream packagers to build external everything (libevent, hwloc, etc.). Admittedly, this case is a bit different. Indeed, building external would still require re-running autogen in libevent.
  2. For this case, given the weird position of Libevent, we/OMPI should probably just make a new Libevent tarball that is bootstrapped with modern AC/AM/LT versions (and therefore works properly). We should probably rename the tarball to make it clear that this is no longer the exact same upstream Libevent tarball, but we probably don't need to muck with the Libevent version number -- this is kinda the moral equivalent of shipping a patch.

I'll try to make a PR soon.

jsquyres avatar Mar 28 '24 14:03 jsquyres

this is kinda the moral equivalent of shipping a patch.

You should still consider the less intrusive alternative of actually shipping a patch alongside the tarball, applying the patch at configure time only if strictly needed (macOS running Apple Silicon). I'm not actually saying that's what you should do, just remembering you about that option being available for your consideration.

dalcinl avatar Mar 28 '24 15:03 dalcinl