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

Fix cmake s3 support.wif #2741

Merged
merged 23 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dd69bb8
Correct some logic so that S3 SDK is linked against if and when it is…
WardF Aug 23, 2023
0f7ebad
Remove diagnostic print statement.
WardF Aug 23, 2023
3637182
Merge branch 'main' into fix-cmake-s3-support.wif
WardF Aug 24, 2023
1eca1ad
Revert an accidental change.
WardF Aug 24, 2023
d90abc5
Modify how the aws-sdk-cpp libraries are detected using autotools. Co…
WardF Aug 24, 2023
7333d09
Correct the logic of when and how to link against amazon S3 AWS SDK l…
WardF Aug 24, 2023
2f43247
Adding a test which can be used to ensure that the AWSSDK which was d…
WardF Aug 28, 2023
718e485
Renamed pure-awssdk test to be more descriptive.
WardF Aug 28, 2023
ac4aade
Add an explicit check for ctype.h to CMake so that S3_INTERNAL=TRUE w…
WardF Aug 29, 2023
2e25cfc
Added checks for -lssl and -lcrypto for cmake-based builds. We can't …
WardF Aug 29, 2023
dd1ae95
Tweak spacing in pure awssdk test.
WardF Aug 29, 2023
af07326
Disable 'force internal S3 on Windows'
WardF Aug 30, 2023
c177ec0
Add properties to pure awssdk for MSVC builds.
WardF Aug 30, 2023
468e98f
Making test cases more verbose, turning off s3-based interoperability…
WardF Aug 30, 2023
b87d921
Merge branch 'fix-cmake-s3-support.wif' of github.com:WardF/netcdf-c …
WardF Aug 30, 2023
22ecb88
Turned off verbose debugging in test_s3sdk.c for now.
WardF Aug 31, 2023
99e8ff3
Add a missing include_directories invocation in CMakeLists.txt
WardF Sep 5, 2023
adfeec0
Turned on console logging/tracing.
WardF Sep 7, 2023
21d11a0
Remove explicit setting of request length, allow it to be computed au…
WardF Sep 7, 2023
973e5a3
Revert previous change; the issue appears to be correct, but the fix …
WardF Sep 8, 2023
543eeee
A few tweaks for readability.
WardF Sep 14, 2023
571fa06
Made some changes to spacing, also discovered an issue around specify…
WardF Sep 14, 2023
b5bb7d8
Correct a couple of typos.
WardF Sep 14, 2023
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
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1327,10 +1327,9 @@ ENDIF()
IF(ENABLE_S3)
IF(NOT ENABLE_S3_INTERNAL)
# See if aws-s3-sdk is available
find_package(AWSSDK REQUIRED COMPONENTS s3;core)
SET(SERVICE_COMPONENTS s3)
find_package(AWSSDK REQUIRED COMPONENTS ${SERVICE_COMPONENTS})
IF(AWSSDK_FOUND)
SET(service s3;core)
AWSSDK_DETERMINE_LIBS_TO_LINK(service AWS_LINK_LIBRARIES)
SET(ENABLE_S3_AWS ON CACHE BOOL "S3 AWS" FORCE)
ELSE()
SET(ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)
Expand Down
19 changes: 12 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,18 @@ unset enable_nczarr_s3
# Note we check for the library after checking for enable_s3
# because for some reason this fails if we unconditionally test for sdk
# and it is not available. Fix someday
S3LIBS=""
if test "x$enable_s3" = xyes ; then
# See if we have the s3 aws library
# Check for the AWS S3 SDK library
AC_LANG_PUSH([C++])
AC_SEARCH_LIBS([aws_allocator_is_valid],[aws-c-common aws-cpp-sdk-s3 aws-cpp-sdk-core], [enable_s3_aws=yes],[enable_s3_aws=no])
AC_LANG_POP
AC_LANG_PUSH([C++])
AC_CHECK_LIB([aws-c-common], [aws_string_destroy], [enable_s3_aws=yes],[enable_s3_aws=no])
if test "x$enable_s3_aws" = "xyes" ; then
S3LIBS="-laws-cpp-sdk-core -laws-cpp-sdk-s3"
fi
AC_LANG_POP
else
enable_s3_aws=no
enable_s3_aws=no
fi

AC_MSG_CHECKING([whether AWS S3 SDK library is available])
Expand All @@ -926,7 +930,7 @@ AC_MSG_RESULT($enable_s3_internal)

if test "x$enable_s3_aws" = xno && test "x$enable_s3_internal" = xno ; then
AC_MSG_WARN([No S3 library available => S3 support disabled])
enable_S3=no
enable_s3=no
fi

if test "x$enable_s3_aws" = xyes && test "x$enable_s3_internal" = xyes ; then
Expand Down Expand Up @@ -963,11 +967,12 @@ if test "x$enable_s3" = xyes ; then
fi

if test "x$enable_s3_aws" = xyes ; then
AC_DEFINE([ENABLE_S3_AWS], [1], [If true, then use aws S3 library])
LIBS="$LIBS$S3LIBS"
AC_DEFINE([ENABLE_S3_AWS], [1], [If true, then use aws S3 library])
fi

if test "x$enable_s3_internal" = xyes ; then
AC_DEFINE([ENABLE_S3_INTERNAL], [1], [If true, then use internal S3 library])
AC_DEFINE([ENABLE_S3_INTERNAL], [1], [If true, then use internal S3 library])
fi

AC_DEFINE_UNQUOTED([WITH_S3_TESTING], [$with_s3_testing], [control S3 testing.])
Expand Down
2 changes: 1 addition & 1 deletion liblib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ENDIF()

IF(ENABLE_S3_AWS)
TARGET_LINK_DIRECTORIES(netcdf PUBLIC ${AWSSDK_LIB_DIR})
TARGET_LINK_LIBRARIES(netcdf ${AWS_LINK_LIBRARIES})
SET(TLL_LIBS ${AWSSDK_LINK_LIBRARIES} ${TLL_LIBS})
ENDIF()

IF(HAVE_LIBXML2)
Expand Down
Loading