oyama / pico-sqlite

SQLite for Raspberry Pi Pico
Other
4 stars 1 forks source link

Build of project fails #1

Closed DeeJay closed 5 months ago

DeeJay commented 5 months ago

Build of project fails

Transcript -

david@rp54bw64full0512:~/Projects/pslite $ 
david@rp54bw64full0512:~/Projects/pslite $ git clone https://github.com/oyama/pico-sqlite.git
Cloning into 'pico-sqlite'...
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 51 (delta 20), reused 43 (delta 16), pack-reused 0
Receiving objects: 100% (51/51), 2.65 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (20/20), done.
david@rp54bw64full0512:~/Projects/pslite $ 
david@rp54bw64full0512:~/Projects/pslite $ cd pico-sqlite/
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite $ git submodule update --init --recursive
Submodule 'vendor/pico-vfs' (https://github.com/oyama/pico-vfs.git) registered for path 'vendor/pico-vfs'
Cloning into '/home/david/Projects/pslite/pico-sqlite/vendor/pico-vfs'...
Submodule path 'vendor/pico-vfs': checked out '4fbf8bff556e1d45d916c9300b8366a7807021d0'
Submodule 'vendor/littlefs' (https://github.com/littlefs-project/littlefs.git) registered for path 'vendor/pico-vfs/vendor/littlefs'
Cloning into '/home/david/Projects/pslite/pico-sqlite/vendor/pico-vfs/vendor/littlefs'...
Submodule path 'vendor/pico-vfs/vendor/littlefs': checked out 'd01280e64934a09ba16cac60cf9d3a37e228bb66'
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite $ mkdir build
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite $ cd build
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ echo $PICO_SDK_PATH
/home/david/Projects/sdk/pico/pico-sdk
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ cmake ..
Using PICO_SDK_PATH from environment ('/home/david/Projects/sdk/pico/pico-sdk')
PICO_SDK_PATH is /home/david/Projects/sdk/pico/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - 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/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type is Release
Defaulting PICO target board to pico since not specified.
Using board configuration from /home/david/Projects/sdk/pico/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3 (found version "3.11.2") found components: Interpreter 
TinyUSB available at /home/david/Projects/sdk/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at /home/david/Projects/sdk/pico/pico-sdk/lib/btstack
cyw43-driver available at /home/david/Projects/sdk/pico/pico-sdk/lib/cyw43-driver
Pico W Bluetooth build support available.
lwIP available at /home/david/Projects/sdk/pico/pico-sdk/lib/lwip
mbedtls available at /home/david/Projects/sdk/pico/pico-sdk/lib/mbedtls
Using PICO_EXAMPLES_PATH from environment ('/home/david/Projects/sdk/pico/pico-examples')
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/Projects/pslite/pico-sqlite/build
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ make 
[  0%] Creating directories for 'ELF2UF2Build'
[  0%] No download step for 'ELF2UF2Build'
[  0%] No update step for 'ELF2UF2Build'
[  0%] No patch step for 'ELF2UF2Build'
[  0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/Projects/pslite/pico-sqlite/build/elf2uf2
[  0%] Performing build step for 'ELF2UF2Build'
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
[100%] Built target elf2uf2
[  4%] No install step for 'ELF2UF2Build'
[  4%] Completed 'ELF2UF2Build'
[  4%] Built target ELF2UF2Build
[  4%] Building ASM object vendor/pico-vfs/pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[  9%] Linking ASM executable bs2_default.elf
[  9%] Built target bs2_default
[  9%] Generating bs2_default.bin
[  9%] Generating bs2_default_padded_checksummed.S
[  9%] Built target bs2_default_padded_checksummed_asm
[  9%] Building C object CMakeFiles/sqlite3.dir/src/shell.c.obj
[  9%] Building C object CMakeFiles/sqlite3.dir/src/sqlite3.c.obj
[ 13%] Building C object CMakeFiles/sqlite3.dir/src/fallback.c.obj
/home/david/Projects/pslite/pico-sqlite/src/fallback.c:42:51: error: argument 2 of type 'const struct timeval[2]' with mismatched bound [-Werror=array-parameter=]
   42 | int utimes(const char *path, const struct timeval times[2]) {
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/newlib/sys/resource.h:4,
                 from /home/david/Projects/pslite/pico-sqlite/src/fallback.c:4:
/usr/include/newlib/sys/time.h:417:55: note: previously declared as 'const struct timeval *'
  417 | int utimes (const char *__path, const struct timeval *__tvp);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/sqlite3.dir/build.make:104: CMakeFiles/sqlite3.dir/src/fallback.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1627: CMakeFiles/sqlite3.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ 
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ 
oyama commented 5 months ago

Thanks for the feedback. This is what makes the difference...

It seems that the headers are different in my environment. I have to check my compiler and try to switch. I wonder which variables I can use...

int utimes(const char *path, const struct timeval *__tvp);.

int utimes(const char *path, const struct timeval times[2]);.
/Users/oyama/src/github.com/oyama/pico-sqlite/src/fallback.c:42:52: error: argument 2 of type 'const struct timeval *' declared as a pointer [-Werror=array-parameter=]
   42 | int utimes(const char *path, const struct timeval *__tvp) {
      |                              ~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/resource.h:8,
                 from /Users/oyama/src/github.com/oyama/pico-sqlite/src/fallback.c:4:
/Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/time.h:417:27: note: previously declared as an array 'const struct timeval[2]'
  417 | int utimes (const char *, const struct timeval [2]);
oyama commented 5 months ago

UTIMES is not important and I removed it once.

298c3ad

DeeJay commented 5 months ago

Thank you. Build now runs to completion and generates an sqlite3.uf2 file.

david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ picotool info sqlite3.uf2
File sqlite3.uf2:

Program Information
 name:      sqlite3
 features:  UART stdin / stdout
            USB stdin / stdout
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ ls -al sqlite3.uf2
-rw-r--r-- 1 david david 1262592 May 31 15:35 sqlite3.uf2
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $ file sqlite3.uf2
sqlite3.uf2: UF2 firmware image, family Raspberry Pi RP2040, address 0x10000000, 2466 total blocks
david@rp54bw64full0512:~/Projects/pslite/pico-sqlite/build $