pi3g / bme68x-python-library

Python 3 Library for BME688 and BME680 (Bosch Sensortec sensors), supports Bosch BSEC
MIT License
46 stars 18 forks source link

sudo python3 setup.py install doesn't compile #1

Open coralnode opened 3 years ago

coralnode commented 3 years ago

There are multiple issues with bme68xmodule.c

pi@raspberrypi:~/bme688/bme68x-python-library $ sudo python3 setup.py install

running install running bdist_egg running egg_info writing bme68x.egg-info/PKG-INFO writing dependency_links to bme68x.egg-info/dependency_links.txt writing top-level names to bme68x.egg-info/top_level.txt reading manifest file 'bme68x.egg-info/SOURCES.txt' writing manifest file 'bme68x.egg-info/SOURCES.txt' installing library code to build/bdist.linux-armv6l/egg running install_lib running build_py running build_ext building 'bme68x' extension arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/usr/include/python3.7m -c bme68xmodule.c -o build/temp.linux-armv6l-3.7/bme68xmodule.o -D BSEC In file included from BSEC_2.0.6.1_Generic_Release_04302021/algo/normal_version/bin/RaspberryPi/PiThree_ArmV6/bsec_interface.h:73, from internal_functions.h:22, from bme68xmodule.c:4: bme68xmodule.c: In function ‘bme_set_heatr_conf’: BSEC_2.0.6.1_Generic_Release_04302021/algo/normal_version/bin/RaspberryPi/PiThree_ArmV6/bsec_datatypes.h:88:38: error: expected identifier before ‘(’ token

define BSEC_SAMPLE_RATE_DISABLED (65535.0f) /!< Sample rate of a disabled sensor /

                                  ^

bme68xmodule.c:357:42: note: in expansion of macro ‘BSEC_SAMPLE_RATE_DISABLED’ requested_virtual_sensors[0].BSEC_SAMPLE_RATE_DISABLED; ^~~~~~~~~ bme68xmodule.c: In function ‘bme_get_bsec_data’: bme68xmodule.c:516:9: error: ‘bsec_rlst’ undeclared (first use in this function); did you mean ‘bsec_rslt’? bsec_rlst = bsec_read_data(self->data, &data_length, time_stamp, bsec_inputs, &num_bsec_inputs, sensor_settings.process_data, sensor_settings.op_mode, &(self->bme)); ^~~~~ bsec_rslt bme68xmodule.c:516:9: note: each undeclared identifier is reported only once for each function it appears in bme68xmodule.c: In function ‘bme68x_init_type’: bme68xmodule.c:231:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread(&serialized_settings[0], sizeof(unsigned char), BSEC_MAX_PROPERTY_BLOB_SIZE, bsec_conf); ^~~~~~~~~~~~~~~~~~~~~ error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

coralnode commented 3 years ago

Problem is in this line in bme68xmodule.c.

requested_virtual_sensors[0].BSEC_SAMPLE_RATE_DISABLED;

I think it should be:

requested_virtual_sensors[0].sample_rate = BSEC_SAMPLE_RATE_DISABLED;

palla89 commented 3 years ago

I had same problem, there are also other two typos in the same file that prevented the building to finish successfully