I get an error saying
fatal error: stm32l0xx_hw_conf.h: No such file or directory
even though I have included stm32l0xx_hw_conf.h in the same project. How do I solve this error?
Edit: The console output for this error is:
Invoking: MCU GCC Compiler
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Debug
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft
-DHAL_OK -DSTM32L0 -DSTM32L071xx -DUSE_MIROMICO_FMLR -DUSE_HAL_DRIVER -DUSE_BAND_868 -DSENSOR_ENABLED -DDEBUG -I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/inc"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I../../../../../../../../Drivers/CMSIS/Device/ST/STM32L1xx/Include -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Device/ST/STM32L0xx/Include"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/FMLR" -I../../../../../../../../Drivers/STM32L1xx_HAL_Driver/Inc -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Include" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Crypto"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Mac"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Phy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Utilities"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/Common" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/sts_sht_21"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/bmp280" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Core"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das/Phy" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Projects/MultiSensorHub/src/debug.d" -MT"Projects/MultiSensorHub/src/debug.o" -o "Projects/MultiSensorHub/src/debug.o"
"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/src/debug.c"
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Debug
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft
-DHAL_OK -DSTM32L0 -DSTM32L071xx -DUSE_MIROMICO_FMLR -DUSE_HAL_DRIVER -DUSE_BAND_868 -DSENSOR_ENABLED -DDEBUG -I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/inc"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I../../../../../../../../Drivers/CMSIS/Device/ST/STM32L1xx/Include -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Device/ST/STM32L0xx/Include"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/FMLR" -I../../../../../../../../Drivers/STM32L1xx_HAL_Driver/Inc -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Include" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Crypto"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Mac"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Phy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Utilities"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/Common" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/sts_sht_21"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/bmp280" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Core"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das/Phy" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Projects/MultiSensorHub/src/hw_gpio.d" -MT"Projects/MultiSensorHub/src/hw_gpio.o" -o "Projects/MultiSensorHub/src/hw_gpio.o"
"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/src/hw_gpio.c"
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Debug
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft
-DHAL_OK -DSTM32L0 -DSTM32L071xx -DUSE_MIROMICO_FMLR -DUSE_HAL_DRIVER -DUSE_BAND_868 -DSENSOR_ENABLED -DDEBUG -I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/inc"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc
-I/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/SW4STM32/Miromico-FMLR/Drivers/STM32L0xx_HAL_Driver/Inc"
-I../../../../../../../../Drivers/CMSIS/Device/ST/STM32L1xx/Include -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Device/ST/STM32L0xx/Include"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/FMLR" -I../../../../../../../../Drivers/STM32L1xx_HAL_Driver/Inc -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/STM32L0xx_HAL_Driver/Inc"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/CMSIS/Include" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Crypto"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Mac"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Phy"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Utilities"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/Common" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/sts_sht_21"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/Components/bmp280" -I"/home/dinesh/fmlr_bitbucket/lorawan/Middlewares/Third_Party/Lora/Core"
-I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das" -I"/home/dinesh/fmlr_bitbucket/lorawan/Drivers/BSP/sx1272mb2das/Phy" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Projects/MultiSensorHub/src/bsp.d" -MT"Projects/MultiSensorHub/src/bsp.o" -o "Projects/MultiSensorHub/src/bsp.o"
"/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/src/bsp.c"
In file included from
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/inc/hw.h:72:0,from
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/src/bsp.c:50:
/home/dinesh/fmlr_bitbucket/lorawan/Projects/Multi/Applications/LoRa/MultiSensorHub/inc/hw_conf.h:123:10:
fatal error: stm32l0xx_hw_conf.h: No such file or directory #include
"stm32l0xx_hw_conf.h"
You need to set the path to the include file in the project setting (if its a managed project) or the makefile if it is not. Adding a file to the project does not add it to the include path.
It is possible you need to re-index the project. In Eclipse, you can right click the project and select Index->Rebuild.
Related
I am trying to connect to a Postgres db trough MySQL Workbench.
Following the documentation we need to install a driver for psql in our machine.
I am running a MacOS Big Sur 11.2.3.
After run CFLAGS="-arch i386 -arch x86_64" make I'm getting the following error:
/Library/Developer/CommandLineTools/usr/bin/make all-am
source='info.c' object='info.lo' libtool=yes \
depfile='.deps/info.Plo' tmpdepfile='.deps/info.TPlo' \
depmode=gcc3 /bin/sh ./depcomp \
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c -o info.lo `test -f 'info.c' || echo './'`info.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c info.c -MT info.lo -MD -MP -MF .deps/info.TPlo -fno-common -DPIC -o info.lo
In file included from info.c:19:
./psqlodbc.h:41:10: fatal error: 'sql.h' file not found
#include <sql.h>
^~~~~~~
1 error generated.
make[1]: *** [info.lo] Error 1
make: *** [all] Error 2
It seems that the 'sql.h' file is not found.
How to solve this issue?
Runing the command in the instruction:
pip install -U spacy
It fails to build wheel for Building wheels for collected packages: spacy, murmurhash, cymem, preshed, thinc, ujson, regex, cytoolz
This is the error shown on the terminal.
Running setup.py bdist_wheel for spacy ... error
Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/spacy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-wheel-swjw2gll --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/spacy
copying spacy/lemmatizer.py -> build/lib.macosx-10.13-x86_64-3.6/spacy
copying spacy/compat.py -> build/lib.macosx-10.13-x86_64-3.6/spacy
...
...
copying spacy/tests/tokenizer/sun.txt -> build/lib.macosx-10.13-x86_64-3.6/spacy/tests/tokenizer
running build_ext
building 'spacy.parts_of_speech' extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/spacy
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes /usr/local/opt/openssl/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/spacy/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c spacy/parts_of_speech.cpp -o build/temp.macosx-10.13-x86_64-3.6/spacy/parts_of_speech.o -O2 -Wno-strict-prototypes -Wno-unused-function
clang: warning: /usr/local/opt/openssl/include: 'linker' input unused [-Wunused-command-line-argument]
clang++ -bundle -undefined dynamic_lookup /usr/local/opt/openssl/lib /usr/local/opt/openssl/include build/temp.macosx-10.13-x86_64-3.6/spacy/parts_of_speech.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -o build/lib.macosx-10.13-x86_64-3.6/spacy/parts_of_speech.cpython-36m-darwin.so -Wl,-rpath,#loader_path/../spacy/platform/darwin/lib
ld: can't map file, errno=22 file '/usr/local/opt/openssl/include' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
----------------------------------------
Failed building wheel for spacy
Running setup.py clean for spacy
Running setup.py bdist_wheel for murmurhash ... error
Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-wheel-9ytvwkua --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/murmurhash
copying murmurhash/__init__.py -> build/lib.macosx-10.13-x86_64-3.6/murmurhash
copying murmurhash/about.py -> build/lib.macosx-10.13-x86_64-3.6/murmurhash
creating build/lib.macosx-10.13-x86_64-3.6/murmurhash/tests
copying murmurhash/tests/__init__.py -> build/lib.macosx-10.13-x86_64-3.6/murmurhash/tests
copying murmurhash/tests/test_import.py -> build/lib.macosx-10.13-x86_64-3.6/murmurhash/tests
copying murmurhash/mrmr.pyx -> build/lib.macosx-10.13-x86_64-3.6/murmurhash
copying murmurhash/__init__.pxd -> build/lib.macosx-10.13-x86_64-3.6/murmurhash
copying murmurhash/mrmr.pxd -> build/lib.macosx-10.13-x86_64-3.6/murmurhash
creating build/lib.macosx-10.13-x86_64-3.6/murmurhash/include
creating build/lib.macosx-10.13-x86_64-3.6/murmurhash/include/murmurhash
copying murmurhash/include/murmurhash/MurmurHash2.h -> build/lib.macosx-10.13-x86_64-3.6/murmurhash/include/murmurhash
copying murmurhash/include/murmurhash/MurmurHash3.h -> build/lib.macosx-10.13-x86_64-3.6/murmurhash/include/murmurhash
running build_ext
building 'murmurhash.mrmr' extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/murmurhash
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes /usr/local/opt/openssl/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/murmurhash/murmurhash/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c murmurhash/mrmr.cpp -o build/temp.macosx-10.13-x86_64-3.6/murmurhash/mrmr.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: warning: /usr/local/opt/openssl/include: 'linker' input unused [-Wunused-command-line-argument]
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes /usr/local/opt/openssl/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/murmurhash/murmurhash/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c murmurhash/MurmurHash2.cpp -o build/temp.macosx-10.13-x86_64-3.6/murmurhash/MurmurHash2.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: warning: /usr/local/opt/openssl/include: 'linker' input unused [-Wunused-command-line-argument]
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes /usr/local/opt/openssl/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/private/var/folders/9t/0qgpwgy906z_sww71dnkgkr80000gn/T/pip-install-9ygkdvbw/murmurhash/murmurhash/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c murmurhash/MurmurHash3.cpp -o build/temp.macosx-10.13-x86_64-3.6/murmurhash/MurmurHash3.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: warning: /usr/local/opt/openssl/include: 'linker' input unused [-Wunused-command-line-argument]
clang++ -bundle -undefined dynamic_lookup /usr/local/opt/openssl/lib /usr/local/opt/openssl/include build/temp.macosx-10.13-x86_64-3.6/murmurhash/mrmr.o build/temp.macosx-10.13-x86_64-3.6/murmurhash/MurmurHash2.o build/temp.macosx-10.13-x86_64-3.6/murmurhash/MurmurHash3.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -o build/lib.macosx-10.13-x86_64-3.6/murmurhash/mrmr.cpython-36m-darwin.so
ld: can't map file, errno=22 file '/usr/local/opt/openssl/lib' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
----------------------------------------
Failed building wheel for murmurhash
Running setup.py clean for murmurhash
Similar error for the rest of the libraries.
It probably has something to do with finding python header files. And I checked the location using this command :
python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/include/python3.6m
It has all the header files.
This answer (Failed building wheel for spacy) suggests installing the wheel individually. How do I do that on Mac OS X?
The best way to download Spacy and work with it is to download it manually and link it. Below command is used to download it and link it to your python libraries:
Command to download it:
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
Link that will explain more: https://spacy.io/usage/models#usage-link
When I was trying to build my first custom rom based on 7.1.1 (lineage os) the following error occurred.
SPECS ARE :
Macbook pro 2015 retina
Ram:8GB
Storage:512
Processor Name: Intel Core i5
Processor Speed: 2.9 GHz
OS: MacOs Sierra 10.12.2
Xcode:8.2.1(8C1002)
Full Command text is given below:
vibhoothis-MacBook-Pro:los vibhoothiiaanand$ brunch oneplus2
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:268: *** No matches for product "lineage_oneplus2". Stop.
** Warning: 'oneplus2' is using CM-based makefiles. This will be deprecated in the next major release.
Looking for dependencies in device/oneplus/oneplus2
Looking for dependencies in device/oppo/common
Looking for dependencies in device/qcom/common
Dependencies file not found, bailing out.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.1
LINEAGE_VERSION=14.1-20170129-UNOFFICIAL-oneplus2
TARGET_PRODUCT=cm_oneplus2
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-16.3.0-x86_64-i386-64bit
HOST_CROSS_OS=
HOST_CROSS_ARCH=
HOST_CROSS_2ND_ARCH=
HOST_BUILD_TYPE=release
BUILD_ID=NMF26V
OUT_DIR=/Users/vibhoothiiaanand/Desktop/los/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.1
LINEAGE_VERSION=14.1-20170129-UNOFFICIAL-oneplus2
TARGET_PRODUCT=cm_oneplus2
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-16.3.0-x86_64-i386-64bit
HOST_CROSS_OS=
HOST_CROSS_ARCH=
HOST_CROSS_2ND_ARCH=
HOST_BUILD_TYPE=release
BUILD_ID=NMF26V
OUT_DIR=/Users/vibhoothiiaanand/Desktop/los/out
============================================
Running kati to generate build-cm_oneplus2.ninja...
/Users/vibhoothiiaanand/Desktop/los/out/build-cm_oneplus2.ninja is missing, regenerating...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.1
LINEAGE_VERSION=14.1-20170129-UNOFFICIAL-oneplus2
TARGET_PRODUCT=cm_oneplus2
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-16.3.0-x86_64-i386-64bit
HOST_CROSS_OS=
HOST_CROSS_ARCH=
HOST_CROSS_2ND_ARCH=
HOST_BUILD_TYPE=release
BUILD_ID=NMF26V
OUT_DIR=/Users/vibhoothiiaanand/Desktop/los/out
============================================
art/build/Android.common.mk:51: unsupported HOST_ARCH=x86_64
build/core/binary.mk:1253: external/deqp/Android.mk: libdeqp: Unused source files: \
build/core/binary.mk:1253: external/deqp/Android.mk: libdeqp: Unused source files: \
build/core/binary.mk:1253: external/pdfium/third_party/pdfiumbigint.mk: libpdfiumbigint: Unused source files: bigint/BigInteger.cc bigint/BigIntegerUtils.cc bigint/BigUnsigned.cc bigint/BigUnsignedInABase.cc
build/core/binary.mk:1253: external/pdfium/third_party/pdfiumbigint.mk: libpdfiumbigint: Unused source files: bigint/BigInteger.cc bigint/BigIntegerUtils.cc bigint/BigUnsigned.cc bigint/BigUnsignedInABase.cc
./external/speex/Android.mk:56: TODOArm64: enable neon in libspeex
frameworks/av/camera/cameraserver/Android.mk:18: Target has integrated cameraserver into mediaserver. This is weakening security measures introduced in 7.0
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
find: /Users/vibhoothiiaanand/Desktop/los/out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates: No such file or directory
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
build/core/Makefile:53: Duplicate header copy: /Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/obj/include/qcom/display/copybit.h
build/core/Makefile:53: Defined in: hardware/qcom/display-caf/msm8994/libcopybit/Android.mk hardware/qcom/display-caf/msm8994/libcopybit/Android.mk
build/core/Makefile:53: Duplicate header copy: /Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/obj/include/qcom/display/copybit_priv.h
build/core/Makefile:53: Defined in: hardware/qcom/display-caf/msm8994/libcopybit/Android.mk hardware/qcom/display-caf/msm8994/libcopybit/Android.mk
build/core/Makefile:53: Duplicate header copy: /Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/obj/include/qcom/display/c2d2.h
build/core/Makefile:53: Defined in: hardware/qcom/display-caf/msm8994/libcopybit/Android.mk hardware/qcom/display-caf/msm8994/libcopybit/Android.mk
No private recovery resources for TARGET_DEVICE oneplus2
build/core/dex_preopt.mk:74: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/dex_bootjars/system/framework/telephony-ext_nodex.jar'
build/core/dex_preopt.mk:74: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/dex_bootjars/system/framework/telephony-ext_nodex.jar'
build/core/dex_preopt_libart_boot.mk:49: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm64/boot-telephony-ext.art'
build/core/dex_preopt_libart_boot.mk:49: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm64/boot-telephony-ext.art'
build/core/dex_preopt_libart_boot.mk:49: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm64/boot-telephony-ext.oat'
build/core/dex_preopt_libart_boot.mk:49: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm64/boot-telephony-ext.oat'
build/core/dex_preopt_libart_boot.mk:49: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm/boot-telephony-ext.art'
build/core/dex_preopt_libart_boot.mk:49: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm/boot-telephony-ext.art'
build/core/dex_preopt_libart_boot.mk:49: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm/boot-telephony-ext.oat'
build/core/dex_preopt_libart_boot.mk:49: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/system/framework/arm/boot-telephony-ext.oat'
build/core/java.mk:334: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/common/obj/APPS/Dialer_intermediates/src/src/org/codeaurora/presenceserv/IPresenceService.java'
build/core/java.mk:334: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/common/obj/APPS/Dialer_intermediates/src/src/org/codeaurora/presenceserv/IPresenceService.java'
build/core/java.mk:334: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/common/obj/APPS/Dialer_intermediates/src/src/org/codeaurora/presenceserv/IPresenceServiceCB.java'
build/core/java.mk:334: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/common/obj/APPS/Dialer_intermediates/src/src/org/codeaurora/presenceserv/IPresenceServiceCB.java'
build/core/base_rules.mk:316: warning: overriding commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:316: warning: ignoring old commands for target `/Users/vibhoothiiaanand/Desktop/los/out/target/product/oneplus2/root/res/images/charger/battery_fail.png'
Starting build with ninja
ninja: Entering directory `.'
[ 0% 80/46297] host C++: libaapt2 <= ...se/tools/aapt2/filter/ConfigFilter.cpp
FAILED: /bin/bash -c "(prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++ -I device/oneplus/oneplus2/include -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates -I external/protobuf/src -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto -I frameworks/base/tools/aapt2 -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates -I libnativehelper/include/nativehelper \$(cat /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem tools/include -isystem /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/include -c -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /applications/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -DMACOSX_DEPLOYMENT_TARGET=10.12 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -integrated-as -fstack-protector-strong -integrated-as -target x86_64-apple-darwin -isystem /applications/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo -Wno-inconsistent-missing-override -target x86_64-apple-darwin -Wall -Werror -Wno-unused-parameter -UNDEBUG -fPIC -D_DARWIN_UNLIMITED_STREAMS -Wno-deprecated-declarations -D_USING_LIBCXX -DGOOGLE_PROTOBUF_NO_RTTI -std=gnu++14 -std=c++11 -Wno-missing-field-initializers -fno-exceptions -fno-rtti -nostdinc++ -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.d -o /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.o frameworks/base/tools/aapt2/filter/ConfigFilter.cpp ) && (cp /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.d /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.d >> /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.P; rm -f /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/filter/ConfigFilter.d )"
In file included from frameworks/base/tools/aapt2/filter/ConfigFilter.cpp:17:
In file included from frameworks/base/tools/aapt2/ConfigDescription.h:20:
In file included from frameworks/base/tools/aapt2/util/StringPiece.h:20:
In file included from external/libcxx/include/ostream:138:
In file included from external/libcxx/include/ios:216:
In file included from external/libcxx/include/__locale:21:
frameworks/base/tools/aapt2/locale.h:42:37: error: unknown type name 'StringPiece'
bool initFromFilterString(const StringPiece& config);
^
1 error generated.
[ 0% 80/46297] host C++: libaapt2 <= ...tools/aapt2/compile/XmlIdCollector.cpp
FAILED: /bin/bash -c "(prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++ -I device/oneplus/oneplus2/include -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates -I external/protobuf/src -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates/proto -I frameworks/base/tools/aapt2 -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates -I /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/gen/STATIC_LIBRARIES/libaapt2_intermediates -I libnativehelper/include/nativehelper \$(cat /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem tools/include -isystem /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/include -c -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /applications/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.12 -DMACOSX_DEPLOYMENT_TARGET=10.12 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -integrated-as -fstack-protector-strong -integrated-as -target x86_64-apple-darwin -isystem /applications/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo -Wno-inconsistent-missing-override -target x86_64-apple-darwin -Wall -Werror -Wno-unused-parameter -UNDEBUG -fPIC -D_DARWIN_UNLIMITED_STREAMS -Wno-deprecated-declarations -D_USING_LIBCXX -DGOOGLE_PROTOBUF_NO_RTTI -std=gnu++14 -std=c++11 -Wno-missing-field-initializers -fno-exceptions -fno-rtti -nostdinc++ -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.d -o /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.o frameworks/base/tools/aapt2/compile/XmlIdCollector.cpp ) && (cp /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.d /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.d >> /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.P; rm -f /Users/vibhoothiiaanand/Desktop/los/out/host/darwin-x86/obj/STATIC_LIBRARIES/libaapt2_intermediates/compile/XmlIdCollector.d )"
In file included from frameworks/base/tools/aapt2/compile/XmlIdCollector.cpp:17:
In file included from frameworks/base/tools/aapt2/ResourceUtils.h:20:
In file included from frameworks/base/tools/aapt2/NameMangler.h:20:
In file included from frameworks/base/tools/aapt2/Resource.h:20:
In file included from frameworks/base/tools/aapt2/ConfigDescription.h:20:
In file included from frameworks/base/tools/aapt2/util/StringPiece.h:20:
In file included from external/libcxx/include/ostream:138:
In file included from external/libcxx/include/ios:216:
In file included from external/libcxx/include/__locale:21:
frameworks/base/tools/aapt2/locale.h:42:37: error: unknown type name 'StringPiece'
bool initFromFilterString(const StringPiece& config);
^
1 error generated.
[ 0% 80/46297] host Java: jarjar (/Us...IBRARIES/jarjar_intermediates/classes)
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (49 seconds) ####
Output is quite informative - there is an unknown type name 'StringPiece' at
frameworks/base/tools/aapt2/locale.h:42:37
Check whether include directive is present in file locale.h
#include "util/StringPiece.h"
and correct upon need.
If error persist, sync repos with force option
repo sync -j1 --force-sync
Right now my toolchain.cmake looks loke this:
CMAKE_FORCE_C_COMPILER(arm-none-eabi-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(arm-none-eabi-gcc GNU)
SET(CMAKE_ASM_COMPILER arm-none-eabi-as)
SET(CMAKE_OBJCOPY arm-none-eabi-objcopy CACHE INTERNAL "objcopy" FORCE)
SET(CMAKE_OBJDUMP arm-none-eabi-objdump CACHE INTERNAL "objdump" FORCE)
# Compiler Flags
SET(MCU_FLAGS "-mcpu=cortex-m3 -mthumb")
SET(CMAKE_BUILD_FLAGS "-O2 -g -mfpu=vfp -mfloat-abi=soft -Wa,-meabi=5 -ffunction-sections -fno-common -pedantic -Wall -Wextra -Wno-missing-field-initializers")
SET(CMAKE_C_FLAGS "${MCU_FLAGS} ${CMAKE_BUILD_FLAGS}" CACHE INTERNAL "c compiler flags")
SET(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS} CACHE INTERNAL "cxx compiler flags")
SET(CMAKE_ASM_FLAGS "-g -mcpu=cortex-m3 -mthumb -mfpu=vfp -mfloat-abi=soft -meabi=5 -warn" CACHE INTERNAL "asm compiler flags")
SET(CMAKE_EXE_LINKER_FLAGS "-mcpu=cortex-m3 -mthumb -Wall -Wextra -Wno-missing-field-initializers -g -nostartfiles -Wl,-T1.ld,-M=1.map,--gc-sections" CACHE INTERNAL "exe link flags")
The problem is that CMake passes to the Linker additionally the Compiler-flags! Is there any way to separate these two?
Another thing is if I use another compiler-tool-chain (Like Fujitsu Softtune) how can I tell CMake explicitly to take a Linker and not the compiler to Link objects?
Thanks
So i finally solved it. for evryone else with the same problem, i changed CMakelists as follow:
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C CXX ASM)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${LD_FLAGS_STR} -m ${PROJECT_NAME}.map")
set(CMAKE_C_LINK_EXECUTABLE "FLNK907S.EXE -o <TARGET> <LINK_FLAGS> <OBJECTS>")
and it works fine...
where ${LD_FLAGS_STR} is just the list of my linker flags (own variable). and LNK907S.EXE is the name of Linker i 'm using (Fujitsu).
Try using SET_TARGET_PROPERTIES to set the link flags, respectively:
SET(MCU_FLAGS "-mcpu=cortex-m3 -mthumb")
SET(CMAKE_BUILD_FLAGS "-O2 -g -mfpu=vfp -mfloat-abi=soft -Wa,-meabi=5 -ffunction-sections -fno-common -pedantic -Wall -Wextra -Wno-missing-field-initializers")
SET(CMAKE_C_FLAGS "${MCU_FLAGS} ${CMAKE_BUILD_FLAGS}")
SET(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
SET(CMAKE_ASM_FLAGS "-g -mcpu=cortex-m3 -mthumb -mfpu=vfp -mfloat-abi=soft -meabi=5 -warn")
SET_TARGET_PROPERTIES(FOO PROPERTIES LINK_FLAGS "-mcpu=cortex-m3 -mthumb -Wall -Wextra -Wno-missing-field-initializers -g -nostartfiles -Wl,-T1.ld,-M=1.map,--gc-sections")
Here, I have assumed your excutable is called "FOO". Note that the link libaries are specified on a per-target basis. If you need special compiler flags for the target only, you can use COMPILE_FLAGS in SET_TARGET_PROPERTIES as well.
With newer versions of cmake, using generator expressions [1] has been my preferred approach.
target_compile_options(${TARGET_NAME}
PRIVATE
$<$<COMPILE_LANGUAGE:C>:${C_DEFS} ${C_FLAGS}>
$<$<COMPILE_LANGUAGE:ASM>:${ASM_FLAGS}>)
[1] https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
I have these 3 commands that compile my program:
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"AESBest.d" -MT"AESBest.d" -o "AESBest.o" "AESBest.cpp"
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "main.cpp"
g++ -L/usr/include/cryptopp -o "Crypto" AESBest.o main.o -lcryptopp -lpthread
How is possible to create a makefile considering these 3 commands?
In Eclipse I receive output from the program in the shell, but in my bash, when I compile the bin file called "Crypto" and launch it, I have no output in my bash shell.
Why?
This will work:
all:
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"AESBest.d" -MT"AESBest.d" -o "AESBest.o" "AESBest.cpp"
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "main.cpp"
g++ -L/usr/include/cryptopp -o "Crypto" AESBest.o main.o -lcryptopp -lpthread
And you can break it down a little like this:
AESBest.o:
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"AESBest.d" -MT"AESBest.d" -o "AESBest.o" "AESBest.cpp"
main.o:
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "main.cpp"
Crypto:
g++ -L/usr/include/cryptopp -o "Crypto" AESBest.o main.o -lcryptopp -lpthread
And then simplify like this:
AESBest.o main.o: %.o : %.cpp
g++ -I/usr/include/cryptopp -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF$*.d -MT$*.d -o $# $<
Crypto: AESBest.o main.o
g++ -L/usr/include/cryptopp -o $# $^ -lcryptopp -lpthread