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

make install attempts to install to system-root (/kissfft) #65

Open
JayFoxRox opened this issue May 9, 2021 · 0 comments · May be fixed by #91
Open

make install attempts to install to system-root (/kissfft) #65

JayFoxRox opened this issue May 9, 2021 · 0 comments · May be fixed by #91

Comments

@JayFoxRox
Copy link

I'm cross-compiling and getting the following:

$ make install
[...]
[100%] Linking C static library libkissfft-float.a
[100%] Built target kissfft
Install the project...
-- Install configuration: ""
-- Installing: /my-custom-toolchain-path/usr/local/lib/libkissfft-float.a
CMake Error at cmake_install.cmake:53 (file):
  file cannot create directory: /kissfft.  Maybe need administrative
  privileges.

This has to do with:

kissfft/CMakeLists.txt

Lines 104 to 110 in 8f47a67

#
# Add GNUInstallDirs for GNU infrastructure before target)include_directories
#
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND NOT CMAKE_CROSSCOMPILING)
include(GNUInstallDirs)
endif()

I'm compiling for a "Generic" system (which will probably change as the CMake support in our toolchain improves), and I'm cross-compiling. So GNUInstallDirs is not included.

This breaks the next few lines break, because CMAKE_INSTALL_INCLUDEDIR was never set:

kissfft/CMakeLists.txt

Lines 112 to 117 in 8f47a67

#
# Declare PKGINCLUDEDIR for kissfft include path
#
set(PKGINCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/kissfft")
message(STATUS "PKGINCLUDEDIR is ${PKGINCLUDEDIR}")

I think it's best to include GNUInstallDirs unconditionally. Although I'm not sure how deployment on Windows works.

It's worth noting that our toolchain is using a GNU toolchain layout with /usr/local/include (but it's also using clang in MSVC compatibility mode to compile for Windows - similar to cygwin/mingw, except it's neither of those).

chewi added a commit to chewi/kissfft that referenced this issue Dec 24, 2023
Always include it to fix cross-compiling. This should not break Windows.

Closes: mborgerding#65
@chewi chewi linked a pull request Dec 24, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant