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

install TARGETS given no ARCHIVE DESTINATION for static library target CSF #39

Open
TheAdamP opened this issue Sep 6, 2021 · 9 comments

Comments

@TheAdamP
Copy link

TheAdamP commented Sep 6, 2021

Hey might be a stupid question but trying to build on Linux gives me this error:
CMake Error at src/CMakeLists.txt:31 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target "CSF".

Have I missed an obvious step in the installation? I just downloaded file made a build directory then tried to cmake.

@Crghilardi
Copy link
Contributor

Need some more info, what was the exact cmake command you ran?

@TheAdamP
Copy link
Author

TheAdamP commented Sep 7, 2021

So I put the master folder into my build file and followed the install guide. Specifically I ran cmake CSF-master and cmake CSF-master/src whilst inside the build folder and neither worked

@Crghilardi
Copy link
Contributor

It sounds like you downloaded the zip file of the repo instead of git clone command? Either way it should work fine.
I am on Ubuntu and just pulled down a copy. Here is what works for me with some notes added. Try these

#download and unzipped from https://github.com/jianboqi/CSF/archive/refs/heads/master.zip
#show what's in the top level directory
~/Downloads$ cd CSF-master/ && ls
CMakeLists.txt  CSFDemo  LICENSE.txt  matlab  python  README.md  src

#let's do an out-of-tree build to keep build files separate
~/Downloads/CSF-master$ mkdir build
~/Downloads/CSF-master$ cd build

#call cmake with default settings, note the double period since we are in CSF-master/build and the CMake files are in CSF-master
~/Downloads/CSF-master/build$ cmake ..
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Configuring done
-- Generating done
-- Build files have been written to: /Downloads/CSF-master/build

#compile everything, default setting is making a static library
~/Downloads/CSF-master/build$ make -j4
Scanning dependencies of target CSF
[ 44%] Building CXX object src/CMakeFiles/CSF.dir/c2cdist.cpp.o
[ 44%] Building CXX object src/CMakeFiles/CSF.dir/Constraint.cpp.o
[ 44%] Building CXX object src/CMakeFiles/CSF.dir/Cloth.cpp.o
[ 44%] Building CXX object src/CMakeFiles/CSF.dir/CSF.cpp.o
[ 55%] Building CXX object src/CMakeFiles/CSF.dir/Particle.cpp.o
[ 66%] Building CXX object src/CMakeFiles/CSF.dir/point_cloud.cpp.o
[ 77%] Building CXX object src/CMakeFiles/CSF.dir/Rasterization.cpp.o
[ 88%] Building CXX object src/CMakeFiles/CSF.dir/XYZReader.cpp.o
[100%] Linking CXX static library libCSF.a
[100%] Built target CSF

@TheAdamP
Copy link
Author

TheAdamP commented Sep 7, 2021

Hi so I tried this exactly as followed and got the similar error:

adam@adam-Blade-Stealth:~/Downloads$ cd CSF-master
adam@adam-Blade-Stealth:~/Downloads/CSF-master$ mkdir build
adam@adam-Blade-Stealth:~/Downloads/CSF-master$ cd build
adam@adam-Blade-Stealth:~/Downloads/CSF-master/build$ cmake ..
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
CMake Error at src/CMakeLists.txt:31 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "CSF".


-- Configuring incomplete, errors occurred!
See also "/home/adam/Downloads/CSF-master/build/CMakeFiles/CMakeOutput.log".

I followed the steps exactly so a little unsure of whats going on, sorry I am fairly new to cmake in general. Here as well you can see everything is in place : :~/Downloads/CSF-master$ ls build CMakeLists.txt CSFDemo LICENSE.txt matlab python README.md src

@Crghilardi
Copy link
Contributor

That is strange behavior. As a quick workaround, you should be able to comment that line out in the src/CMakeLists.txt like

install(TARGETS CSF LIBRARY DESTINATION lib)
#install(TARGETS CSF ARCHIVE DESTINATION lib)
install(FILES ${CSF_HEADERS} DESTINATION include)

What version of cmake are you using? (cmake --version), I am testing on my side with 3.15.5

@TheAdamP
Copy link
Author

TheAdamP commented Sep 9, 2021

Commenting this out still gave the same error unfortunately. However commenting the line above fixed this issue, unsure if this will have an effect later on. I am running cmake 3.10.2-1

@chaohe1998
Copy link

Hello, have you solved this problem

@shuqiu0202
Copy link

install(TARGETS CSF
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES ${CSF_HEADERS} DESTINATION include)

I have same problem in ubuntu 18.04, cmake 3.10.2, gcc 7.5, change old to this can work.

@silent-zhou
Copy link

updating the version of cmake will solve your problem

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

No branches or pull requests

5 participants