Skip to content

[Build] assert identifier not found when compiling with Visual Studio #3556

Description

@edwinsolisf

The assert macro from cassert is not defined when building on Debug with MSVC2022 in the file err_common.hpp

Description

  • Additional details about the errors during the build: Build using Visual Studio 17 2022
  • What do you suspect is causing the issue?: There is no #include <cassert> in the file to include the macro
  • What operating system and/or distro are you using?: Windows
  • Versions of the packages related to this bug: Observed on 3.9

Error Log

arrayfire\src\api\c\stream.cpp(93,13): error C3861: 'assert': identifier not found

Note that stream.cpp includes err_common.hpp which defines the macro AF_ASSERT which just replaces it with assert from cassert

Build Environment

Compiler version: MSVC v170
Operating system: Windows 11
CMake variables:

AF_BUILD_CPU:BOOL=ON
AF_BUILD_CUDA:BOOL=OFF
AF_BUILD_DOCS:BOOL=ON
AF_BUILD_EXAMPLES:BOOL=ON
AF_BUILD_FORGE:BOOL=ON
AF_BUILD_ONEAPI:BOOL=OFF
AF_BUILD_OPENCL:BOOL=OFF
AF_BUILD_UNIFIED:BOOL=ON
AF_COMPUTE_LIBRARY:STRING=Intel-MKL
AF_CTEST_SEPARATED:BOOL=OFF
AF_STACKTRACE_TYPE:STRING=Windbg
AF_WITH_CUDNN:BOOL=ON
AF_WITH_EXTERNAL_PACKAGES_ONLY:BOOL=OFF
AF_WITH_FAST_MATH:BOOL=OFF
AF_WITH_FMT_HEADER_ONLY:BOOL=OFF
AF_WITH_SPDLOG_HEADER_ONLY:BOOL=OFF
AF_WITH_STATIC_CUDA_NUMERIC_LIBS:BOOL=OFF
BUILD_TESTING:BOOL=ON
CLBlast_DIR:PATH=CLBlast_DIR-NOTFOUND
CMAKE_CONFIGURATION_TYPES:STRING=Debug;MinSizeRel;Release;RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/ArrayFire
ENABLE_BLACS:BOOL=OFF
ENABLE_BLAS95:BOOL=OFF
ENABLE_CDFT:BOOL=OFF
ENABLE_CPARDISO:BOOL=OFF
ENABLE_LAPACK95:BOOL=OFF
ENABLE_OMP_OFFLOAD:BOOL=OFF
ENABLE_SCALAPACK:BOOL=OFF
FETCHCONTENT_UPDATES_DISCONNECTED_SPAN-LITE:BOOL=OFF
GTest_DIR:PATH=C:/tools/Anaconda3/Library/lib/cmake/GTest
MKL_ARCH:STRING=intel64
MKL_DIR:PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/cmake/mkl
MKL_DPCPP_ARCH:STRING=intel64
MKL_DPCPP_LINK:STRING=dynamic
MKL_H:PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/include
MKL_LINK:STRING=dynamic
MKL_THREAD_LAYER:STRING=Intel OpenMP
NVPRUNE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/bin/nvprune.exe
SYCL_LIB_DIR:FILEPATH=SYCL_LIB_DIR-NOTFOUND
SYCL_LIB_VER_CACHE:STRING=
TBB_DIR:PATH=C:/Program Files (x86)/Intel/oneAPI/tbb/2021.10.0/lib/cmake/tbb
_tbb_debug_dll:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/tbb/latest/redist/intel64/vc_mt/tbb12_debug.dll
_tbb_debug_lib:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/tbb/2021.10.0/lib/intel64/vc14/tbb12_debug.lib
_tbb_release_dll:FILEPATH=C:/tools/Anaconda3/Library/bin/tbb12.dll
_tbb_release_lib:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/tbb/2021.10.0/lib/intel64/vc14/tbb12.lib
mkl_core_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_core_dll.lib
mkl_intel_ilp64_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_intel_ilp64_dll.lib
mkl_sycld_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_sycld_dll.lib
mkl_tbb_threadd_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2023.2.0/lib/intel64/mkl_tbb_threadd_dll.lib

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions