SimpleITK installation error (Lua version 5.1 is required for SimpleITK_LUA_EXECUTABLE_VERSION)

Hi, I want to build SimpleITK manually with the installed ITK5.0 on my device. I have installed lua5.1 by compiling the source by using the following commands:

$ cd lua-5.1
$ mkdir lua_build
$ cd lua_build
$ make linux test
$ sudo make install

However, once I am running cmake …/SimpleITK, I am getting this error:

CMake Error at CMake/sitkGenerateFilterSource.cmake:51 (message):
Lua version 5.1 is required for SimpleITK_LUA_EXECUTABLE_VERSION.
Call Stack (most recent call first):
Code/BasicFilters/CMakeLists.txt:4 (include)

How can I get rid of this error even I have installed the required version of lua?

Some users have suggested to build SimpleITK by using the Superbuild, however, I have already installed required packages for SimpleITK (as mentioned in this link: https://simpleitk.readthedocs.io/en/master/Documentation/docs/source/building.html#building-simpleitk)

1 Like

Hello Sara and welcome to the ITK community!

What is the value of the CMake variable SimpleITK_LUA_EXECUTABLE? This is the Lua executable which is used for code generation and requires version 5.1.

@blowekamp Thanks for your reply, the

SimpleITK_LUA_EXECUTABLE is /usr/local/bin/lua, and the ITK version that I have in the system is /usr/local/lib/cmake/ITK-5.0.

I assume you are certain that /usr/local/bin/lua is version 5.1.

The relevant code in SimpleITK is here:


and

Hopefully you have figured the problem out and can report back.

I have just enchanted a similar problem, when I didn’t set SimpleITK_LUA_EXECUTABLE correctly. Here is me error:

-- Could NOT find Lua (missing: LUA_EXECUTABLE) 
CMake Error at CMake/sitkGenerateFilterSource.cmake:51 (message):
  Lua version 5.1 is required for SimpleITK_LUA_EXECUTABLE_VERSION.
Call Stack (most recent call first):
  Code/BasicFilters/CMakeLists.txt:4 (include)

I have included the line before which says the LUA_EXECUTABLE is missing, the error below is a symptom for the executable not being found. I will investigate if the error message can be improved, and if it follows current CMake standards.

This issue should be addressed by this pull request: https://github.com/SimpleITK/SimpleITK/pull/821