安装tasmet执行install_local.py报错:supermatrix.h未找到求助
Hey there, let's work through this frustrating "supermatrix.h not found" error you're hitting while running install_local.py for Tasmet—even after installing superlu-dev. Here are some actionable steps to try:
Verify where supermatrix.h is installed
First, let's confirm the actual location of the missing header file. On Debian/Ubuntu-based systems, run this command to list all files installed withsuperlu-dev:dpkg -L superlu-devLook for a line pointing to
supermatrix.h—it might be tucked away in a subdirectory like/usr/include/superluinstead of the root/usr/includedirectory. This is a common culprit because the compiler doesn't automatically check nested paths by default.Add the include path to your environment variables
If the header lives in a non-standard subdirectory, tell the compiler where to find it by setting theCPPFLAGSenvironment variable before runninginstall_local.py. For example, ifsupermatrix.his in/usr/include/superlu, run:export CPPFLAGS="-I/usr/include/superlu" python install_local.pyThis ensures the compiler scans that specific directory for the missing header.
Check Tasmet's build configuration
Theinstall_local.pyscript likely uses CMake under the hood. Take a quick peek at Tasmet'sCMakeLists.txtfile to see if it properly detects SuperLU. Look for lines likefind_package(SuperLU REQUIRED)—if this is missing or misconfigured, you can manually add the include path to the CMake config:include_directories(/usr/include/superlu)If you're comfortable editing the script, you can also pass this path directly to CMake via the
install_local.pyarguments.Try a specific version of SuperLU
Sometimes Tasmet relies on a specific version of SuperLU that doesn't match the latestsuperlu-devpackage in your repo. For example, if Tasmet expects SuperLU 5.x, you can try installing an older version (adjust the version number to match what's available for your system):sudo apt install superlu-dev=5.2.1+dfsg1-4Manually copy the header to a standard include directory
As a last resort, if the above steps don't work, you can manually copysupermatrix.hto a standard include path like/usr/include:sudo cp /path/to/supermatrix.h /usr/include/Note: This is a quick fix, not the cleanest long-term solution—it might cause conflicts if you update SuperLU later.
内容的提问来源于stack exchange,提问作者AnkilP

