Skip to content

Commit

Permalink
Debug spatialite
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBolibar committed Aug 2, 2024
1 parent 9b465a9 commit 7ee4095
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/setup/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,23 @@ function load_libxml()
end

function load_spatialite()
lib_paths = [
joinpath(root_dir, ".CondaPkg/env/lib/libspatialite.so"),
joinpath(root_dir, ".CondaPkg/env/lib/libspatialite.so.8"),
joinpath(root_dir, ".CondaPkg/env/lib/libspatialite.so.8.1.0")
]
for lib in lib_paths
if isfile(lib)
try
dlopen(lib)
println("Opened $lib")
catch e
println("Failed to load $lib: $e")
end
lib_dir = joinpath(root_dir, ".CondaPkg/env/lib")

# Find all libspatialite files in the directory
lib_files = filter(f -> startswith(f, "libspatialite") && (endswith(f, ".so") || contains(f, ".so.")), readdir(lib_dir))

if isempty(lib_files)
println("No libspatialite files found in $lib_dir")
return
end

for lib_file in lib_files
lib_path = joinpath(lib_dir, lib_file)
try
dlopen(lib_path)
println("Opened $lib_path")
catch e
println("Failed to load $lib_path: $e")
end
end
end
Expand Down

0 comments on commit 7ee4095

Please sign in to comment.