manio/skymax-demo

cmake error

dansass opened this issue · 9 comments

when i wnat to run cmake .. && make it says

CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt.

and i am in the skymax-demo directory

whats going on?

manio commented

You are not in skymax-demo directory :)

I think I am

Screenshot_20201005-072516_Mobile SSH

manio commented

you're right
just type cmake (without ..) and see if it helps

Still no luck :(
here are my commands that i ran

11

22

33

manio commented

what if you do:

clone [...]
cd skymax-demo
mkdir build
cd build
cmake ..
make

44

for kicks i tried;

55

Im wondering if i Maybe installed cmake wrong. It sure is acting weird

manio commented

Yeah, you probably have something wrong.
Try to clone to some other dir then your home dir, like /tmp
For me it is working no matter if i do "cmake . " in main dir, or "cmake .." in build subdir:

/tmp/skymax-demo/build/ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/skymax-demo/build

Hello,

thanks for the awesome software work 👯‍♀️

please update build instructions: like this:

# -1) tested on 
hostnamectrl; # Debian GNU/Linux 11 (bullseye)

# 0) have cmake installed
apt update; apt install cmake;

# 0.1) version installed
cmake --version
cmake version 3.18.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).

# 1) use https instead of ssh
git clone https://github.com/manio/skymax-demo.git

# 2) go into newly created subdir
cd skymax-demo

# 3) prepare build
cmake .

# output ought to be:

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/path/where/src/is/skymax-demo

# 4) build
make

Scanning dependencies of target inverter_poller
[ 20%] Building CXX object CMakeFiles/inverter_poller.dir/inputparser.cpp.o
[ 40%] Building CXX object CMakeFiles/inverter_poller.dir/inverter.cpp.o
/home/user/path/where/src/is/skymax-demo/inverter.cpp: In member function ‘bool cInverter::query(const char*, int)’:
/home/user/path/where/src/is/skymax-demo/inverter.cpp:114:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
  114 |         n = read(fd, (void*)buf+i, replysize-i);
      |                      ~~~~~~~~~~^~
[ 60%] Building CXX object CMakeFiles/inverter_poller.dir/main.cpp.o
[ 80%] Building CXX object CMakeFiles/inverter_poller.dir/tools.cpp.o
[100%] Linking CXX executable inverter_poller
[100%] Built target inverter_poller


# 5) run the binary program
./inverter_poller -h

USAGE:  ./inverter_poller <args> [-r <command>], [-h | --help], [-1 | --run-once]

SUPPORTED ARGUMENTS:
          -r <raw-command>      TX 'raw' command to the inverter
          -h | --help           This Help Message
          -1 | --run-once       Runs one iteration on the inverter, and then exits
          -d                    Additional debugging

RAW COMMAND EXAMPLES (see protocol manual for complete list):
Set output source priority  POP00     (Utility first)
                            POP01     (Solar first)
                            POP02     (SBU)
Set charger priority        PCP00     (Utility first)
                            PCP01     (Solar first)
                            PCP02     (Solar and utility)
                            PCP03     (Solar only)
Set other commands          PEa / PDa (Enable/disable buzzer)
                            PEb / PDb (Enable/disable overload bypass)
                            PEj / PDj (Enable/disable power saving)
                            PEu / PDu (Enable/disable overload restart)
                            PEx / PDx (Enable/disable backlight)


manio commented

This is already covered in #17
Closing this three-years old issue.