jvde-github/AIS-catcher

Does not build on MacOS Monterey 12.7.3

sbfreddie opened this issue · 16 comments

Build fails with output as follows
`build % cmake ..
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Required headers (can.h and raw/can.h) not found.
-- OPENSSL: found - /usr/local/Cellar/openssl@3/3.2.1/include, /usr/local/Cellar/openssl@3/3.2.1/lib/libssl.dylib, /usr/local/Cellar/openssl@3/3.2.1/lib/libcrypto.dylib
-- ZLIB: found - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib/libz.tbd
-- Checking for module 'libpq'
-- No package 'libpq' found
-- PQ: not found - PQ_INCLUDE_DIR-NOTFOUND, PQ_LIBRARY-NOTFOUND
-- Checking for module 'soxr'
-- Found soxr, version 0.1.3
-- SOXR: found - /usr/local/Cellar/libsoxr/0.1.3/include, /usr/local/Cellar/libsoxr/0.1.3/lib/libsoxr.dylib
-- Checking for module 'samplerate'
-- Found samplerate, version 0.2.2
-- libsamplerate: found - /usr/local/include, /usr/local/lib/libsamplerate.dylib
-- Checking for module 'librtlsdr'
-- Found librtlsdr, version 2.0.1
-- RTLSDR: found - /usr/local/Cellar/librtlsdr/2.0.1/include, /usr/local/Cellar/librtlsdr/2.0.1/lib/librtlsdr.dylib
-- Looking for rtlsdr_set_bias_tee
-- Looking for rtlsdr_set_bias_tee - found
-- RTLSDR: bias-tee support included.
-- Looking for rtlsdr_set_tuner_bandwidth
-- Looking for rtlsdr_set_tuner_bandwidth - found
-- RTLSDR: tuner badwidth support included.
-- SDRPLAY: found - /usr/local/include, /usr/local/lib/libsdrplay_api.so
-- Checking for module 'libairspy'
-- Found libairspy, version 1.0
-- AIRSPY: found /usr/local/Cellar/airspy/1.0.10/include/libairspy, /usr/local/Cellar/airspy/1.0.10/lib/libairspy.dylib
-- Checking for module 'libairspyhf'
-- Found libairspyhf, version 1.6
-- AIRSPYHF: found - /usr/local/Cellar/airspyhf/1.6.8/include/libairspyhf, /usr/local/Cellar/airspyhf/1.6.8/lib/libairspyhf.dylib
-- Checking for module 'libhackrf'
-- Found libhackrf, version 0.8
-- HACKRF: found - /usr/local/Cellar/hackrf/2023.01.1/include/libhackrf, /usr/local/Cellar/hackrf/2023.01.1/lib/libhackrf.dylib
-- ZMQ: found - /usr/local/Cellar/zeromq/4.3.5_1/include, /usr/local/Cellar/zeromq/4.3.5_1/lib/libzmq.dylib
-- Configuring done (1.7s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/freddie/AIS-catcher/build
freddie@Eds-MacBook-Pro build % make
[ 2%] Building CXX object CMakeFiles/AIS-catcher.dir/Application/Main.cpp.o
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
In file included from /Users/freddie/AIS-catcher/./Application/Receiver.h:30:
In file included from /Users/freddie/AIS-catcher/./DSP/Model.h:25:
/Users/freddie/AIS-catcher/./Library/NMEA.h:25:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
In file included from /Users/freddie/AIS-catcher/./Application/Receiver.h:31:
/Users/freddie/AIS-catcher/./IO/IO.h:27:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
In file included from /Users/freddie/AIS-catcher/./Application/Receiver.h:32:
/Users/freddie/AIS-catcher/./IO/Network.h:44:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
In file included from /Users/freddie/AIS-catcher/./Application/Receiver.h:34:
In file included from /Users/freddie/AIS-catcher/./Ships/DB.h:24:
/Users/freddie/AIS-catcher/./Library/JSONAIS.h:23:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
In file included from /Users/freddie/AIS-catcher/./Application/Receiver.h:34:
/Users/freddie/AIS-catcher/./Ships/DB.h:27:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:26:
/Users/freddie/AIS-catcher/./Application/Receiver.h:36:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:28:
/Users/freddie/AIS-catcher/./Application/Config.h:27:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
/Users/freddie/AIS-catcher/Application/Main.cpp:29:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
In file included from /Users/freddie/AIS-catcher/Application/Main.cpp:32:
/Users/freddie/AIS-catcher/./DBMS/PostgreSQL.h:31:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
9 warnings generated.
[ 4%] Building CXX object CMakeFiles/AIS-catcher.dir/Application/Prometheus.cpp.o
In file included from /Users/freddie/AIS-catcher/Application/Prometheus.cpp:18:
In file included from /Users/freddie/AIS-catcher/./Application/Prometheus.h:25:
/Users/freddie/AIS-catcher/./Library/JSONAIS.h:23:10: warning: non-portable path to file '"json/json.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "JSON/JSON.h"
^~~~~~~~~~~~~
"json/json.h"
/Users/freddie/AIS-catcher/./Library/JSONAIS.h:28:52: error: use of undeclared identifier 'JSON'
class JSONAIS : public SimpleStreamInOut<Message, JSON::JSON> {
^
/Users/freddie/AIS-catcher/./Library/JSONAIS.h:29:3: error: use of undeclared identifier 'JSON'
JSON::JSON json;
^
In file included from /Users/freddie/AIS-catcher/Application/Prometheus.cpp:18:
/Users/freddie/AIS-catcher/./Application/Prometheus.h:27:43: error: use of undeclared identifier 'JSON'
class PromotheusCounter : public StreamInJSON::JSON {
^
/Users/freddie/AIS-catcher/./Application/Prometheus.h:55:21: error: use of undeclared identifier 'JSON'
void Receive(const JSON::JSON* json, int len, TAG& tag);
^
/Users/freddie/AIS-catcher/Application/Prometheus.cpp:79:39: error: use of undeclared identifier 'JSON'
void PromotheusCounter::Receive(const JSON::JSON* json, int len, TAG& tag) {
^
1 warning and 5 errors generated.
make[2]: *** [CMakeFiles/AIS-catcher.dir/Application/Prometheus.cpp.o] Error 1
make[1]: *** [CMakeFiles/AIS-catcher.dir/all] Error 2
make: *** [all] Error 2`

Any idea how to solve this problem? It appears to be having some problem with JSON?

Thanks,
Ed

Hi Ed, thanks for raising.

This is related to the case insensitivity of the file system I would assume. The directory in the package is called JSON and this is how it is referred to in the source. So don't understand the warning and subsequent error. I will try to build it again on my system to see if I can reproduce, pehaps also in a Docker environment.

Question, do you have any specific settings on your macbook for case sensitive disk (as the compiler believes the directory is called "json" and not "JSON"?

Thanks, Jasper

My system is supposed to be case insensitive and in general it is not sensitive to case when you are using the finder and the other standard uses apps, however the entire underlying build system is case sensitive and has always been that way, as it is after all BSD Unix.

Thanks,
Ed

Thanks, will do some checks. Could you see what the output is of:

git config --global --get core.ignorecase

Here is what your command produces:

freddie@Eds-MacBook-Pro ~ % git config --global --get core.ignorecase
freddie@Eds-MacBook-Pro ~ %

Thanks,
Ed

Cannot replicate, even if I rename the JSON directory to json, I will get the warnings but no error. This is on Sonoma. Struggle to run Monterey virtually, but will have a look coming days.

Hi. I cannot get it to replicate. You might try to rename the "json" folder to "JSON" and the "json.h" to "JSON.h" and see if that works?

Could you build this for me on your Mac system with Sonoma? Post it somewhere were I can download it. I think if it works on Sonoma it should work on Monterey.
Thanks,
Ed

I will try to set up an build with Github actions. Are you using Intel or ARM?

My system is a 2015 MacBook pro so it is Intel

thanks,
Ed

I tried to use the git command: git config core.ignorecase true in the AIS-catcher folder but received the same errors, it seems their are at least 10 modules that specify JSON in all caps for some reason.

Ed

I looked a little closer at the folder AIS-catcher contents and the output of the build file and it appears that the cmake build system is not using the JSON folder contained in the AIS-catcher folder to build with, but instead it seems to be using a json folder from the system. The question is how do I convince cmake to use the folder inside the AIS-catcher folder instead of the system json file contained in the system?

Interesting, I changed (and uploaded) the cmake file to put the AIS-catcher directory first, perhaps this will then prioritize the project JSON directory over a system file. Let me know if this fixed it....

Also started to build the macos in a github action and publish the executable. I think it will not work though yet because the dependencies need to be resolved and in the right directories. So, not finished yet.

I will download and give it a shot!

Thanks,
Ed

That did the trick! It built and installed with no errors! Now to try it out and see what happens.
Thanks,
Ed

Great, was a good lead. Let’s see what happens now.

I will close this one, was actually a bug that was difficult to find and replicate. So thanks for the further insights. We can reopen again if other issues appear. Jasper