I am trying to use vg tools on my AWS Ubuntu server and it won't compile.
I followed the instructions listed here but when I get to the point where I need to build with . ./source_me.sh && make
it gives me this error:
CMake Error at test/CMakeLists.txt:54 (ADD_CUSTOM_TARGET):
ADD_CUSTOM_TARGET cannot create target "COMMAND" because another target
with the same name already exists. The existing target is a custom target
created in source directory "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test".
See documentation for policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:47 (STRING):
STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
CMake Error at test/CMakeLists.txt:49 (ADD_EXECUTABLE):
ADD_EXECUTABLE cannot create target "EXCLUDE_FROM_ALL" because another
target with the same name already exists. The existing target is an
executable created in source directory
"/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test". See documentation for
policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:54 (ADD_CUSTOM_TARGET):
ADD_CUSTOM_TARGET cannot create target "COMMAND" because another target
with the same name already exists. The existing target is a custom target
created in source directory "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test".
See documentation for policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:47 (STRING):
STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
CMake Error at test/CMakeLists.txt:49 (ADD_EXECUTABLE):
ADD_EXECUTABLE cannot create target "EXCLUDE_FROM_ALL" because another
target with the same name already exists. The existing target is an
executable created in source directory
"/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test". See documentation for
policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:54 (ADD_CUSTOM_TARGET):
ADD_CUSTOM_TARGET cannot create target "COMMAND" because another target
with the same name already exists. The existing target is a custom target
created in source directory "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test".
See documentation for policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:47 (STRING):
STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
CMake Error at test/CMakeLists.txt:49 (ADD_EXECUTABLE):
ADD_EXECUTABLE cannot create target "EXCLUDE_FROM_ALL" because another
target with the same name already exists. The existing target is an
executable created in source directory
"/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test". See documentation for
policy CMP0002 for more details.
CMake Error at test/CMakeLists.txt:54 (ADD_CUSTOM_TARGET):
ADD_CUSTOM_TARGET cannot create target "COMMAND" because another target
with the same name already exists. The existing target is a custom target
created in source directory "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/test".
See documentation for policy CMP0002 for more details.
-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/vg-v1.49.0/deps/sdsl-lite/build/CMakeFiles/CMakeError.log".
ERROR: CMake build failed.
make: *** [Makefile:548: lib/libsdsl.a] Error 1
This is a cut off of the entire message but it basically repeats itself multiple times; if someone needs to see the entire error please let me know. I don't understand what it means - if someone can explain it and a potential solution that would be great!
Which CMake / compiler / Ubuntu / kernel versions are you using? Is this a fresh Ubuntu instance or something you have already been using for a while?
Usually a fresh Ubuntu virtual machine is the easiest environment for compiling vg. The more things you install, the more likely it becomes that you get conflicts with something needed by vg.
I've been using this Ubuntu instance for a couple of months now.
The version of Ubuntu is 22.04.1 LTS (GNU/Linux 5.19.0-1028-aws x86_64) with CMake v3.22.1.
I'll try setting up a fresh Ubuntu instance today and see if that helps!
I encountered a similar error on the OpenEuler system. I don't know how to solve these problems.
I think the problem is caused by sdsl-lite, which seems to be an incompatibility issue due to the high version of cmake. I checked the sdsl github library and found that it hasn't been updated in a long time. But does anyone have another way?
I found a solution. Maybe I can give it a try. Download the latest sdsl-lite from this URL (https://github.com/vgteam/sdsl-lite/releases/tag/v2.3.1-vgteam), then unzip and replace the contents in vg/deps/sdsl-lite to solve the problem.