dcgan/
CMakeLists.txt
dcgan.cpp
Further, I will refer to the path to the unzipped LibTorch distribution as /path/to/libtorch. Note that this must be an absolute path. In particular, setting CMAKE_PREFIX_PATH to something like ../../libtorch will break in unexpected ways. Instead, write $PWD/../../libtorch to get the corresponding absolute path. Now, we are ready to build our application:
root@fa350df05ecf:/home# mkdir build
root@fa350df05ecf:/home# cd build
root@fa350df05ecf:/home/build# cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch ..
if I run it from there, I get
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan/build$ cmake -DCMAKE_PREFIX_PATH=/mnt/d/computervision/libtorch
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
CMake Error: The source directory "/mnt/d/computervision/dcgan/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
so I had to go up one level, which is normal for cmake?
Actually I thought it was hanging, pressed ctrl-C and got
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan$ cmake -DCMAKE_PREFIX_PATH=/mnt/d/computervision/libtorch
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch: /mnt/d/computervision/libtorch/lib/libtorch.so
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/d/computervision/dcgan
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan$ ^C
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan$ ^C
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan$ ls
CMakeCache.txt CMakeFiles CMakeLists.txt Makefile build cmake_install.cmake dcgan.cpp
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan$ cd build
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan/build$ ls
nobu@LAPTOP-DNCQ5AAC:/mnt/d/computervision/dcgan/build$