Skip to content
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

Fixes for FreeBSD, including upstream #4138

Merged
merged 8 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/adios2/toolkit/transport/file/FileHTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Author: Dmitry Ganyushin ganyushin@gmail.com
*/
#include "FileHTTP.h"
#include <sys/socket.h>

#include <arpa/inet.h>
#include <cstring>
#include <netdb.h>
Expand Down
71 changes: 17 additions & 54 deletions thirdparty/EVPath/EVPath/cmib.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,7 @@ static inline uint16_t get_local_lid(struct ibv_context *context, int port)
}

static int
check_host(hostname, sin_addr)
char *hostname;
void *sin_addr;
check_host(char *hostname,void *sin_addr)
{
struct hostent *host_addr;
host_addr = gethostbyname(hostname);
Expand All @@ -393,8 +391,7 @@ void *sin_addr;
}

static ib_conn_data_ptr
create_ib_conn_data(svc)
CMtrans_services svc;
create_ib_conn_data(CMtrans_services svc)
{
ib_conn_data_ptr ib_conn_data = svc->malloc_func(sizeof(struct ib_connection_data));
memset(ib_conn_data, 0, sizeof(struct ib_connection_data));
Expand Down Expand Up @@ -946,9 +943,7 @@ CMIB_data_available(transport_entry trans, CMConnection conn)
* Accept socket connection
*/
static void
ib_accept_conn(void_trans, void_conn_sock)
void *void_trans;
void *void_conn_sock;
ib_accept_conn(void *void_trans, void *void_conn_sock)
{
transport_entry trans = (transport_entry) void_trans;
int conn_sock = (int) (long) void_conn_sock;
Expand Down Expand Up @@ -1106,9 +1101,7 @@ void *void_conn_sock;
}

extern void
libcmib_LTX_shutdown_conn(svc, scd)
CMtrans_services svc;
ib_conn_data_ptr scd;
libcmib_LTX_shutdown_conn(CMtrans_services svc, ib_conn_data_ptr scd)
{
svc->trace_out(scd->sd->cm, "CMIB shutdown_conn, removing select %d\n",
scd->fd);
Expand Down Expand Up @@ -1141,14 +1134,7 @@ is_private_10(int IP)
}

static int
initiate_conn(cm, svc, trans, attrs, ib_conn_data, conn_attr_list, no_more_redirect)
CManager cm;
CMtrans_services svc;
transport_entry trans;
attr_list attrs;
ib_conn_data_ptr ib_conn_data;
attr_list conn_attr_list;
int no_more_redirect;
initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, attr_list attrs, ib_conn_data_ptr ib_conn_data, attr_list conn_attr_list, int no_more_redirect)
{
int sock;

Expand Down Expand Up @@ -1413,11 +1399,7 @@ int no_more_redirect;
* (name_str stores the machine name).
*/
extern CMConnection
libcmib_LTX_initiate_conn(cm, svc, trans, attrs)
CManager cm;
CMtrans_services svc;
transport_entry trans;
attr_list attrs;
libcmib_LTX_initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, attr_list attrs)
{
ib_conn_data_ptr ib_conn_data = create_ib_conn_data(svc);
attr_list conn_attr_list = create_attr_list();
Expand Down Expand Up @@ -1447,11 +1429,7 @@ attr_list attrs;
* same as ours and if the IP_PORT matches the one we are listening on.
*/
extern int
libcmib_LTX_self_check(cm, svc, trans, attrs)
CManager cm;
CMtrans_services svc;
transport_entry trans;
attr_list attrs;
libcmib_LTX_self_check(CManager cm, CMtrans_services svc, transport_entry trans, attr_list attrs)
{

ib_client_data_ptr sd = trans->trans_data;
Expand Down Expand Up @@ -1499,12 +1477,9 @@ attr_list attrs;
}

extern int
libcmib_LTX_connection_eq(cm, svc, trans, attrs, scd)
CManager cm;
CMtrans_services svc;
transport_entry trans;
attr_list attrs;
ib_conn_data_ptr scd;
libcmib_LTX_connection_eq(CManager cm, CMtrans_services svc,
transport_entry trans, attr_list attrs,
ib_conn_data_ptr scd)
{

int int_port_num;
Expand Down Expand Up @@ -1548,11 +1523,8 @@ ib_conn_data_ptr scd;
* Create an IP socket for connection from other CMs
*/
extern attr_list
libcmib_LTX_non_blocking_listen(cm, svc, trans, listen_info)
CManager cm;
CMtrans_services svc;
transport_entry trans;
attr_list listen_info;
libcmib_LTX_non_blocking_listen(CManager cm, CMtrans_services svc,
transport_entry trans, attr_list listen_info)
{
ib_client_data_ptr sd = trans->trans_data;
unsigned int length;
Expand Down Expand Up @@ -1714,11 +1686,8 @@ struct iovec {
#endif

extern void
libcmib_LTX_set_write_notify(trans, svc, scd, enable)
transport_entry trans;
CMtrans_services svc;
ib_conn_data_ptr scd;
int enable;
libcmib_LTX_set_write_notify(transport_entry trans, CMtrans_services svc,
ib_conn_data_ptr scd, int enable)
{
if (enable != 0) {
svc->fd_write_select(trans->cm, scd->fd, (select_list_func) trans->write_possible,
Expand Down Expand Up @@ -1910,12 +1879,8 @@ libcmib_LTX_writev_complete_notify_func(CMtrans_services svc,
}

extern int
libcmib_LTX_writev_func(svc, scd, iovs, iovcnt, attrs)
CMtrans_services svc;
ib_conn_data_ptr scd;
void *iovs;
int iovcnt;
attr_list attrs;
libcmib_LTX_writev_func(CMtrans_services svc, ib_conn_data_ptr scd,
void *iovs, int iovcnt, attr_list attrs)
{
return libcmib_LTX_writev_complete_notify_func(svc, scd, iovs, iovcnt,
attrs, NULL, NULL);
Expand All @@ -1934,9 +1899,7 @@ free_ib_data(CManager cm, void *sdv)
}

extern void *
libcmib_LTX_initialize(cm, svc)
CManager cm;
CMtrans_services svc;
libcmib_LTX_initialize(CManager cm, CMtrans_services svc)
{
static int atom_init = 0;

Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/mtests/cmping.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0,0,(DWORD)x),y)
#else
#include <sys/socket.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/mtests/cmtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0, 0, (DWORD)x),y)
#else
#include <sys/socket.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/rtests/evtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0,0,(DWORD)x),y)
#else
#include <sys/socket.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/rtests/extract_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0, 0, (DWORD)x),y)
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/rtests/remote_terminal_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0,0,(DWORD)x),y)
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/tests/evtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define srand48(x)
#define kill(x,y) TerminateProcess(OpenProcess(0,0,(DWORD)x),y)
#else
#include <sys/socket.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#endif
Expand Down
18 changes: 18 additions & 0 deletions thirdparty/dill/dill/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Language: Cpp
BasedOnStyle: Chromium
BreakBeforeBraces: Custom
IndentWidth: 4
ContinuationIndentWidth: 4
AccessModifierOffset: -4
Standard: Cpp11
ColumnLimit: 80
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakAfterReturnType: All
AlignEscapedNewlines: Right
AlignAfterOpenBracket: Align
SortUsingDeclarations: false
IndentCaseLabels: false
BraceWrapping:
AfterFunction: true
SplitEmptyFunction: true
SplitEmptyRecord: true
5 changes: 2 additions & 3 deletions thirdparty/dill/dill/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
check_type_size("long" SIZEOF_LONG)
set(NATIVE_CG TRUE)
unset(NATIVE_ARCH)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86|x86_64|AMD64")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86|x86_64|AMD64|amd64")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(NATIVE_ARCH x86_64)
set(HOST_X86_64 1)
Expand Down Expand Up @@ -200,7 +200,7 @@ endif()
if(LIBFFI_FOUND)
message(STATUS "Enabling emulation")
set(EMULATION_POSSIBLE TRUE)
elseif(DILL_IGNORE_NATIVE OR (NATIVE_ARCH STREQUAL "UNSUPPORTED"))
elseif((DILL_IGNORE_NATIVE OR (NATIVE_ARCH STREQUAL "UNSUPPORTED")) AND NOT DILL_NATIVE_ONLY)
find_program (AUTOCONF autoconf)
find_program (AUTOMAKE automake)
if ((AUTOCONF STREQUAL "AUTOCONF-NOTFOUND") OR (AUTOMAKE STREQUAL "AUTOMAKE-NOTFOUND"))
Expand Down Expand Up @@ -344,7 +344,6 @@ check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
include(CheckSymbolExists)
check_symbol_exists(__clear_cache "" CLEAR_CACHE_DEFINED)
message(STATUS "Clear cache defined is ${CLEAR_CACHE_DEFINED}")

set(NO_DISASSEMBLER TRUE)
if(DILL_ENABLE_DISASSEMBLY)
Expand Down
1 change: 1 addition & 0 deletions thirdparty/ffs/ffs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ endif()
CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE(sockLib.h HAVE_SOCKLIB_H)
CHECK_INCLUDE_FILE(stdarg.h STDC_HEADERS)
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/ffs/ffs/cmake/BisonFlexSub.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FUNCTION (SETUP_BISON_FLEX_SUB)

IF ((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") OR
(${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") OR
(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"))
set (BISON_FLEX_PRECOMPILE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cod/pregen_source/Linux")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set (BISON_FLEX_PRECOMPILE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cod/pregen_source/Windows")
Expand Down
3 changes: 3 additions & 0 deletions thirdparty/ffs/ffs/ffs/tests/context_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
Expand Down
Loading