【问题标题】:fatal error: opening dependency file致命错误:打开依赖文件
【发布时间】:2017-06-22 05:50:41
【问题描述】:

我正在尝试在 contiki os 上使用 ECC 库。
但是我得到了一个依赖错误。我认为问题出在我的 Makefile 上,但我不确定哪里出了问题。

我从源https://github.com/nist-emntg/ecc-light-certificate 下载,但在我从源git 克隆后使用git submodule update 出现问题,因此我手动下载并粘贴了 contiki 文件到 contiki 文件夹中。
这可能是问题吗?

错误信息

> make TARGET=cooja clean 
rm -f *~ *core core *.srec \
    *.lst *.map \
    *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \
    *.ce *.co
rm -rf 
rm -rf obj_cooja

> make sender-node.cooja TARGET=cooja 
  CC        sender-node.c
sender-node.c: In function 'process_thread_sender_node_process':
sender-node.c:104:11: warning: unused variable 'pubKey' [-Wunused-variable]
mkdir obj_cooja
  CC        ../../../platform/cooja/./contiki-cooja-main.c
../../../platform/cooja/./contiki-cooja-main.c: In function 'contiki_init':
../../../platform/cooja/./contiki-cooja-main.c:230:14: warning: variable 'shortaddr' set but not used [-Wunused-but-set-variable]
../../../platform/cooja/./contiki-cooja-main.c:288:5: warning: passing argument 1 of 'rimeaddr_copy' from incompatible pointer type [enabled by default]
../../../core/./net/rime/rimeaddr.h:79:6: note: expected 'union rimeaddr_t *' but argument is of type 'uint8_t *'
mv contiki-cooja-main.o obj_cooja/mtype371.o
  CC        ../../../../ecc/ecc.c
../../../../ecc/ecc.c:700:1: fatal error: opening dependency file obj_cooja/../../../../ecc/ecc.d: No such file or directory
compilation terminated.
make: *** [obj_cooja/../../../../ecc/ecc.o] Error 1
Process returned error code 2

这是我的makefile

all: sender-node receiver-node root-node
extra: example tools tests
CONTIKI=../../..

WITH_UIP6=1
UIP_CONF_IPV6=1

include $(CONTIKI)/../Makefile.curve
CURVE_DIR=$(CONTIKI)/../ecc/curve-params
CFLAGS+= -DUIP_CONF_IPV6_RPL\
         -DSHA2_USE_INTTYPES_H \
         -DWITH_SHA256 \
         -D$(DOMAIN_PARAMS) \
         -DTHIRTYTWO_BIT_PROCESSOR \
         -DDOMAIN_PARAMS=$(DOMAIN_PARAMS)

CFLAGS+=-DPROJECT_CONF_H=\"project-conf.h\"

PROJECT_SOURCEFILES += $(CONTIKI)/../ecc/ecc.c $(CONTIKI)/../ecc/ecdsa.c $(CONTIKI)/../ecc/nn.c $(CONTIKI)/../sha2/sha2.c $(CONTIKI)/../certificate/certificate.c
PROJECTDIRS += sha2 ecc $(CURVE_DIR) certificate

include $(CONTIKI)/../ecc/curve-params/Makefile.curve_params

# mc1322x is little endian only
ifeq ($(TARGET),econotag)
CFLAGS+= -DWORDS_LITTLEENDIAN
endif

ifdef WITH_COMPOWER
APPS+=powertrace
CFLAGS+= -DCONTIKIMAC_CONF_COMPOWER=1 -DWITH_COMPOWER=1 -DQUEUEBUF_CONF_NUM=4
endif

ifdef SERVER_REPLY
CFLAGS+=-DSERVER_REPLY=$(SERVER_REPLY)
endif
ifdef PERIOD
CFLAGS+=-DPERIOD=$(PERIOD)
endif

include $(CONTIKI)/Makefile.include
example:
    make -C example

tools:
    make -C tools

tests:
    make -C tests

【问题讨论】:

    标签: c git makefile public-key-encryption contiki


    【解决方案1】:

    但是在我从源代码git clone 之后使用 git submodule update 时遇到问题,所以我手动下载 contiki 文件并将其粘贴到 contiki 文件夹中。

    您不能只下载任何 contiki 文件,因为子模块的想法是引用另一个 repo 的精确 SHA1。

    再次尝试克隆主仓库,这次使用--recursive(并确保使用最新的 Git 2.11.1)

    cd /path/to/ly/local/clone/of/ecc-light-certificate 
    cd ..
    move ecc-light-certificate ecc-light-certificate.old
    git clone --recursive https://github.com/nist-emntg/ecc-light-certificate
    

    错误是:

    no such remote ref 7a493c44edb6952bf82fc808b9dd91c30d49c871 
    Fetched in submodule path 'contiki', but it did not contain 7a493c44edb6952bf82fc808b9dd91c30d49c871.  
    Direct fetching of that commit failed
    

    首先:https://github.com/tcheneau/contiki@7a493c44edb6952bf82fc808b9dd91c30d49c871 确实存在。

    然而,查看它的commit page 7a493c4,你可以看到它不属于任何分支或标签:它是仍然保存在 GitHub 远程 repo 中的提交,但 默认获取 (因为,再一次,没有分支或标签包含它)

    您需要在nist-emntg/ecc-light-certificate/issues 项目上打开一个问题,以提醒他们该子模块 contiki 的不存在提交引用。

    如果您查找该提交消息,您会从原生 fix-native-build branch 中找到 commit 1396dfd

    C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git log --all --grep="prevent the native target"
    commit 1396dfd817424eb7d3218cc6c51186f80b032e9f
    Author: Tony Cheneau <tony.cheneau@nist.gov>
    Date:   Fri Oct 25 17:53:27 2013 -0400
    
        Fix a typo (?) that would prevent the native target from building the examples.
    

    这是典型的精心挑选的提交。

    解决你目前的情况,直接checkout正确的commit:

    C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git checkout 1396dfd817424eb7d3218cc6c51186f80b032e9f
    Checking out files: 100% (3223/3223), done.
    Note: checking out '1396dfd817424eb7d3218cc6c51186f80b032e9f'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:
    
      git checkout -b <new-branch-name>
    
    HEAD is now at 1396dfd81... Fix a typo (?) that would prevent the native target from building the examples.
    
    C:\Users\vonc\prog\git\ecc-light-certificate\contiki>git st
    HEAD detached at 1396dfd81
    nothing to commit, working tree clean
    

    【讨论】:

    • 嗨@VonC 关于这些命令 cd /path/to/ly/local/clone/of/ecc-light-certificate cd .. move ecc-light-certificate ecc-light-certificate.old 应该克隆后使用?
    • @lol 之前:这个想法只是移动你的旧克隆,然后在同一个文件夹中再次克隆同一个 repo。这将避免 Git 无法克隆,因为文件夹名称已经存在。
    • 我尝试使用 git clone --recursive。但它有同样的问题,它无法为 contiki 文件夹获取
    • @VnoC 错误:没有这样的远程参考 7a493c44edb6952bf82fc808b9dd91c30d49c871 在子模块路径“contiki”中获取,但它不包含 7a493c44edb6952bf82fc808b9dd91c30d49c871。直接获取该提交失败。
    • @VnoC 好的,我会提醒他们的。感谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-22
    • 1970-01-01
    • 1970-01-01
    • 2017-06-01
    • 2014-04-21
    • 2011-04-02
    • 2013-09-08
    相关资源
    最近更新 更多