TileDB icon indicating copy to clipboard operation
TileDB copied to clipboard

Compiling tiledb examples results in an import error

Open royassis opened this issue 3 years ago • 18 comments

Running tiledb examples results in an error: What am I missing ?

wsl

error:

(tiledbenv) roy@LP-0209:~/TileDB/examples/c_api$ gcc quickstart_dense.c
quickstart_dense.c:35:10: fatal error: tiledb/tiledb.h: No such file or directory
   35 | #include <tiledb/tiledb.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

tiledb version:

(tiledbenv) roy@LP-0209:/mnt/c/Users/roya$ conda list | grep tiledb
# packages in environment at /home/roy/anaconda3/envs/tiledbenv:
tiledb                    2.3.3                h1132f93_2

os version:

(tiledbenv) roy@LP-0209:/mnt/c/Users/roya$ uname -a
Linux LP-0209 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

gcc version:

(tiledbenv) roy@LP-0209:~/TileDB/examples/c_api$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

windows 10

error:

(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> gcc .\quickstart_dense.c
.\quickstart_dense.c:35:10: fatal error: tiledb/tiledb.h: No such file or directory
   35 | #include <tiledb/tiledb.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

tiledb version:

(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> conda list | grep tiledb

# packages in environment at C:\Users\roya\Anaconda3\envs\tiledbenv:
tiledb                    2.10.3               h5689973_0    conda-forge

os version:

(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> (Get-WmiObject Win32_OperatingSystem).Caption
Microsoft Windows 10 Pro

gcc version:

(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> gcc --version
gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

royassis avatar Aug 05 '22 20:08 royassis

Hi @royassis and thanks for opening an issue. Can I ask if and how you have TileDB installed? There are different (documented) way to do that, I have to install from source and into `/usr/local/ so for me it works without -I and -L flags:

edd@rob:~/git/tiledb/examples/c_api(dev)$ gcc -o quickstart_dense quickstart_dense.c -ltiledb
edd@rob:~/git/tiledb/examples/c_api(dev)$ ./quickstart_dense 
2 3 4 6 7 8 
edd@rob:~/git/tiledb/examples/c_api(dev)$ 

Your use signals that you lacked also the link instruction, -ltiledb, that possibly needs a -L. The tiledb 2.3.3 package you have installed may just be the run-time package allowinig, say, tiledb-py to work. To compile you may need a package tiledb-devel or libtile-dev or ... (I am not too famililar with what anaconda may call that).

Let us know if we can help in other ways,

eddelbuettel avatar Aug 05 '22 20:08 eddelbuettel

Hey @eddelbuettel i'm installing with this command

conda install -c conda-forge tiledb

That's what I saw they wrote in the readme(https://github.com/TileDB-Inc/TileDB#readme). Do I need to build from source ?

p.s

gcc -o quickstart_dense quickstart_dense.c -ltiledb

Gives the same error

royassis avatar Aug 05 '22 20:08 royassis

I think that installs only the Python package, also named tiledb, whereas you attempted to use the C++ examples. Python has its own examples: https://github.com/TileDB-Inc/TileDB-Py/tree/dev/examples

Conversely, if you want C++ instead, maybe try the installation instructions for C++: https://docs.tiledb.com/main/how-to/installation

eddelbuettel avatar Aug 05 '22 20:08 eddelbuettel

Hey @eddelbuettel . This is from the link. I don't know what to do.

image

royassis avatar Aug 05 '22 21:08 royassis

Also, consider coming over to our Slack and jumping into either the #tiledb-embedded (for C++) or #tiledb-py channel. See bottom our home page or use this link.

eddelbuettel avatar Aug 05 '22 21:08 eddelbuettel

Also, consider coming over to our Slack and jumping into either the #tiledb-embedded (for C++) or #tiledb-py channel. See bottom our home page or use this link.

Alright @eddelbuettel

royassis avatar Aug 05 '22 21:08 royassis

You followed the Python installation instructions. They allow you to run the Python code. They do not allow you to compile C++ snippets (and that is common feature among almost all software projects).

eddelbuettel avatar Aug 05 '22 21:08 eddelbuettel

Thanks !

royassis avatar Aug 05 '22 21:08 royassis

Hey @eddelbuettel . This is from the link. I don't know what to do.

image

The tab says its c/c++

I can't find the instructions to install the binaries for c/c++

royassis avatar Aug 05 '22 21:08 royassis

It's been pointed out to me by a colleague that we indeed point to Conda for C++ use, which may be a little non-standard and surprising to me. So I will let my colleagues take it from there then.

eddelbuettel avatar Aug 05 '22 21:08 eddelbuettel

It's been pointed out to me by a colleague that we indeed point to Conda for C++ use, which may be a little non-standard and surprising to me. So I will let my colleagues take it from there then.

@eddelbuettel Thank you very much. I've been trying for a couple of hours to run the examples in go/c on multiple platforms without success. Also on the docker images.

royassis avatar Aug 05 '22 21:08 royassis

Hi @royassis, sorry, to clarify -- that is the correct package for libtiledb from conda. However, building the examples against a separately installed libtiledb requires a few extra steps to set up paths for the compiler.

It might be more straightforward to build from source: https://docs.tiledb.com/main/how-to/installation/building-from-source/c-cpp

After the initial make build step there, you can skip make check and just run make examples as indicated on the bottom of that page. The example binaries will be built in tiledb/examples/cpp_api or tiledb/examples/c_api.

ihnorton avatar Aug 05 '22 21:08 ihnorton

@royassis Sorry again for being plum-eyed there. I didn't expect Conda under C++, and that's on me.

The possibly quickest way to building an example may be Docker. I just (re-)pulled tiledb/tiledb and then from the directoy (on my local disk) containing the C API example:

edd@rob:~/git/tiledb/examples/c_api(dev)$ docker run --rm -ti -v $PWD:/dkr -w /dkr tiledb/tiledb
tiledb@b674fcae5987:/dkr$ gcc -o quickstart_dense quickstart_dense.c -ltiledb
tiledb@b674fcae5987:/dkr$ ./quickstart_dense 
2 3 4 6 7 8 
tiledb@b674fcae5987:/dkr$ 

eddelbuettel avatar Aug 05 '22 21:08 eddelbuettel

@royassis Sorry again for being plum-eyed there. I didn't expect Conda under C++, and that's on me.

The possibly quickest way to building an example may be Docker. I just (re-)pulled tiledb/tiledb and then from the directoy (on my local disk) containing the C API example:

edd@rob:~/git/tiledb/examples/c_api(dev)$ docker run --rm -ti -v $PWD:/dkr -w /dkr tiledb/tiledb
tiledb@b674fcae5987:/dkr$ gcc -o quickstart_dense quickstart_dense.c -ltiledb
tiledb@b674fcae5987:/dkr$ ./quickstart_dense 
2 3 4 6 7 8 
tiledb@b674fcae5987:/dkr$ 

@eddelbuettel It works !

I still haven't tried building from source. But i tried using Pre-built Packages. from the docs: https://docs.tiledb.com/main/how-to/installation/pre-built-packages There seems to be some errors as well.

royassis avatar Aug 05 '22 21:08 royassis

Hey @eddelbuettel I'm trying to build from source using https://docs.tiledb.com/main/how-to/installation/building-from-source/c-cpp , and im getting these errors:

(scanpyEnv3.8) roya@royassis-base:/tmp/TileDB/build$ ../bootstrap
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Starting TileDB superbuild.
-- Found Bzip2: /usr/lib/x86_64-linux-gnu/libbz2.so
-- Could NOT find LZ4 (missing: LZ4_LIBRARIES LZ4_INCLUDE_DIR)
-- Adding LZ4 as an external project
CMake Warning (dev) at /usr/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/Modules/FindLZ4_EP.cmake:84 (ExternalProject_Add)
  cmake/TileDB-Superbuild.cmake:85 (include)
  CMakeLists.txt:187 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find spdlog (missing: spdlog_DIR)
-- Adding spdlog as an external project
CMake Warning (dev) at /usr/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/Modules/FindSpdlog_EP.cmake:68 (ExternalProject_Add)
  cmake/TileDB-Superbuild.cmake:86 (include)
  CMakeLists.txt:187 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found Zlib, adding imported target: /usr/lib/x86_64-linux-gnu/libz.so
-- Could NOT find Zstd (missing: ZSTD_LIBRARIES ZSTD_INCLUDE_DIR)
-- Adding Zstd as an external project
CMake Warning (dev) at /usr/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/Modules/FindZstd_EP.cmake:88 (ExternalProject_Add)
  cmake/TileDB-Superbuild.cmake:88 (include)
  CMakeLists.txt:187 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Adding Magic as an external project
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "1.1.1", minimum required is "1.1.0")
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so -- OpenSSL crypto: /usr/lib/x86_64-linux-gnu/libcrypto.so -- root: /tmp/TileDB/build/externals/install;/usr/local/opt/openssl
-- searching for catch in /tmp/TileDB/build/externals/src
-- Could NOT find Catch2 (missing: CATCH_INCLUDE_DIR)
-- Adding Catch as an external project
CMake Warning (dev) at /usr/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  cmake/Modules/FindCatch_EP.cmake:56 (ExternalProject_Add)
  cmake/TileDB-Superbuild.cmake:122 (include)
  CMakeLists.txt:187 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Not found clang-tidy
-- Not found clang-format
-- was unable to find clang-format
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Install prefix is /tmp/TileDB/dist
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/TileDB/build
bootstrap success. Run "make" to build, "make check" to test, or "make -C tiledb install" to install.
(scanpyEnv3.8) roya@royassis-base:/tmp/TileDB/build$ make -j 1
[  2%] Creating directories for 'ep_lz4'
[  4%] Performing download step (download, verify and extract) for 'ep_lz4'
-- ep_lz4 download command succeeded.  See also /tmp/TileDB/build/externals/src/ep_lz4-stamp/ep_lz4-download-*.log
[  6%] No update step for 'ep_lz4'
[  8%] No patch step for 'ep_lz4'
[ 10%] Performing configure step for 'ep_lz4'
-- ep_lz4 configure command succeeded.  See also /tmp/TileDB/build/externals/src/ep_lz4-stamp/ep_lz4-configure-*.log
[ 12%] Performing build step for 'ep_lz4'
-- ep_lz4 build command succeeded.  See also /tmp/TileDB/build/externals/src/ep_lz4-stamp/ep_lz4-build-*.log
[ 14%] Performing install step for 'ep_lz4'
-- ep_lz4 install command succeeded.  See also /tmp/TileDB/build/externals/src/ep_lz4-stamp/ep_lz4-install-*.log
[ 16%] Completed 'ep_lz4'
[ 16%] Built target ep_lz4
[ 18%] Creating directories for 'ep_spdlog'
[ 20%] Performing download step (download, verify and extract) for 'ep_spdlog'
-- ep_spdlog download command succeeded.  See also /tmp/TileDB/build/externals/src/ep_spdlog-stamp/ep_spdlog-download-*.log
[ 22%] No update step for 'ep_spdlog'
[ 25%] Performing patch step for 'ep_spdlog'
patching file include/spdlog/logger-inl.h
[ 27%] Performing configure step for 'ep_spdlog'
-- ep_spdlog configure command succeeded.  See also /tmp/TileDB/build/externals/src/ep_spdlog-stamp/ep_spdlog-configure-*.log
[ 29%] Performing build step for 'ep_spdlog'
-- ep_spdlog build command succeeded.  See also /tmp/TileDB/build/externals/src/ep_spdlog-stamp/ep_spdlog-build-*.log
[ 31%] Performing install step for 'ep_spdlog'
-- ep_spdlog install command succeeded.  See also /tmp/TileDB/build/externals/src/ep_spdlog-stamp/ep_spdlog-install-*.log
[ 33%] Completed 'ep_spdlog'
[ 33%] Built target ep_spdlog
[ 35%] Creating directories for 'ep_zstd'
[ 37%] Performing download step (download, verify and extract) for 'ep_zstd'
-- ep_zstd download command succeeded.  See also /tmp/TileDB/build/externals/src/ep_zstd-stamp/ep_zstd-download-*.log
[ 39%] No update step for 'ep_zstd'
[ 41%] No patch step for 'ep_zstd'
[ 43%] Performing configure step for 'ep_zstd'
-- ep_zstd configure command succeeded.  See also /tmp/TileDB/build/externals/src/ep_zstd-stamp/ep_zstd-configure-*.log
[ 45%] Performing build step for 'ep_zstd'
-- ep_zstd build command succeeded.  See also /tmp/TileDB/build/externals/src/ep_zstd-stamp/ep_zstd-build-*.log
[ 47%] Performing install step for 'ep_zstd'
-- ep_zstd install command succeeded.  See also /tmp/TileDB/build/externals/src/ep_zstd-stamp/ep_zstd-install-*.log
[ 50%] Completed 'ep_zstd'
[ 50%] Built target ep_zstd
[ 52%] Creating directories for 'ep_magic'
[ 54%] Performing download step (git clone) for 'ep_magic'
-- ep_magic download command succeeded.  See also /tmp/TileDB/build/externals/src/ep_magic-stamp/ep_magic-download-*.log
[ 56%] No update step for 'ep_magic'
[ 58%] No patch step for 'ep_magic'
[ 60%] Performing configure step for 'ep_magic'
-- ep_magic configure command succeeded.  See also /tmp/TileDB/build/externals/src/ep_magic-stamp/ep_magic-configure-*.log
[ 62%] Performing build step for 'ep_magic'
-- ep_magic build command succeeded.  See also /tmp/TileDB/build/externals/src/ep_magic-stamp/ep_magic-build-*.log
[ 64%] Performing install step for 'ep_magic'
-- ep_magic install command succeeded.  See also /tmp/TileDB/build/externals/src/ep_magic-stamp/ep_magic-install-*.log
[ 66%] Completed 'ep_magic'
[ 66%] Built target ep_magic
[ 68%] Creating directories for 'ep_catch'
[ 70%] Performing download step (download, verify and extract) for 'ep_catch'
-- ep_catch download command succeeded.  See also /tmp/TileDB/build/externals/src/ep_catch-stamp/ep_catch-download-*.log
[ 72%] No update step for 'ep_catch'
[ 75%] No patch step for 'ep_catch'
[ 77%] No configure step for 'ep_catch'
[ 79%] No build step for 'ep_catch'
[ 81%] No install step for 'ep_catch'
[ 83%] Completed 'ep_catch'
[ 83%] Built target ep_catch
[ 85%] Creating directories for 'tiledb'
[ 87%] No download step for 'tiledb'
[ 89%] No update step for 'tiledb'
[ 91%] No patch step for 'tiledb'
[ 93%] Performing configure step for 'tiledb'
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Starting TileDB regular build.
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- searching for catch in /tmp/TileDB/build/externals/src
-- Found Catch2: /tmp/TileDB/build/externals/src/ep_catch/single_include/catch2
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- Found Bzip2: /usr/lib/x86_64-linux-gnu/libbz2.so
-- Found LZ4: /tmp/TileDB/build/externals/install/lib/liblz4.a
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found Zlib, adding imported target: /usr/lib/x86_64-linux-gnu/libz.so
-- Found Zstd: /tmp/TileDB/build/externals/install/lib/libzstd.a
-- searching for catch in /tmp/TileDB/build/externals/src
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "1.1.1", minimum required is "1.1.0")
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so -- OpenSSL crypto: /usr/lib/x86_64-linux-gnu/libcrypto.so -- root: /tmp/TileDB/build/externals/install;/usr/local/opt/openssl
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so -- OpenSSL crypto: /usr/lib/x86_64-linux-gnu/libcrypto.so -- root: /tmp/TileDB/build/externals/install;/usr/local/opt/openssl
-- Found libmagic: /tmp/TileDB/build/externals/install/lib/liblibmagic.a
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- The TileDB library is compiled with stats enabled.
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so -- OpenSSL crypto: /usr/lib/x86_64-linux-gnu/libcrypto.so -- root: /tmp/TileDB/build/externals/install;/usr/local/opt/openssl
-- Found Zlib, adding imported target: /usr/lib/x86_64-linux-gnu/libz.so
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- searching for catch in /tmp/TileDB/build/externals/src
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/TileDB/build/tiledb
[ 95%] Performing build step for 'tiledb'
[  0%] Generating /tmp/TileDB/build/externals/install/include/magic_mgc_gzipped.bin
[  0%] Built target gen_mgc_unarch
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/heap_memory.cc.o
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/heap_profiler.cc.o
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/logger.cc.o
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/memory.cc.o
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/stdx_string.cc.o
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/interval/interval.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/types/dynamic_typed_datum.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array/array.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array/array_directory.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array/consistency.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/array_schema.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/array_schema_evolution.cc.o
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/attribute.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/dimension.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/dimension_label_schema.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/dimension_label_reference.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/array_schema/domain.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/dimension_label/dimension_label.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/buffer/buffer.cc.o
[  5%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/buffer/buffer_list.cc.o
[  7%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/api_argument_validator.cc.o
[  7%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb.cc.o
[  7%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_filestore.cc.o
[  7%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc: In function ‘int32_t tiledb::common::detail::tiledb_group_get_member_by_name(tiledb_ctx_t*, tiledb_group_t*, const char*, char**, tiledb_object_t*)’:
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc:481:47: error: unused variable ‘name_str’ [-Werror=unused-variable]
     auto&& [st, uri_str, object_type, name_str] =
                                               ^
cc1plus: all warnings being treated as errors
tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/build.make:397: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o' failed
make[5]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o] Error 1
CMakeFiles/Makefile2:1264: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all' failed
make[4]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/tiledb.dir/build.make:85: recipe for target 'tiledb-prefix/src/tiledb-stamp/tiledb-build' failed
make[2]: *** [tiledb-prefix/src/tiledb-stamp/tiledb-build] Error 2
CMakeFiles/Makefile2:230: recipe for target 'CMakeFiles/tiledb.dir/all' failed
make[1]: *** [CMakeFiles/tiledb.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
(scanpyEnv3.8) roya@royassis-base:/tmp/TileDB/build$ make install-tiledb
[  0%] Generating /tmp/TileDB/build/externals/install/include/magic_mgc_gzipped.bin
[  0%] Built target gen_mgc_unarch
Consolidate compiler generated dependencies of target TILEDB_CORE_OBJECTS
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc: In function ‘int32_t tiledb::common::detail::tiledb_group_get_member_by_name(tiledb_ctx_t*, tiledb_group_t*, const char*, char**, tiledb_object_t*)’:
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc:481:47: error: unused variable ‘name_str’ [-Werror=unused-variable]
     auto&& [st, uri_str, object_type, name_str] =
                                               ^
cc1plus: all warnings being treated as errors
tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/build.make:397: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o' failed
make[6]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o] Error 1
CMakeFiles/Makefile2:1264: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all' failed
make[5]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make[4]: *** [all] Error 2
CMakeFiles/install-tiledb.dir/build.make:70: recipe for target 'CMakeFiles/install-tiledb' failed
make[3]: *** [CMakeFiles/install-tiledb] Error 2
CMakeFiles/Makefile2:256: recipe for target 'CMakeFiles/install-tiledb.dir/all' failed
make[2]: *** [CMakeFiles/install-tiledb.dir/all] Error 2
CMakeFiles/Makefile2:263: recipe for target 'CMakeFiles/install-tiledb.dir/rule' failed
make[1]: *** [CMakeFiles/install-tiledb.dir/rule] Error 2
Makefile:202: recipe for target 'install-tiledb' failed
make: *** [install-tiledb] Error 2
(scanpyEnv3.8) roya@royassis-base:/tmp/TileDB/build$ make check
[  0%] Generating /tmp/TileDB/build/externals/install/include/magic_mgc_gzipped.bin
[  0%] Built target gen_mgc_unarch
Consolidate compiler generated dependencies of target TILEDB_CORE_OBJECTS
[  0%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc: In function ‘int32_t tiledb::common::detail::tiledb_group_get_member_by_name(tiledb_ctx_t*, tiledb_group_t*, const char*, char**, tiledb_object_t*)’:
/tmp/TileDB/tiledb/sm/c_api/tiledb_group.cc:481:47: error: unused variable ‘name_str’ [-Werror=unused-variable]
     auto&& [st, uri_str, object_type, name_str] =
                                               ^
cc1plus: all warnings being treated as errors
tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/build.make:397: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o' failed
make[7]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/sm/c_api/tiledb_group.cc.o] Error 1
CMakeFiles/Makefile2:1264: recipe for target 'tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all' failed
make[6]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all] Error 2
CMakeFiles/Makefile2:6834: recipe for target 'test/CMakeFiles/check.dir/rule' failed
make[5]: *** [test/CMakeFiles/check.dir/rule] Error 2
Makefile:2610: recipe for target 'check' failed
make[4]: *** [check] Error 2
CMakeFiles/check.dir/build.make:70: recipe for target 'CMakeFiles/check' failed
make[3]: *** [CMakeFiles/check] Error 2
CMakeFiles/Makefile2:308: recipe for target 'CMakeFiles/check.dir/all' failed
make[2]: *** [CMakeFiles/check.dir/all] Error 2
CMakeFiles/Makefile2:315: recipe for target 'CMakeFiles/check.dir/rule' failed
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
Makefile:228: recipe for target 'check' failed
make: *** [check] Error 2
(scanpyEnv3.8) roya@royassis-base:/tmp/TileDB/build$

royassis avatar Aug 06 '22 18:08 royassis

TileDB uses the C++17 standard so you may have to ensure you have recent enough compiler. gcc/g++ 7.5.0 is a bit dated.

Also as mentioned before, we have a community slack which you may find helpful. These github issue tickets may not be the best place for technical support.

eddelbuettel avatar Aug 06 '22 18:08 eddelbuettel

Running tiledb examples results in an error:

What am I missing ?

wsl

error:


(tiledbenv) roy@LP-0209:~/TileDB/examples/c_api$ gcc quickstart_dense.c

quickstart_dense.c:35:10: fatal error: tiledb/tiledb.h: No such file or directory

   35 | #include <tiledb/tiledb.h>

      |          ^~~~~~~~~~~~~~~~~

compilation terminated.

tiledb version:


(tiledbenv) roy@LP-0209:/mnt/c/Users/roya$ conda list | grep tiledb

# packages in environment at /home/roy/anaconda3/envs/tiledbenv:

tiledb                    2.3.3                h1132f93_2

os version:


(tiledbenv) roy@LP-0209:/mnt/c/Users/roya$ uname -a

Linux LP-0209 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

gcc version:


(tiledbenv) roy@LP-0209:~/TileDB/examples/c_api$ gcc --version

gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0

Copyright (C) 2019 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

windows 10

error:


(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> gcc .\quickstart_dense.c

.\quickstart_dense.c:35:10: fatal error: tiledb/tiledb.h: No such file or directory

   35 | #include <tiledb/tiledb.h>

      |          ^~~~~~~~~~~~~~~~~

compilation terminated.

tiledb version:


(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> conda list | grep tiledb



# packages in environment at C:\Users\roya\Anaconda3\envs\tiledbenv:

tiledb                    2.10.3               h5689973_0    conda-forge

os version:


(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> (Get-WmiObject Win32_OperatingSystem).Caption

Microsoft Windows 10 Pro

gcc version:


(tiledbenv) PS C:\Users\roya\Downloads\TileDB\examples\c_api> gcc --version

gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0

Copyright (C) 2021 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

it's easy to solve the error. you should tell gcc where your tiledb's include and lib. you can write the info to your cmake file and build it so easily to run the example @royassis @eddelbuettel

JWleo avatar Aug 12 '22 17:08 JWleo

You need to ensure you have headers (use a -I... switch as needed) and link as well (and use -L... as needed:

edd@rob:~/git/tiledb/examples/cpp_api(dev)$ g++ -std=c++17 quickstart_dense.cc -o qsd -ltiledb
edd@rob:~/git/tiledb/examples/cpp_api(dev)$ ./qsd
2 3 4 6 7 8 
edd@rob:~/git/tiledb/examples/cpp_api(dev)$ 

I install into /usr/local so I need neither.

edd@rob:~/git/tiledb/examples/cpp_api(dev)$ ls -ld /usr/local/include/tiledb /usr/local/lib/libtiledb.so
drwxr-xr-x 3 root root 4096 Aug 10 17:53 /usr/local/include/tiledb
lrwxrwxrwx 1 root root   17 Jul 14 07:57 /usr/local/lib/libtiledb.so -> libtiledb.so.2.12
edd@rob:~/git/tiledb/examples/cpp_api(dev)$ 

See our documentation at the website for more, and maybe ask on the community Slack we offer.

eddelbuettel avatar Aug 12 '22 17:08 eddelbuettel

Please ping if further follow-up is needed, and we can reopen.

ihnorton avatar Dec 01 '22 13:12 ihnorton