Skip to content

Commit

Permalink
Fix for SSL detection in f2py (3.4 branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Oct 19, 2021
1 parent a06a230 commit 9834c1d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Added

## [3.4.7] - 2021-Oct-19

### Fixed

- Attempt to detect SSL library path and use that with f2py

## [3.4.6] - 2021-Sep-23

### Added
Expand Down
16 changes: 16 additions & 0 deletions UseF2Py.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ macro (add_f2py_module _name)
if (_lib MATCHES "esmf\.a")
set (_lib esmf)
endif ()

# Tests on Calculon showed that the wrong libssl (from python) was being linked to
# This code tries to insert in the system SSL path. Might not always work but its
# seems to
if(NOT APPLE)
if(_lib STREQUAL "ssl")
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
get_filename_component(OPENSSL_LIBRARY_DIR "${OPENSSL_SSL_LIBRARY}" DIRECTORY)
list(APPEND _lib_opts "-L${OPENSSL_LIBRARY_DIR}")
else()
message(FATAL_ERROR "SSL REQUIRED for but not found")
endif()
endif()
endif()

list(APPEND _lib_opts "-l${_lib}")
endforeach(_lib)

Expand Down
16 changes: 16 additions & 0 deletions UseF2Py2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ macro (add_f2py2_module _name)
if (_lib MATCHES "esmf\.a")
set (_lib esmf)
endif ()

# Tests on Calculon showed that the wrong libssl (from python) was being linked to
# This code tries to insert in the system SSL path. Might not always work but its
# seems to
if(NOT APPLE)
if(_lib STREQUAL "ssl")
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
get_filename_component(OPENSSL_LIBRARY_DIR "${OPENSSL_SSL_LIBRARY}" DIRECTORY)
list(APPEND _lib_opts "-L${OPENSSL_LIBRARY_DIR}")
else()
message(FATAL_ERROR "SSL REQUIRED for but not found")
endif()
endif()
endif()

list(APPEND _lib_opts "-l${_lib}")
endforeach(_lib)

Expand Down
16 changes: 16 additions & 0 deletions UseF2Py3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ macro (add_f2py3_module _name)
if (_lib MATCHES "esmf\.a")
set (_lib esmf)
endif ()

# Tests on Calculon showed that the wrong libssl (from python) was being linked to
# This code tries to insert in the system SSL path. Might not always work but its
# seems to
if(NOT APPLE)
if(_lib STREQUAL "ssl")
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
get_filename_component(OPENSSL_LIBRARY_DIR "${OPENSSL_SSL_LIBRARY}" DIRECTORY)
list(APPEND _lib_opts "-L${OPENSSL_LIBRARY_DIR}")
else()
message(FATAL_ERROR "SSL REQUIRED for but not found")
endif()
endif()
endif()

list(APPEND _lib_opts "-l${_lib}")
endforeach(_lib)

Expand Down

0 comments on commit 9834c1d

Please sign in to comment.