libocca / occa

Portable and vendor neutral framework for parallel programming on heterogeneous platforms.
https://libocca.org
MIT License
382 stars 81 forks source link

Build failure due to ‘OCCA_MAX_ARGS’ not declared #744

Closed pdhahn closed 3 months ago

pdhahn commented 3 months ago

I just did a git pull on origin/master and now I am at commit 3cba0841b2b87678da53e0b311cb7e162d781181.

I cleaned my build area, did cmake configure / generate as usual. My cmake configuration is unchanged from my last successful build.

Build now shows this error:

# make
Consolidate compiler generated dependencies of target libocca
[  0%] Building CXX object CMakeFiles/libocca.dir/src/occa/internal/core/kernel.cpp.o
In file included from.../occa/occa-clone/include/occa/defines.hpp:8,
                 from.../occa/occa-clone/include/occa/core/kernel.hpp:9,
                 from.../occa/occa-clone/include/occa/core/device.hpp:7,
                 from.../occa/occa-clone/src/occa/internal/core/device.hpp:4,
                 from.../occa/occa-clone/src/occa/internal/core/kernel.cpp:1:
.../occa/occa-clone/src/occa/internal/core/kernel.cpp: In member function ‘void occa::modeKernel_t::assertArgumentLimit() const’:
.../occa/occa-clone/src/occa/internal/core/kernel.cpp:49:47: error: ‘OCCA_MAX_ARGS’ was not declared in this scope
   49 |                ((int) arguments.size() + 1) < OCCA_MAX_ARGS);
      |                                               ^~~~~~~~~~~~~
.../occa/occa-clone/include/occa/defines/errors.hpp:13:31: note: in definition of macro ‘OCCA_TEMPLATE_CHECK_’
   13 |     const bool isOk = (bool) (expr);                                    \
      |                               ^~~~
.../occa/occa-clone/include/occa/defines/errors.hpp:27:62: note: in expansion of macro ‘OCCA_TEMPLATE_CHECK’
   27 | #define OCCA_ERROR3(expr, filename, function, line, message) OCCA_TEMPLATE_CHECK(occa::error, expr, filename, function, line, message)
      |                                                              ^~~~~~~~~~~~~~~~~~~
.../occa/occa-clone/include/occa/defines/errors.hpp:28:62: note: in expansion of macro ‘OCCA_ERROR3’
   28 | #define OCCA_ERROR2(expr, filename, function, line, message) OCCA_ERROR3(expr, filename, function, line, message)
      |                                                              ^~~~~~~~~~~
.../occa/occa-clone/include/occa/defines/errors.hpp:29:62: note: in expansion of macro ‘OCCA_ERROR2’
   29 | #define OCCA_ERROR(message, expr)                            OCCA_ERROR2(expr, __FILE__, __PRETTY_FUNCTION__, __LINE__, message)
      |                                                              ^~~~~~~~~~~
.../occa/occa-clone/src/occa/internal/core/kernel.cpp:48:5: note: in expansion of macro ‘OCCA_ERROR’
   48 |     OCCA_ERROR("(" << name << ") Kernels can have at most [" << OCCA_MAX_ARGS << "] arguments",
      |     ^~~~~~~~~~
make[2]: *** [CMakeFiles/libocca.dir/build.make:594: CMakeFiles/libocca.dir/src/occa/internal/core/kernel.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/libocca.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

My platform is Linux Mint 21 on Intel CPU hardware with g++ version 11.4.0. This is unchanged from my last successful build.

kris-rowe commented 3 months ago

Can you check your include/occa/defines/ folder to see if there is an outdated compileDefines.hpp. This is sometimes leftover from a previous GNUMake build but is in the .gitignore and can cause headaches in subsequent CMake builds.

I will open an issue to remove this file when make clean is called and delete it from the .gitignore since it has caused headaches for several people recently.

pdhahn commented 3 months ago

Yes removing this file cured the issue. Thanks!