righthalfplane / SdrGlut

SdrGlut is a simple software defined radio - using glut and glui for its interface
MIT License
86 stars 15 forks source link

sdrReceive M1 mac compile errors #31

Open pmosx21 opened 2 years ago

pmosx21 commented 2 years ago

hello,

I am trying to build sdrReceive from source but I am getting this error:

make -f makefileMACINTOSH 
c++ -std=c++11  -O2 -I/usr/include  -I/opt/X11/include -Wall -DGL_SILENCE_DEPRECATION -Wno-return-type-c-linkage -Wno-deprecated-declarations   -c -o src/cReceive.o src/cReceive.cpp
src/cReceive.cpp:22:10: fatal error: 'df.h' file not found
#include <df.h>
         ^~~~~~
1 error generated.
make: *** [src/cReceive.o] Error 1

I compiled coreutils from src but it didn't clear my error.

Any ideas? the M1 mac is always a bummer - thanks!

M1 Mac 12.4 OSx

righthalfplane commented 2 years ago

The M1 Mac needs some addition stuff - I just it put out on SdrGlut -

Build and install the HDF libraries-

cd hdflib chmod +x install.txt ./install.txt cd ..

Then build sdrReceive -

cd sdrReceive make -f makefileM1Brew -j 8 sdrReceive.x -h

pmosx21 commented 2 years ago

the hdflib install script fails with this:

checking shell variables initial values... done checking build system type... Invalid configurationarm64-apple-darwin21.5.0': machine arm64-apple' not recognized configure: error: /bin/sh bin/config.sub arm64-apple-darwin21.5.0 failed make: *** [_config] Error 1

from my research it looks like there is a problem with uname, you get different results from

/usr/local/bin/uname
arm64
/opt/homebrew/opt/coreutils/libexec/gnubin/uname -p
arm

thoughts?

https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html

I was able to fix this by updating your config.guess and config.sub files in /hdf-4.2.15/bin/ directory.

$ wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' $ wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

pmosx21 commented 2 years ago

I am now here trying to build on M1 Mac

libtool: compile:  gfortran -O2 -c vattrff.f -o vattrff.o
mfgrff.f:155:48:

  132 |       mgsnatt = mgisattr(riid, name, nt, count, data, len(name))
      |                                                2
......
  155 |       mgsattr = mgisattr(riid, name, nt, count, data, len(name))
      |                                                1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(*)/INTEGER(4)).
make[4]: *** [mfgrff.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: compile:  gfortran -O2 -c vgff.f -o vgff.o
mv -f .deps/mfanf.Tpo .deps/mfanf.Plo
mv -f .deps/mfgrf.Tpo .deps/mfgrf.Plo
mv -f .deps/vattrf.Tpo .deps/vattrf.Plo
mv -f .deps/vgf.Tpo .deps/vgf.Plo
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Password:
Making install in hdf
Making install in src
/bin/sh ../../libtool  --tag=F77   --mode=compile gfortran  -O2 -c -o mfgrff.lo mfgrff.f
libtool: compile:  gfortran -O2 -c mfgrff.f -o mfgrff.o
mfgrff.f:155:48:

  132 |       mgsnatt = mgisattr(riid, name, nt, count, data, len(name))
      |                                                2
......
  155 |       mgsattr = mgisattr(riid, name, nt, count, data, len(name))
      |                                                1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(*)/INTEGER(4)).
make[2]: *** [mfgrff.lo] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

thoughts? https://forum.hdfgroup.org/t/hdf-4-2-14-compilation-error-with-gcc-10/6625

I will keep digging but losing at this moment :)

righthalfplane commented 2 years ago

@pmosx21

What version of MacOS are you running ?

You should be using "/usr/bin/uname" not other versions.

The things that you have in /usr/local are messing up the install. I was having the same problem - so I saved everything in /usr/local to a tar file and removed all of the files and folders from /usr/local.

I don't understand - the "install.txt" script disables fortran -

configure --prefix=/usr/local --disable-fortran --with-jpeg=/usr/local --with-zlib=/usr/local

so it should not be trying to use it.