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

failing to build tiledb 2.9.0 heap_memory.cc #3191

Closed
okanisis opened this issue May 19, 2022 · 5 comments
Closed

failing to build tiledb 2.9.0 heap_memory.cc #3191

okanisis opened this issue May 19, 2022 · 5 comments

Comments

@okanisis
Copy link

Trying to build on Arch Linux.

cmake configuration:

   cmake -B build \
         -DCMAKE_BUILD_TYPE='Release' \
         -DCMAKE_INSTALL_PREFIX="/usr" \
         -DCMAKE_INSTALL_BINDIR='bin' \
         -DCMAKE_INSTALL_DOCDIR='doc' \
         -DTILEDB_TOOLS='ON' \
         -DTILEDB_S3='ON' \
         -DTILEDB_AZURE='OFF' \
         -DTILEDB_GCS='OFF' \
         -DTILEDB_SERIALIZATION='ON' \
         -DTILEDB_VERBOSE='ON' \
         -Wno-dev

Compilation Error:

[ 90%] Performing configure step for 'tiledb'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.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.
-- The TileDB library is compiled with NEW thread pool (OFF).
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- Found Catch2: /usr/include/catch2  
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- Found Bzip2: /usr/lib/libbz2.so  
-- Found LZ4: /usr/lib/liblz4.so  
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.12") 
-- Found Zlib, adding imported target: /usr/lib/libz.so
-- Found Zstd: /usr/lib/libzstd.so  
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- Found OpenSSL: /usr/lib/libcrypto.so (found suitable version "1.1.1o", minimum required is "1.1.0")  
-- Found OpenSSL: /usr/lib/libssl.so -- OpenSSL crypto: /usr/lib/libcrypto.so -- root: /build/tiledb/src/tiledb-2.9.0/build/externals/install;/usr/local/opt/openssl
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- Found OpenSSL: /usr/lib/libssl.so -- OpenSSL crypto: /usr/lib/libcrypto.so -- root: /build/tiledb/src/tiledb-2.9.0/build/externals/install;/usr/local/opt/openssl
-- Found libmagic: /build/tiledb/src/tiledb-2.9.0/build/externals/install/lib/liblibmagic.a  
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- The TileDB library is compiled with verbosity.
-- The TileDB library is compiled with stats enabled.
-- The TileDB library is compiled with query serialization enabled.
-- Found OpenSSL: /usr/lib/libssl.so -- OpenSSL crypto: /usr/lib/libcrypto.so -- root: /build/tiledb/src/tiledb-2.9.0/build/externals/install;/usr/local/opt/openssl
-- The TileDB library is compiled with S3 support.
-- Found AWS SDK for C++, Version: 1.9.241, Install Root:/usr, Platform Prefix:, Platform Dependent Libraries: pthread;crypto;ssl;z;curl
-- Found AWS lib: aws-cpp-sdk-s3 (/usr/lib/libaws-cpp-sdk-s3.so)
-- Found AWS lib: aws-cpp-sdk-core (/usr/lib/libaws-cpp-sdk-core.so)
-- Found AWS lib: aws-c-common (/usr/lib/libaws-c-common.so)
-- Found AWS lib: aws-c-event-stream (/usr/lib/libaws-c-event-stream.so)
-- Found AWS lib: aws-checksums (/usr/lib/libaws-checksums.so)
-- Found AWS lib: aws-cpp-sdk-sts (/usr/lib/libaws-cpp-sdk-sts.so)
-- Found AWS lib: aws-cpp-sdk-identity-management (/usr/lib/libaws-cpp-sdk-identity-management.so)
-- Found CURL: /usr/lib/libcurl.so (found version "7.83.1")  
-- Found CURL: '/usr/lib/libcurl.so' (found version "")
-- Found Zlib, adding imported target: /usr/lib/libz.so
-- Found CapnProto lib: capnp
-- Found CapnProto lib: kj
-- Found CapnProto lib: capnp-json
-- 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 /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
-- searching for catch in /build/tiledb/src/tiledb-2.9.0/build/externals/src
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (Clipp) does
  not match the name of the calling package (Clipp_EP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindClipp_EP.cmake:47 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  tools/CMakeLists.txt:28 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Clipp: /build/tiledb/src/tiledb-2.9.0/build/externals/install/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /build/tiledb/src/tiledb-2.9.0/build/tiledb
[ 93%] Performing build step for 'tiledb'
make[3]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[4]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[5]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[5]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[5]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
[  2%] Generating ../../../tiledb/sm/misc/magic_mgc_gzipped.bin
make[5]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
[  2%] Built target gen_mgc_unarch
make[5]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[5]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[5]: Entering directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
[  2%] Building CXX object tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/heap_memory.cc.o
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc: In function ‘void* tiledb::common::tiledb_realloc(void*, std::size_t, const std::string&)’:
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc:93:31: error: pointer ‘p’ may be used after ‘void* realloc(void*, size_t)’ [-Werror=use-after-free]
   93 |   heap_profiler.record_dealloc(p);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc:88:39: note: call to ‘void* realloc(void*, size_t)’ here
   88 |   void* const p_realloc = std::realloc(p, size);
      |                           ~~~~~~~~~~~~^~~~~~~~~
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc: In function ‘void tiledb::common::tiledb_free(void*)’:
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc:108:31: error: pointer ‘p’ used after ‘void free(void*)’ [-Werror=use-after-free]
  108 |   heap_profiler.record_dealloc(p);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/build/tiledb/src/tiledb-2.9.0/tiledb/common/heap_memory.cc:107:7: note: call to ‘void free(void*)’ here
  107 |   free(p);
      |   ~~~~^~~
cc1plus: all warnings being treated as errors
make[5]: *** [tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/build.make:76: tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/common/heap_memory.cc.o] Error 1
make[5]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[4]: *** [CMakeFiles/Makefile2:983: tiledb/CMakeFiles/TILEDB_CORE_OBJECTS.dir/all] Error 2
make[4]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[3]: *** [Makefile:146: all] Error 2
make[3]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build/tiledb'
make[2]: *** [CMakeFiles/tiledb.dir/build.make:86: tiledb-prefix/src/tiledb-stamp/tiledb-build] Error 2
make[2]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build'
make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/tiledb.dir/all] Error 2
make[1]: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build'
make: *** [Makefile:91: all] Error 2
make: Leaving directory '/build/tiledb/src/tiledb-2.9.0/build'
@okanisis
Copy link
Author

Same error with 2.9.1

@eddelbuettel
Copy link
Contributor

Did you see #3189 about adding --disable-werror ?

@okanisis
Copy link
Author

okanisis commented Jun 2, 2022

Did you see #3189 about adding --disable-werror ?

I tried adding -Wdisable-werror and -Wno-error to the cmake configuration but I see in the output the build fails with cc1plus: all warnings being treated as errors still. So tells me it's not being applied by cmake.

@eddelbuettel
Copy link
Contributor

See the script bootstrap, the invocation you need (if done directly to cmake) is likely something like

 cmake -B build \
         -DCMAKE_BUILD_TYPE='Release' \
         -DCMAKE_INSTALL_PREFIX="/usr" \
         -DCMAKE_INSTALL_BINDIR='bin' \
         -DCMAKE_INSTALL_DOCDIR='doc' \
         -DTILEDB_TOOLS='ON' \
         -DTILEDB_S3='ON' \
         -DTILEDB_AZURE='OFF' \
         -DTILEDB_GCS='OFF' \
         -DTILEDB_SERIALIZATION='ON' \
         -DTILEDB_VERBOSE='ON' \
         -Wno-dev \
         -DTILEDB_WERROR='OFF'

and note the last line I added.

@okanisis
Copy link
Author

okanisis commented Jun 2, 2022

Duplicate of #3189

@okanisis okanisis closed this as completed Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants